示例#1
0
 function valida()
 {
     $username = $_REQUEST['usuario'];
     $password = $this->Encripta($_REQUEST['contrasena']);
     $data = new Actor();
     $actor = $data->validaActor($username, $password);
     if ($actor != NULL) {
         date_default_timezone_set("america/lima");
         $_SESSION['codigo'] = $actor[0]['usuario'];
         $_SESSION['Autenticado'] = true;
         $_SESSION['apellidopaterno'] = $actor[0]['apellidopaterno'];
         $_SESSION['apellidomaterno'] = $actor[0]['apellidomaterno'];
         $_SESSION['nombres'] = $actor[0]['nombres'];
         $_SESSION['foto'] = $actor[0]['foto'];
         $_SESSION['idactor'] = $actor[0]['idactor'];
         $_SESSION['idrol'] = $actor[0]['idrol'];
         $_SESSION['nombrecompleto'] = $actor[0]['apellidopaterno'] . " " . $actor[0]['apellidomaterno'] . "," . $actor[0]['nombres'];
         $_SESSION['horaacceso'] = date("H:i:s");
         $_SESSION['nivelacceso'] = $actor[0]['nivelacceso'];
         $camino['ruta'] = "/index/index";
         //$camino['ruta']="/696e646578/696e646578";
         $this->view->show("ruteador.phtml", $camino);
         //var_export($this->view);
     } else {
         session_start();
         $_SESSION['mensaje_login'] = '******';
         header("Location: /actor/login/");
     }
 }