예제 #1
0
 /**
  * Contructeur
  */
 public function __construct()
 {
     parent::__construct();
     $this->view = 'login';
     if ($this->_session->is_logged()) {
         Router::redirect("/Users", "refresh");
     }
 }
예제 #2
0
 public function __construct($pathinfo, $controller)
 {
     parent::__construct($pathinfo, $controller);
     if ($this->userid != 2 && $this->userid != 46 && $this->userid != 20949) {
         header('HTTP/1.1 301 Moved Permanently');
         header('location: /home/');
     }
 }
예제 #3
0
 /**
  * Constructeur
  */
 public function __construct()
 {
     parent::__construct();
     $this->view = 'Utilisateurs/user';
     if (isset($this->_session->user)) {
         $this->_session->user->refresh();
     }
 }
예제 #4
0
 public function __construct(array $extra = null)
 {
     parent::__construct($extra);
     $eventId = val($_GET, 'eventId');
     $id = val($_GET, 'id');
     if (!empty($eventId) && !empty($id)) {
         $_SESSION['material'][$id] = $eventId;
     }
     if (!empty($_SESSION['material'][$id])) {
         env('event', entry_sql('SELECT * FROM event WHERE eventId=:eventId', array('eventId' => $_SESSION['material'][$id])));
     }
 }
예제 #5
0
 public function __construct($registry)
 {
     parent::__construct($registry);
     if ($_SESSION['user']) {
         $this->user = $_SESSION['user'];
         $this->registry->template->assign("logged", TRUE);
         $this->registry->template->assign("username", $_SESSION['user']['name']);
     } else {
         $this->registry->template->assign("logged", FALSE);
     }
     $this->registry->template->assign("base_url", $this->registry->config['Site']['url']);
 }
예제 #6
0
 public function __construct($registry)
 {
     parent::__construct($registry);
     if (!isset($_POST['uni'])) {
         $_POST['uni	'] = '';
     }
     if (!isset($_POST['fullName'])) {
         $_POST['fullName'] = '';
     }
     if (!isset($_POST['securityLevel'])) {
         $_POST['securityLevel'] = '';
     }
     if (!isset($_POST['departmentCode'])) {
         $_POST['departmentCode'] = '';
     }
     $this->fullName = $_POST['fullName'];
     $this->secuityLevel = $_POST['securityLevel'];
     $this->departmentCode = $_POST['departmentCode'];
 }
예제 #7
0
 public function __construct($pathinfo, $controller)
 {
     parent::__construct($pathinfo, $controller);
     $this->size = 4500;
 }
예제 #8
0
 public final function setError($code, $msg)
 {
     self::$code = $code;
     self::$msg = $msg;
 }
예제 #9
0
 public function __construct()
 {
     parent::__construct();
     $this->openid = $this->model('openid');
 }
