userdata() public method

Legacy CI_Session compatibility method
public userdata ( string $key = NULL ) : mixed
$key string Session data key
return mixed Session data value or NULL if not found
Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function get()
 {
     $value = $this->store->userdata($this->key);
     if ($value) {
         return unserialize($value);
     }
 }
Ejemplo n.º 2
0
 public function authenticate(MOXMAN_Auth_User $user)
 {
     $config = MOXMAN::getConfig();
     $session = new CI_Session();
     // Check logged in key
     $sessionValue = $session->userdata($config->get("CodeIgniterAuthenticator.logged_in_key", "loggedin"));
     if (!$sessionValue || $sessionValue === "false") {
         return false;
     }
     // Extend config with session prefixed sessions
     $sessionConfig = array();
     $configPrefix = $config->get("CodeIgniterAuthenticator.config_prefix", "moxiemanager");
     if ($configPrefix) {
         $allData = $session->all_userdata();
         foreach ($allData as $key => $value) {
             if (strpos($key, $configPrefix) === 0) {
                 $sessionConfig[substr($key, strlen($configPrefix) + 1)] = $value;
             }
         }
     }
     // Extend the config with the session config
     $config->extend($sessionConfig);
     // Replace ${user} with all config items
     $key = $config->get("CodeIgniterAuthenticator.user_key");
     if ($key) {
         $value = $session->userdata($key);
         $config->replaceVariable("user", $value);
         $user->setName($value);
     }
     return true;
 }
 /**
  * Setea el menu
  */
 public function setCollapse()
 {
     $menu_collapse = $this->session->userdata("menu_collapse");
     if ($menu_collapse) {
         $this->session->set_userdata("menu_collapse", false);
     } else {
         $this->session->set_userdata("menu_collapse", true);
     }
 }
 /**
  * 
  * @return string
  */
 public function render($html_object)
 {
     $menu_collapse = $this->session->userdata("menu_collapse");
     if ($menu_collapse) {
         return "";
     } else {
         return $this->_returnClass($html_object);
     }
 }
 /**
  * 
  * @return string
  */
 public function render()
 {
     $html = "";
     $lista = $this->usuario_rol_model->listarRolesPorUsuario($this->_session->userdata("session_idUsuario"));
     if (count($lista) > 0) {
         foreach ($lista as $rol) {
             $html .= "<li>" . "<a href=\"#\">" . "<i ></i> " . $rol["rol_c_nombre"] . "</a>" . "</li>";
         }
     }
     return $html;
 }
 /**
  * 
  * @return string
  */
 public function render()
 {
     $html = "";
     $lista = $this->usuario_region_model->listarPorUsuario($this->_session->userdata("session_idUsuario"));
     if (count($lista) > 0) {
         foreach ($lista as $usuario_region) {
             $nombre_region = new Direccion_Nombre_Region();
             $nombre_region->setId($usuario_region["id_region"]);
             $html .= "<li>" . "<a href=\"#\">" . "<i ></i> " . $nombre_region . "</a>" . "</li>";
         }
     }
     return $html;
 }
