mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 08:19:05 +01:00
Add LSauth :: afterLogout() trigger
This commit is contained in:
parent
d3f719a4e5
commit
bf8eb1b8b9
3 changed files with 40 additions and 4 deletions
|
@ -104,7 +104,23 @@ class LSauth {
|
|||
* @retval void
|
||||
**/
|
||||
public static function logout() {
|
||||
if (!is_null(self :: $provider)) {
|
||||
if (!is_null(self :: $provider)) {
|
||||
return self :: $provider -> logout();
|
||||
}
|
||||
LSerror :: addErrorCode('LSauth_06');
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* After logout
|
||||
*
|
||||
* This method is run by LSsession after the local session was
|
||||
* was successfully destroyed.
|
||||
*
|
||||
* @retval void
|
||||
**/
|
||||
public static function afterLogout() {
|
||||
if (!is_null(self :: $provider)) {
|
||||
return self :: $provider -> logout();
|
||||
}
|
||||
LSerror :: addErrorCode('LSauth_06');
|
||||
|
|
|
@ -94,6 +94,18 @@ class LSauthMethod {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* After logout
|
||||
*
|
||||
* This method is run by LSsession after the local session was
|
||||
* was successfully destroyed.
|
||||
*
|
||||
* @retval void
|
||||
**/
|
||||
public static function afterLogout() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get LDAP credentials
|
||||
*
|
||||
|
|
|
@ -533,15 +533,23 @@ class LSsession {
|
|||
}
|
||||
|
||||
if (isset($_GET['LSsession_logout'])) {
|
||||
// Trigger LSauth logout
|
||||
LSauth :: logout();
|
||||
session_destroy();
|
||||
|
||||
|
||||
// Delete temporaries files
|
||||
if (is_array($_SESSION['LSsession']['tmp_file'])) {
|
||||
self :: $tmp_file = $_SESSION['LSsession']['tmp_file'];
|
||||
}
|
||||
self :: deleteTmpFile();
|
||||
|
||||
// Destroy local session
|
||||
unset($_SESSION['LSsession']);
|
||||
|
||||
session_destroy();
|
||||
|
||||
// Trigger LSauth after logout
|
||||
LSauth :: afterLogout();
|
||||
|
||||
// Redirect user on home page
|
||||
self :: redirect('index.php');
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue