Skip to content
Snippets Groups Projects
Commit b40dc3d7 authored by Balazs Varga's avatar Balazs Varga
Browse files

bugfix: force logout if there is only MW session user: prevent incostintent...

bugfix: force logout if there is only MW session user: prevent incostintent state when there's no Shib session
parent 6fa55c76
No related branches found
No related tags found
No related merge requests found
...@@ -259,7 +259,7 @@ function SetupShibAuth() ...@@ -259,7 +259,7 @@ function SetupShibAuth()
{ {
global $shib_UN; global $shib_UN;
global $wgHooks; global $wgHooks;
global $wgAuth; global $wgAuth, $wgUser;
global $wgCookieExpiration; global $wgCookieExpiration;
if($shib_UN != null){ if($shib_UN != null){
...@@ -268,6 +268,12 @@ function SetupShibAuth() ...@@ -268,6 +268,12 @@ function SetupShibAuth()
$wgHooks['PersonalUrls'][] = 'ShibActive'; /* Disallow logout link */ $wgHooks['PersonalUrls'][] = 'ShibActive'; /* Disallow logout link */
$wgAuth = new ShibAuthPlugin(); $wgAuth = new ShibAuthPlugin();
} else { } else {
//force logout if there is only MW session user
//prevent incostintent state when there's no Shib session
if ($wgUser != null && $wgUser->isLoggedIn()) {
$wgUser->doLogout();
}
$wgHooks['PersonalUrls'][] = 'ShibLinkAdd'; $wgHooks['PersonalUrls'][] = 'ShibLinkAdd';
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment