mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-18 14:33:49 +01:00
Add LSauth :: afterLogout() trigger
This commit is contained in:
parent
d3f719a4e5
commit
bf8eb1b8b9
3 changed files with 40 additions and 4 deletions
|
@ -111,6 +111,22 @@ class LSauth {
|
||||||
return;
|
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');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disable logout button in LSauth parameters
|
* Disable logout button in LSauth parameters
|
||||||
*
|
*
|
||||||
|
|
|
@ -94,6 +94,18 @@ class LSauthMethod {
|
||||||
return true;
|
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
|
* Get LDAP credentials
|
||||||
*
|
*
|
||||||
|
|
|
@ -533,15 +533,23 @@ class LSsession {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_GET['LSsession_logout'])) {
|
if (isset($_GET['LSsession_logout'])) {
|
||||||
|
// Trigger LSauth logout
|
||||||
LSauth :: logout();
|
LSauth :: logout();
|
||||||
session_destroy();
|
|
||||||
|
|
||||||
|
// Delete temporaries files
|
||||||
if (is_array($_SESSION['LSsession']['tmp_file'])) {
|
if (is_array($_SESSION['LSsession']['tmp_file'])) {
|
||||||
self :: $tmp_file = $_SESSION['LSsession']['tmp_file'];
|
self :: $tmp_file = $_SESSION['LSsession']['tmp_file'];
|
||||||
}
|
}
|
||||||
self :: deleteTmpFile();
|
self :: deleteTmpFile();
|
||||||
unset($_SESSION['LSsession']);
|
|
||||||
|
|
||||||
|
// Destroy local session
|
||||||
|
unset($_SESSION['LSsession']);
|
||||||
|
session_destroy();
|
||||||
|
|
||||||
|
// Trigger LSauth after logout
|
||||||
|
LSauth :: afterLogout();
|
||||||
|
|
||||||
|
// Redirect user on home page
|
||||||
self :: redirect('index.php');
|
self :: redirect('index.php');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue