From bb9d42e9462e23b2abb5ed2d90797509706a7b28 Mon Sep 17 00:00:00 2001 From: Ritchie Swann Date: Fri, 5 Apr 2024 15:52:20 +0100 Subject: [PATCH 1/2] Disable UserPrefsForced UserPrefsForced causes a fatal MediaWiki exception when using a remote authentication service. https://www.mediawiki.org/wiki/Topic:Wwr8akzzrchl1mq7 --- PhpbbAuth.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PhpbbAuth.php b/PhpbbAuth.php index ae9de4f..6ce5ee8 100644 --- a/PhpbbAuth.php +++ b/PhpbbAuth.php @@ -46,6 +46,10 @@ } } +$user->data['user_id'] = 3035; +$user->data['username'] = 'Pixeldubs'; +$user->data['user_email'] = 'nobody@example.com'; + if ( $user->data['user_id'] != ANONYMOUS && !$user->data['is_bot'] ) { if($wgPhpbbAuthNameFormat == 'phpbb'){ @@ -56,9 +60,7 @@ $wgAuthRemoteuserUserPrefs = [ 'realname' => $user->data['username'], 'language' => 'en', - 'disablemail' => 0 - ]; - $wgAuthRemoteuserUserPrefsForced = [ + 'disablemail' => 0, 'email' => $user->data['user_email'] ]; $wgDefaultUserOptions['disablemail'] = 0; From 18fc73e83b3e0b22393413ea372c4f41d46eebf5 Mon Sep 17 00:00:00 2001 From: Ritchie Swann Date: Fri, 5 Apr 2024 15:53:31 +0100 Subject: [PATCH 2/2] rm test data --- PhpbbAuth.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/PhpbbAuth.php b/PhpbbAuth.php index 6ce5ee8..5e12638 100644 --- a/PhpbbAuth.php +++ b/PhpbbAuth.php @@ -46,10 +46,6 @@ } } -$user->data['user_id'] = 3035; -$user->data['username'] = 'Pixeldubs'; -$user->data['user_email'] = 'nobody@example.com'; - if ( $user->data['user_id'] != ANONYMOUS && !$user->data['is_bot'] ) { if($wgPhpbbAuthNameFormat == 'phpbb'){