'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'
);
}
}
protected function getDisplayFormat() {
- return 'vform';
+ return 'ooui';
}
protected function alterForm( HTMLForm $form ) {
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();
}
return Status::newFatal( 'invalidemailaddress' );
}
+ if ( $newaddr === $user->getEmail() ) {
+ return Status::newFatal( 'changeemail-nochange' );
+ }
+
$throttleCount = LoginForm::incLoginThrottle( $user->getName() );
if ( $throttleCount === true ) {
$lang = $this->getLanguage();