X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fspecials%2FSpecialChangeEmail.php;h=22df04e82887e7be23fd0c905c928ac4ca5b5997;hp=eca307d9a1bf94c115ddecf7618a486a5be1c849;hb=5970f6c1d9f1cbbe65eb13dcca0ce7088476e6e3;hpb=53a43bb6516ceeecf7b6712169e6b2f8c4ce0fb9 diff --git a/includes/specials/SpecialChangeEmail.php b/includes/specials/SpecialChangeEmail.php index eca307d9a1..22df04e828 100644 --- a/includes/specials/SpecialChangeEmail.php +++ b/includes/specials/SpecialChangeEmail.php @@ -92,14 +92,14 @@ class SpecialChangeEmail extends FormSpecialPage { 'NewEmail' => array( 'type' => 'email', 'label-message' => 'changeemail-newemail', + 'autofocus' => true ), ); if ( $this->getConfig()->get( 'RequirePasswordforEmailChange' ) ) { $fields['Password'] = array( 'type' => 'password', - 'label-message' => 'changeemail-password', - 'autofocus' => true, + 'label-message' => 'changeemail-password' ); } @@ -107,7 +107,7 @@ class SpecialChangeEmail extends FormSpecialPage { } protected function getDisplayFormat() { - return 'vform'; + return 'ooui'; } protected function alterForm( HTMLForm $form ) { @@ -129,7 +129,8 @@ class SpecialChangeEmail extends FormSpecialPage { public function onSuccess() { $request = $this->getRequest(); - $titleObj = Title::newFromText( $request->getVal( 'returnto' ) ); + $returnto = $request->getVal( 'returnto' ); + $titleObj = $returnto !== null ? Title::newFromText( $returnto ) : null; if ( !$titleObj instanceof Title ) { $titleObj = Title::newMainPage(); } @@ -159,6 +160,10 @@ class SpecialChangeEmail extends FormSpecialPage { return Status::newFatal( 'invalidemailaddress' ); } + if ( $newaddr === $user->getEmail() ) { + return Status::newFatal( 'changeemail-nochange' ); + } + $throttleCount = LoginForm::incLoginThrottle( $user->getName() ); if ( $throttleCount === true ) { $lang = $this->getLanguage();