_prefs = $prefs; if (!defined("AUTH_SESS_USER") or !defined("AUTH_SESS_LEVEL")) { trigger_error( "AUTH_SESS_USER or AUTH_SESS_LEVEL is not defined for the SessionPassUser method", E_USER_ERROR); exit; } $sess =& $GLOBALS['HTTP_SESSION_VARS']; // user hash: "[user][userid]" or object "user->id" if (strstr(AUTH_SESS_USER, "][")) { $sess = $GLOBALS['HTTP_SESSION_VARS']; // recurse into hashes: "[user][userid]", sess = sess[user] => sess = sess[userid] foreach (explode("][", AUTH_SESS_USER) as $v) { $v = str_replace(array("[", "]"), '', $v); $sess = $sess[$v]; } $this->_userid = $sess; } elseif (strstr(AUTH_SESS_USER, "->")) { // object "user->id" (no objects inside hashes supported!) list($obj, $key) = explode("->", AUTH_SESS_USER); $this->_userid = $sess[$obj]->$key; } else { $this->_userid = $sess[AUTH_SESS_USER]; } if (!isset($this->_prefs->_method)) _PassUser::_PassUser($this->_userid); $this->_level = AUTH_SESS_LEVEL; $this->_authmethod = 'Session'; } function userExists() { return !empty($this->_userid); } function checkPass($submitted_password) { return $this->userExists() and $this->_level > -1; } function mayChangePass() { return false; } } // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: