From 0e2d0b1889b94214548ad48fe04d144050747233 Mon Sep 17 00:00:00 2001 From: Timotheus Pokorra Date: Sat, 10 Apr 2021 22:08:07 +0200 Subject: [PATCH 1/2] fix for Mediawiki 1.35 --- CASAuth.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CASAuth.php b/CASAuth.php index a2dec3a..61d54ff 100644 --- a/CASAuth.php +++ b/CASAuth.php @@ -172,8 +172,7 @@ function casLogin($user) { if ($returnto) { $target = Title::newFromText($returnto); if ($target) { - //action=purge is used to purge the cache - $wgOut->redirect($target->getFullUrl('action=purge')); + $wgOut->redirect($target->getFullUrl()); } } } @@ -226,8 +225,9 @@ function casPrefs($user, &$preferences) { function casPostAuth($ticket2logout) { // remember the current session name and id - $old_session_name=session_name(); - $old_session_id=session_id(); + $session = MediaWiki\Session\SessionManager::getGlobalSession(); + $old_session_name=$session->getName(); + $old_session_id=$session->getId(); // close the current session for now session_write_close(); @@ -297,7 +297,8 @@ function casSetup() { global $casIsSetUp; // Make the session persistent so that phpCAS doesn't change the session id - wfSetupSession(); + $session = MediaWiki\Session\SessionManager::getGlobalSession(); + $session->persist(); require_once($CASAuth["phpCAS"]."/CAS.php"); phpCAS::client($CASAuth["Version"], $CASAuth["Server"], $CASAuth["Port"], $CASAuth["Url"], false); From cabb55682e9a900404f6f2f065a53b188e56ef4a Mon Sep 17 00:00:00 2001 From: Timotheus Pokorra Date: Sat, 10 Apr 2021 22:36:54 +0200 Subject: [PATCH 2/2] another fix for signing out related to #13 --- CASAuth.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CASAuth.php b/CASAuth.php index 61d54ff..4a7777f 100644 --- a/CASAuth.php +++ b/CASAuth.php @@ -226,7 +226,9 @@ function casPostAuth($ticket2logout) { // remember the current session name and id $session = MediaWiki\Session\SessionManager::getGlobalSession(); - $old_session_name=$session->getName(); + $session->clear(); + return; + // $old_session_name=$session->getName(); $old_session_id=$session->getId(); // close the current session for now