aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-09-02 12:46:06 +0000
committerJan-Hendrik Willms <tleilax+github@gmail.com>2024-09-02 15:02:36 +0200
commitd11396f3db18726943a12ae32616645ee5915138 (patch)
treee9fee2f56e62ace8e355b8dea63ace6c03462ae1 /public
parentdb7a174832a0963bb02f02a4a318d4362cfb299f (diff)
provide generic logout for sso auth plugins, fixes #3624
Closes #3624 Merge request studip/studip!3345
Diffstat (limited to 'public')
-rw-r--r--public/logout.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/public/logout.php b/public/logout.php
index 2f8fcd8..c2722a2 100644
--- a/public/logout.php
+++ b/public/logout.php
@@ -42,12 +42,10 @@ if ($auth->auth['uid'] !== 'nobody') {
$_language = $_SESSION['_language'];
$contrast = UserConfig::get($GLOBALS['user']->id)->USER_HIGH_CONTRAST;
- // TODO this needs to be generalized or removed
- //erweiterung cas
- if ($auth->auth['auth_plugin'] === 'cas') {
- $casauth = StudipAuthAbstract::GetInstance('cas');
- $docaslogout = true;
- }
+ // Get auth plugin of user before logging out since the $auth object will
+ // be modified by the logout
+ $auth_plugin = StudipAuthAbstract::getInstance($auth->auth['auth_plugin']);
+
//Logout aus dem Sessionmanagement
$auth->logout();
$sess->delete();
@@ -58,10 +56,11 @@ if ($auth->auth['uid'] !== 'nobody') {
$timeout=(time()-(15 * 60));
$user->set_last_action($timeout);
- //der logout() Aufruf fuer CAS (dadurch wird das Cookie (Ticket) im Browser zerstoert)
- if (!empty($docaslogout)) {
- $casauth->logout();
+ // Perform logout from auth plugin (if possible)
+ if ($auth_plugin instanceof StudipAuthSSO) {
+ $auth_plugin->logout();
}
+
$sess->start();
$_SESSION['_language'] = $_language;
if ($contrast) {