예제 #1
0
        public void Application_PostAuthenticateRequest()
        {
            HttpCookie cookie = Request.Cookies["TicketEmpleado"];

            if (cookie != null)
            {
                FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(cookie.Value);

                String username = ticket.Name;
                int    emp_no   = int.Parse(ticket.UserData);

                GenericIdentity     identidad = new GenericIdentity(username);
                RepositoryEmpleados repo      = new RepositoryEmpleados();
                Empleado            empleado  = repo.BuscarEmpleado(emp_no);
                HttpContext.Current.User = empleado;
            }
        }
예제 #2
0
        //SI NO ESCRIBIMOS BIEN EL METODO, NOS QUEDAMOS EN LOGIN
        public void Application_PostAuthenticateRequest()
        {
            HttpCookie cookie = Request.Cookies["TICKETEMPLEADO"];

            if (cookie != null)
            {
                String datos = cookie.Value;
                FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(datos);
                int             empno            = int.Parse(ticket.UserData);
                String          username         = ticket.Name;
                GenericIdentity identity         = new GenericIdentity(username);
                //GenericPrincipal usuario = new GenericPrincipal(identity, roles);

                //DE DONDE SACO ESTE EMPLEADO?
                RepositoryEmpleados repo     = new RepositoryEmpleados();
                Empleados           empleado = repo.BuscarEmpleado(empno);
                empleado.Identity        = identity;
                HttpContext.Current.User = empleado;
            }
        }
예제 #3
0
 public ServiceEmpleados()
 {
     this.repo = new RepositoryEmpleados();
 }
예제 #4
0
 public IdentityController(RepositoryEmpleados repo)
 {
     this.repo = repo;
 }
 public AuthController(RepositoryEmpleados repo
                       , HelperToken helpertoken)
 {
     this.repo        = repo;
     this.helpertoken = helpertoken;
 }
예제 #6
0
 public EmpleadosController(RepositoryEmpleados repo)
 {
     this.repo = repo;
 }
예제 #7
0
 public EmpleadosController()
 {
     this.repo = new RepositoryEmpleados();
 }
예제 #8
0
 public ValidacionController()
 {
     repo = new RepositoryEmpleados();
 }
예제 #9
0
 public AutorizacionEmpleadosToken()
 {
     this.repo = new RepositoryEmpleados();
 }
예제 #10
0
 public PracticaAjaxController()
 {
     this.repo = new RepositoryEmpleados();
 }
예제 #11
0
 public AuthController(RepositoryEmpleados repo
                       , IConfiguration configuration)
 {
     this.configuration = configuration;
     this.repo          = repo;
 }