X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialChangeEmail.php;h=53faba7a7a8367f6edb3703890e11d33eece228c;hb=578fc56c293066bdca806c72b9fe040c8503dbd1;hp=fc7261060219ec6314797064fbb1bf4413e7d03a;hpb=39f9b1ee65a631f193dbd9fa6f66418de65f95d2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialChangeEmail.php b/includes/specials/SpecialChangeEmail.php index fc72610602..53faba7a7a 100644 --- a/includes/specials/SpecialChangeEmail.php +++ b/includes/specials/SpecialChangeEmail.php @@ -151,10 +151,10 @@ class SpecialChangeEmail extends UnlistedSpecialPage { $items = array( array( 'wpName', 'username', 'text', $user->getName() ), array( 'wpOldEmail', 'changeemail-oldemail', 'text', $oldEmailText ), - array( 'wpNewEmail', 'changeemail-newemail', 'input', $this->mNewEmail ), + array( 'wpNewEmail', 'changeemail-newemail', 'email', $this->mNewEmail ), ); if ( $wgRequirePasswordforEmailChange ) { - $items[] = array( 'wpPassword', 'yourpassword', 'password', $this->mPassword ); + $items[] = array( 'wpPassword', 'changeemail-password', 'password', $this->mPassword ); } $this->getOutput()->addHTML( @@ -195,7 +195,7 @@ class SpecialChangeEmail extends UnlistedSpecialPage { if ( $type != 'text' ) { $out .= Xml::label( $this->msg( $label )->text(), $name ); } else { - $out .= $this->msg( $label )->escaped(); + $out .= $this->msg( $label )->escaped(); } $out .= "\n"; $out .= "\t"; @@ -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; } }