* Truncate summary of page moves in revision comment field to avoid broken
multibyte characters
* (bug 22540) ForeignApiRepos no longer try to store thumbnails that don't exist
+* (bug 22551) Special:Resetpass now has a "Cancel" button that sends the user to
+ the page set in the &returnto parameter.
== API changes in 1.16 ==
return;
}
+ if( $wgRequest->wasPosted() && $wgRequest->getBool( 'wpCancel' ) ) {
+ $this->doReturnTo();
+ return;
+ }
+
if( $wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal('token') ) ) {
try {
$this->attemptReset( $this->mNewpass, $this->mRetype );
$login = new LoginForm( new FauxRequest( $data, true ) );
$login->execute();
}
- $titleObj = Title::newFromText( $wgRequest->getVal( 'returnto' ) );
- if ( !$titleObj instanceof Title ) {
- $titleObj = Title::newMainPage();
- }
- $wgOut->redirect( $titleObj->getFullURL() );
+ $this->doReturnTo();
} catch( PasswordError $e ) {
$this->error( $e->getMessage() );
}
}
$this->showForm();
}
+
+ function doReturnTo() {
+ global $wgRequest, $wgOut;
+ $titleObj = Title::newFromText( $wgRequest->getVal( 'returnto' ) );
+ if ( !$titleObj instanceof Title ) {
+ $titleObj = Title::newMainPage();
+ }
+ $wgOut->redirect( $titleObj->getFullURL() );
+ }
function error( $msg ) {
global $wgOut;
"<td></td>\n" .
'<td class="mw-input">' .
Xml::submitButton( wfMsg( $submitMsg ) ) .
+ Xml::submitButton( wfMsg( 'resetpass-submit-cancel' ), array( 'name' => 'wpCancel' ) ) .
"</td>\n" .
"</tr>\n" .
Xml::closeElement( 'table' ) .
'resetpass_forbidden' => 'Passwords cannot be changed',
'resetpass-no-info' => 'You must be logged in to access this page directly.',
'resetpass-submit-loggedin' => 'Change password',
+'resetpass-submit-cancel' => 'Cancel',
'resetpass-wrong-oldpass' => 'Invalid temporary or current password.
You may have already successfully changed your password or requested a new temporary password.',
'resetpass-temp-password' => 'Temporary password:',