コード例 #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;
 }
コード例 #5
0
 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;
 }