예제 #10
0
     $params = $_REQUEST['params'];
     //Comprobamos si el servicio solicitado es HTTP_SERVICE.
     if (array_key_exists($service, $services)) {
         if ($services[$service]['token_required']) {
             //Comprobamos si el token de sesión está presente en la petición.
             if ($token) {
                 //decodificamos el token de sesión.
                 $token = json_decode(base64_decode($token));
                 if (!is_null($params)) {
                     if (!is_array($params)) {
                         $params = (array) json_decode($params, true);
                     }
                     $params = $encode ? decodeParams($params) : $params;
                 }
                 //Ejecutamos la acción del controlador
                 $response = baseController::execute($services[$service]['controller'], $params);
                 //Codificamos los datos de la respuesta.
                 if ($encode) {
                     encodeData($response["response_message"]['data']['msg']);
                 }
                 //Enviamos respuesta
                 echo json_encode($response["response_message"]);
             } else {
                 echo json_encode(array("error" => true, "data" => "Acceso no permitido"));
             }
         }
     } else {
         echo json_encode(array("error" => true, "data" => "Servicio no disponible"));
     }
 } else {
     header($_SERVER['SERVER_PROTOCOL'] . " 500 Internal Error", true, 500);
예제 #11
0
 public function __construct()
 {
     parent::__construct();
 }
예제 #12
0
 function __construct()
 {
     parent::__construct();
     $this->user = new sevenUserModel();
     $this->list = new sevenListModel();
 }
예제 #13
0
 public function __construct($pathinfo, $controller)
 {
     parent::__construct($pathinfo, $controller);
     $this->_view->assign("active", "search");
 }
예제 #14
0
 function __construct($params)
 {
     // 这个需要考虑view,model-----依照最简单的去写
     parent::__construct($params);
     $this->model = new dataModel();
 }
예제 #15
0
 public function __construct()
 {
     parent::__construct();
     $this->oauthDataStore = new PartuzaOAuthDataStore();
 }
예제 #16
0
 function __construct()
 {
     parent::__construct();
     $this->model = new adminModel();
 }
예제 #17
0
 public function __construct()
 {
     parent::__construct();
     $this->user = new Usuarios();
 }
예제 #18
0
 public function __construct()
 {
     parent::__construct('web');
     $this->init();
 }
예제 #19
0
 /**
  * Constructeur
  */
 public function __construct()
 {
     parent::__construct();
     $this->view = 'test';
     $this->message = array();
 }
예제 #20
0
 /**
  * Constructeur
  */
 public function __construct()
 {
     parent::__construct();
     $this->view = 'Utilisateurs/admin';
     $this->authorization();
 }
예제 #21
0
 public function __construct()
 {
     parent::__construct();
     Session::init();
 }
예제 #22
0
 public function __construct($registry)
 {
     parent::__construct($registry);
 }
예제 #23
0
 function __construct($params)
 {
     // 这个需要考虑view,model-----依照最简单的去写
     parent::__construct($params);
 }
예제 #24
0
파일: server.php 프로젝트: sergio11/teVeo
 private function resolveService($service, $params, $conn)
 {
     try {
         //Ejecutamos la acción del controlador
         $response = baseController::execute($service['controller'], $params);
         //Comprobamos si es necesario ejecutar una tarea posterior
         if (isset($service['task_before_send'])) {
             //recogemos el nombre de la tarea.
             $task = $service['task_before_send'];
             if ($task == "attachUser") {
                 //la información.
                 $data = $response["task_before_send_data"];
                 $this->clients[$conn] = $data;
             } else {
                 if ($task == "detachUser") {
                     $this->clients->detach($conn);
                 } else {
                     if ($task == "requireUsersStatus") {
                         $contactos = $response["response_message"]["data"]["msg"];
                         $ids = array_map(function ($contacto) {
                             return $contacto["idRepresentado"];
                         }, $contactos);
                         foreach ($this->clients as $connection) {
                             $user = $this->clients[$connection];
                             //Buscamos si existe el usuario.
                             $idx = array_search($user["id"], $ids);
                             if (is_numeric($idx)) {
                                 $response["response_message"]["data"]["msg"][$idx]["status"] = "conectado";
                             }
                         }
                     }
                 }
             }
         }
         //Codificamos los datos de la respuesta.
         encodeData($response["response_message"]['data']['msg']);
         //Enviamos la respuesta al emisor.
         $this->send($conn, json_encode($response["response_message"]));
         //Si el servicio debe notificar a otros clientes
         if ($service['throw_event']) {
             //Obtenemos los targets
             $targets = $response["event_message"]["targets"];
             //Los eliminamos del evento
             unset($response["event_message"]["targets"]);
             if (is_array($targets) && sizeof($targets)) {
                 //recogemos ids parra facilitar búsqueda.
                 $ids = array_map(function ($target) {
                     return $target["id"];
                 }, $targets);
                 //recorremos usuarios conectados.
                 foreach ($this->clients as $connection) {
                     $user = $this->clients[$connection];
                     //Buscamos si existe el usuario.
                     $idx = array_search($user["id"], $ids);
                     if (is_numeric($idx)) {
                         //existe, le notificamos el evento.
                         $this->send($connection, json_encode(array_merge($response["event_message"], $targets[$idx])));
                     }
                 }
             }
         }
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }
 public function __construct()
 {
     parent::__construct();
     $this->user = $this->load->model('user');
 }