X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fspecials%2FSpecialChangeEmail.php;h=9ce87605fae4ce04a2c0456c84708a09c21993fe;hp=4f97ba21762f62ff5ee3f40a02d4a42e24e1f57b;hb=214b37ff07f3fde89430297b2a857750a56ae205;hpb=de5c5cd356e081023690eddca1ded3ffe85e2cbe diff --git a/includes/specials/SpecialChangeEmail.php b/includes/specials/SpecialChangeEmail.php index 4f97ba2176..9ce87605fa 100644 --- a/includes/specials/SpecialChangeEmail.php +++ b/includes/specials/SpecialChangeEmail.php @@ -22,6 +22,7 @@ */ use MediaWiki\Auth\AuthManager; +use MediaWiki\Logger\LoggerFactory; /** * Let users change their email address. @@ -54,14 +55,16 @@ class SpecialChangeEmail extends FormSpecialPage { * @param string $par */ function execute( $par ) { - $this->checkLoginSecurityLevel(); - $out = $this->getOutput(); $out->disallowUserJs(); parent::execute( $par ); } + protected function getLoginSecurityLevel() { + return $this->getName(); + } + protected function checkExecutePermissions( User $user ) { if ( !AuthManager::singleton()->allowsPropertyChange( 'emailaddress' ) ) { throw new ErrorPageError( 'changeemail', 'cannotchangeemail' ); @@ -165,10 +168,17 @@ class SpecialChangeEmail extends FormSpecialPage { return $status; } + LoggerFactory::getInstance( 'authentication' )->info( + 'Changing email address for {user} from {oldemail} to {newemail}', [ + 'user' => $user->getName(), + 'oldemail' => $oldaddr, + 'newemail' => $newaddr, + ] + ); + Hooks::run( 'PrefsEmailAudit', [ $user, $oldaddr, $newaddr ] ); $user->saveSettings(); - MediaWiki\Auth\AuthManager::callLegacyAuthPlugin( 'updateExternalDB', [ $user ] ); return $status; }