From 6f0efeecfea05d12646a6ac7708c961224cdf4eb Mon Sep 17 00:00:00 2001 From: Ryan Lane Date: Tue, 20 Nov 2012 17:39:19 -0800 Subject: [PATCH] Add $wgAuth->updateExternalDB calls back into core Some time, long, long ago, in a MediaWiki much, much saner the preferences form told wgAuth to update the external database. That code disappeared at some point. This commit adds it back. Change-Id: I91df44c8a8b38119c33d4a69b8c7e3c180e5c773 --- includes/Preferences.php | 4 +++- includes/specials/SpecialChangeEmail.php | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/Preferences.php b/includes/Preferences.php index 65a0d0291b..a3c684b560 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -1373,7 +1373,7 @@ class Preferences { * @return bool|Status|string */ static function tryFormSubmit( $formData, $form, $entryPoint = 'internal' ) { - global $wgHiddenPrefs; + global $wgHiddenPrefs, $wgAuth; $user = $form->getModifiedUser(); $result = true; @@ -1422,6 +1422,8 @@ class Preferences { $user->saveSettings(); + $wgAuth->updateExternalDB( $user ); + return $result; } diff --git a/includes/specials/SpecialChangeEmail.php b/includes/specials/SpecialChangeEmail.php index 0996de34c4..99d2ebf852 100644 --- a/includes/specials/SpecialChangeEmail.php +++ b/includes/specials/SpecialChangeEmail.php @@ -213,6 +213,8 @@ class SpecialChangeEmail extends UnlistedSpecialPage { * @return bool|string true or string on success, false on failure */ protected function attemptChange( User $user, $pass, $newaddr ) { + global $wgAuth; + if ( $newaddr != '' && !Sanitizer::validateEmail( $newaddr ) ) { $this->error( 'invalidemailaddress' ); return false; @@ -248,6 +250,8 @@ class SpecialChangeEmail extends UnlistedSpecialPage { $user->saveSettings(); + $wgAuth->updateExternalDB( $user ); + return $status->value; } } -- 2.20.1