CI_Session::all_userdata PHP Method

all_userdata() public method

Legacy CI_Session compatibility method
public all_userdata ( ) : array
return array $_SESSION, excluding flash data items
    public function all_userdata()
    {
        return $this->userdata();
    }

Usage Example

示例#1
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;
 }
All Usage Examples Of CI_Session::all_userdata