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; }
function all_userdata() { $return = array(); /* get flash data we store in _SESSION */ foreach ($_SESSION as $key => $v) { if (!(substr($key, 0, strlen($this->my_prefix)) == $this->my_prefix)) { continue; } $my_key = substr($key, strlen($this->my_prefix)); $return[$my_key] = $v; } $parent_return = parent::all_userdata(); $return = array_merge($return, $parent_return); return $return; }
function all_userdata($prefix = '') { $user_data = parent::all_userdata(); return array_prefix($user_data, $prefix); }
/** * Fetch all session data * * @access public * @return array */ function all_userdata() { if ($this->is_custom_session) { return $this->session_driver->all_userdata(); } else { return parent::all_userdata(); } }