/**
  * Clear the session
  * @static
  * @return void
  */
 static function disconnect()
 {
     if (isset($_SESSION["AJXP_USER"])) {
         AuthService::clearRememberCookie();
         AJXP_Logger::logAction("Log Out");
         unset($_SESSION["AJXP_USER"]);
         if (ConfService::getCoreConf("SESSION_SET_CREDENTIALS", "auth")) {
             AJXP_Safe::clearCredentials();
         }
     }
 }
예제 #2
0
 /**
  * Clear the session
  * @static
  * @return void
  */
 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));
     }
 }