mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-03 15:14:08 +01:00
* [MOD] Modified logout behavior to prevent login for two times. Related #189
This commit is contained in:
@@ -483,9 +483,7 @@ class Init
|
||||
{
|
||||
self::wrLogoutInfo();
|
||||
|
||||
//session_unset();
|
||||
session_destroy();
|
||||
session_start();
|
||||
SessionUtil::cleanSession();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -275,15 +275,15 @@ class Session
|
||||
/**
|
||||
* Establece el objeto de perfil de usuario en la sesión.
|
||||
*
|
||||
* @param \SP\Profile $profile
|
||||
* @param Profile $profile
|
||||
*/
|
||||
public static function setUserProfile(\SP\Profile $profile)
|
||||
public static function setUserProfile(Profile $profile)
|
||||
{
|
||||
self::setSessionKey('usrprofile', $profile);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \SP\AccountSearch
|
||||
* @return AccountSearch
|
||||
*/
|
||||
public static function getSearchFilters()
|
||||
{
|
||||
@@ -291,9 +291,9 @@ class Session
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \SP\AccountSearch $searchFilters
|
||||
* @param AccountSearch $searchFilters
|
||||
*/
|
||||
public static function setSearchFilters(\SP\AccountSearch $searchFilters)
|
||||
public static function setSearchFilters(AccountSearch $searchFilters)
|
||||
{
|
||||
self::setSessionKey('searchFilters', $searchFilters);
|
||||
}
|
||||
@@ -631,9 +631,9 @@ class Session
|
||||
/**
|
||||
* Establece el objeto de preferencias de usuario en la sesión.
|
||||
*
|
||||
* @param \SP\UserPreferences $preferences
|
||||
* @param UserPreferences $preferences
|
||||
*/
|
||||
public static function setUserPreferences(\SP\UserPreferences $preferences)
|
||||
public static function setUserPreferences(UserPreferences $preferences)
|
||||
{
|
||||
self::setSessionKey('usrpreferences', $preferences);
|
||||
}
|
||||
@@ -677,4 +677,12 @@ class Session
|
||||
{
|
||||
self::setSessionKey('accountcolor', $color);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $key
|
||||
*/
|
||||
public static function unsetSessionKey($key)
|
||||
{
|
||||
unset($_SESSION[$key]);
|
||||
}
|
||||
}
|
||||
@@ -119,4 +119,39 @@ class SessionUtil
|
||||
{
|
||||
return (!is_null(Session::getSecurityKey()) && Session::getSecurityKey() == $key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Limpiar la sesión del usuario
|
||||
*/
|
||||
public static function cleanSession()
|
||||
{
|
||||
Session::unsetSessionKey('uid');
|
||||
Session::unsetSessionKey('uisadminapp');
|
||||
Session::unsetSessionKey('uisadminacc');
|
||||
Session::unsetSessionKey('uprofile');
|
||||
Session::unsetSessionKey('ulogin');
|
||||
Session::unsetSessionKey('uname');
|
||||
Session::unsetSessionKey('ugroup');
|
||||
Session::unsetSessionKey('ugroupn');
|
||||
Session::unsetSessionKey('uemail');
|
||||
Session::unsetSessionKey('uisldap');
|
||||
Session::unsetSessionKey('usrprofile');
|
||||
Session::unsetSessionKey('searchFilters');
|
||||
Session::unsetSessionKey('accParentId');
|
||||
Session::unsetSessionKey('updated');
|
||||
Session::unsetSessionKey('sessionTimeout');
|
||||
Session::unsetSessionKey('mPass');
|
||||
Session::unsetSessionKey('mPassPwd');
|
||||
Session::unsetSessionKey('mPassIV');
|
||||
Session::unsetSessionKey('sidStartTime');
|
||||
Session::unsetSessionKey('startActivity');
|
||||
Session::unsetSessionKey('lastActivity');
|
||||
Session::unsetSessionKey('lastAccountId');
|
||||
Session::unsetSessionKey('theme');
|
||||
Session::unsetSessionKey('2fapass');
|
||||
Session::unsetSessionKey('locale');
|
||||
Session::unsetSessionKey('userpreferences');
|
||||
Session::unsetSessionKey('tempmasterpass');
|
||||
Session::unsetSessionKey('accountcolor');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user