Пример #1
0
        public ActionResult AsignarPassword(string d, string tokenNumber)
        {
            ManagerCookie cookie = new ManagerCookie();

            obj.userName = d;
            HttpContext.Response.Cookies.Add(cookie.CrearCookie(obj));
            return(View());
        }
Пример #2
0
        public void crearCookieNavegador(DataResult datos)
        {
            ManagerCookie cookie = new ManagerCookie();

            obj.token    = datos.token;
            obj.userName = datos.userName;

            //Obtiene el listado de cookies guardadas en la BD, utiliza el servicio RetornarCookies que recibe como parametro el número de Linea
            //Obtiene los objetos del Json de respuesta
            HttpContext.Response.Cookies.Add(cookie.CrearCookie(obj));
        }
Пример #3
0
        public ActionResult CambiarPassword(string tokenNumber, string passwordChange)
        {
            string        emailDesencriptado = string.Empty;
            ManagerCookie cookie             = new ManagerCookie();
            ClientCookie  coookieSession     = cookie.ObtenerCookie(HttpContext.Request.Cookies["userAuth"]);
            string        emailEncriptado    = string.IsNullOrEmpty(coookieSession.userName) ? string.Empty : coookieSession.userName.ToString();

            if (!emailEncriptado.IsEmpty())
            {
                Seguridad seguridad = new Seguridad();
                emailDesencriptado = seguridad.desencriptar(emailEncriptado);
            }
            long respuesta = new BRecuperarPassword().CambiarPassword(emailDesencriptado, tokenNumber, passwordChange);

            return(Json(respuesta));
        }
Пример #4
0
        // string urlBase = "https://www.grupos.co/";

        public ActionResult vuelosyOtros()
        {
            try
            {
                ManagerCookie cookie         = new ManagerCookie();
                ClientCookie  coookieSession = cookie.ObtenerCookie(HttpContext.Request.Cookies["userAuth"]);

                ViewData["userName"] = string.IsNullOrEmpty(coookieSession.userName) ? string.Empty : coookieSession.userName.ToString();

                if (coookieSession != null)
                {
                    return(View());
                }
                return(Content("<script language='javascript' type='text/javascript'>alert('Acceso no autorizado.');window.location.href = '" + urlBase + "';</script>"));
            }
            catch (GettingException ex)
            {
                StackTrace st    = new StackTrace(ex, true);
                StackFrame frame = st.GetFrame(0);
                throw new GettingException(string.Format("{0}", "Error: " + ex.Message.ToString() + " Origen: " + ex.TargetSite.ReflectedType.FullName.ToString() + " Metodo: " + frame.GetMethod().Name.ToString() + " Linea: " + frame.GetFileLineNumber().ToString()));
            }
        }