Project

General

Profile

Feature #20605 » 0011313_v2.patch

Administrator Admin, 2009-06-18 15:06

View differences:

t3lib/class.t3lib_userauth.php (Arbeitskopie)
* @subpackage t3lib
*/
class t3lib_userAuth {
const LOGOFF_OnUserLogout = 'onUserLogout';
const LOGOFF_OnUserLogin = 'onUserLogin';
const LOGOFF_OnSessionExpire = 'onSessionExpire';
const LOGOFF_OnNoUserLoggedIn = 'onNoUserLoggedIn';
var $global_database = ''; // Which global database to connect to
var $session_table = ''; // Table to use for session data.
var $name = ''; // Session/Cookie name
......
if ($this->writeStdLog) $this->writelog(255,2,0,2,'User %s logged out',Array($this->user['username'])); // Logout written to log
if ($this->writeDevLog) t3lib_div::devLog('User logged out. Id: '.$this->id, 't3lib_userAuth', -1);
$this->logoff();
$this->logoff(self::LOGOFF_OnUserLogout);
}
// active login (eg. with login form)
......
}
// delete old user session if any
$this->logoff();
$this->logoff(self::LOGOFF_OnUserLogin);
}
// Refuse login for _CLI users (used by commandline scripts)
......
}
} else {
$this->logoff(); // delete any user set...
$this->logoff(self::LOGOFF_OnSessionExpire); // delete any user set...
}
} else {
$this->logoff(); // delete any user set...
$this->logoff(self::LOGOFF_OnNoUserLoggedIn); // delete any user set...
}
return $user;
}
......
* Log out current user!
* Removes the current session record, sets the internal ->user array to a blank string; Thereby the current user (if any) is effectively logged out!
*
* @param string $event: The event that triggered this method (see self::LOGOFF_* constants)
* @return void
*/
function logoff() {
function logoff($event = NULL) {
if ($this->writeDevLog) t3lib_div::devLog('logoff: ses_id = '.$this->id, 't3lib_userAuth');
// Hook for pre-processing the logoff() method, requested and implemented by andreas.otto@dkd.de:
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'])) {
$_params = array();
$_params = array(
'event' => $event,
);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'] as $_funcRef) {
if ($_funcRef) {
t3lib_div::callUserFunction($_funcRef,$_params,$this);
......
// Hook for post-processing the logoff() method, requested and implemented by andreas.otto@dkd.de:
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing'])) {
$_params = array();
$_params = array(
'event' => $event,
);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing'] as $_funcRef) {
if ($_funcRef) {
t3lib_div::callUserFunction($_funcRef,$_params,$this);
(2-2/2)