Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Add user.before_disconnect and user.after_disconnect hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Nov 13, 2013
1 parent a00c8ef commit 910b6a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/core/classes/class.AuthService.php
Expand Up @@ -387,13 +387,17 @@ public static function updateUser($userObject)
public static function disconnect()
{
if (isSet($_SESSION["AJXP_USER"]) || isSet(self::$currentUser)) {
$user = isSet($_SESSION["AJXP_USER"]) ? $_SESSION["AJXP_USER"] : self::$currentUser;
$userId = $user->id;
AJXP_Controller::applyHook("user.before_disconnect", array($user));
AuthService::clearRememberCookie();
AJXP_Logger::info(__CLASS__, "Log Out", "");
unset($_SESSION["AJXP_USER"]);
if(isSet(self::$currentUser)) unset(self::$currentUser);
if (ConfService::getCoreConf("SESSION_SET_CREDENTIALS", "auth")) {
AJXP_Safe::clearCredentials();
}
AJXP_Controller::applyHook("user.after_disconnect", array($userId));
}
}
/**
Expand Down

0 comments on commit 910b6a9

Please sign in to comment.