From dd0c90ec3f2ce7d265fd8c86038515175faed66c Mon Sep 17 00:00:00 2001 From: Timotheus Pokorra Date: Thu, 6 Oct 2022 06:47:29 +0200 Subject: [PATCH] setPassword is gone from MediaWiki 1.35 and needs to be replaced with changeAuthenticationData related to #12 --- CASAuth.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CASAuth.php b/CASAuth.php index a2dec3a..0ab8170 100644 --- a/CASAuth.php +++ b/CASAuth.php @@ -148,10 +148,13 @@ function casLogin($user) { // PwdSecret is used to salt the username, which is // then used to create an md5 hash which becomes the // password - $u->setPassword( - md5($username.$CASAuth["PwdSecret"]) - ); - + $hashed_secret = md5($username.$CASAuth["PwdSecret"]); + $u->changeAuthenticationData( [ + 'username' => $u->getName(), + 'password' => $hashed_secret, + 'retype' => $hashed_secret, + ] ); + $u->setToken(); $u->saveSettings();