Ejemplo n.º 7
0
 function userdata($item)
 {
     $my_key = $this->my_prefix . $item;
     if (isset($_SESSION[$my_key])) {
         return $_SESSION[$my_key];
     }
     return parent::userdata($item);
 }
 /**
  * @param string $file_name
  * @return boolean
  */
 public function upload($file_name)
 {
     $path = $this->_nuevoDirectorio();
     $config = array('upload_path' => $path, 'allowed_types' => 'gif|jpg|png|bmp|doc|docx|pdf|xls|xlsx|txt|ppt|pptx|csv', 'max_size' => '0', 'max_width' => '0', 'max_height' => '0');
     $this->upload = new CI_Upload($config);
     if (!$this->upload->do_upload($file_name)) {
         rmdir($path);
         $this->_error = $this->upload->display_errors();
         return false;
     } else {
         $data = $this->upload->data();
         $relative_path = str_replace(realpath(BASEPATH . "../"), "", realpath($data["full_path"]));
         $relative_path = substr($relative_path, 1, strlen($relative_path));
         $insert = array("arch_c_tamano" => $data["file_size"], "arch_c_nombre" => $relative_path, "arch_c_mime" => $data["file_type"], "arch_c_hash" => $this->_fileHash(), "arch_f_fecha" => DATE("Y-m-d H:i:s"), "usu_ia_id" => $this->session->userdata('session_idUsuario'));
         $this->_archivo_model->query()->insert($insert);
         return true;
     }
 }
 /**
  * Filtra por las comunas del usuario
  * @param QueryBuilder $query
  */
 protected function _addQueryComunas(&$query)
 {
     $lista_comunas = $this->usuario_comunas->listaIdComunas($this->_session->userdata("session_idUsuario"));
     if (count($lista_comunas) > 0) {
         $con_coma = implode(",", $lista_comunas);
         $query->addWhere("a.ala_ia_id IN (SELECT ac.ala_ia_id FROM alertas_vs_comunas ac WHERE ac.com_ia_id IN(" . $con_coma . ") )");
     } else {
         $query->addWhere("1=0");
     }
 }
Ejemplo n.º 10
0
 /**
  * Return all images
  * @return array|mixed
  */
 public function getTemplateImages()
 {
     if (!$this->templateImages) {
         $imagesEncoded = $this->session->userdata($this->sessionKeys['template_images']);
         if (!$imagesEncoded) {
             return array();
         } else {
             $this->templateImages = $this->valuesHandler->output('array', $imagesEncoded);
         }
     }
     return $this->templateImages;
 }
 function __construct($menu_item = null)
 {
     parent::__construct();
     $this->menu_item = $menu_item;
     $this->load->model('languages_model');
     $get_lang = $this->input->get('l');
     //        dump($this->lang->language);die;
     if ($get_lang && array_key_exists($get_lang, $this->long_to_short)) {
         $this->current_language = $get_lang;
         $this->session->set_userdata('language', $get_lang);
     } else {
         if (!$this->session->userdata('language')) {
             $this->session->set_userdata('language', $this->getLanguage());
         } else {
             $this->current_language = $this->session->userdata('language');
         }
     }
     $this->lang->load("main", $this->current_language);
     $this->current_language_short = $this->long_to_short[$this->current_language];
     $this->menus = ['home' => ['url' => base_url(''), 'title' => lang('home'), 'additional_params' => 'data-href="1"'], 'contacts' => ['url' => base_url('contacts'), 'title' => lang('contacts'), 'additional_params' => 'data-href="11"'], 'about_me' => ['url' => base_url('about'), 'title' => lang('about_me'), 'additional_params' => ''], 'portfolio' => ['url' => base_url('portfolio'), 'title' => lang('portfolio'), 'additional_params' => '']];
 }
Ejemplo n.º 12
0
 public function userdata($item)
 {
     if ($this->sess_use_database === FALSE) {
         parent::userdata($item);
     } else {
         if (is_array($this->userdata) && count($this->userdata) > 0) {
             if (array_key_exists($item, $this->userdata)) {
                 return $this->userdata[$item];
             } else {
                 return FALSE;
             }
         } else {
             return FALSE;
         }
     }
 }
Ejemplo n.º 13
0
 /**
  * Fetch a specific item from the session array
  *
  * @access	public
  * @param	string
  * @return	string
  */
 function userdata($item)
 {
     if ($this->is_custom_session) {
         return $this->session_driver->userdata($item);
     } else {
         return parent::userdata($item);
     }
 }
 /**
  * Retorna arreglo con identificadores de roles
  * @return array
  */
 public function listarRoles()
 {
     $roles = explode(",", $this->_session->userdata("session_roles"));
     return $roles;
 }