jenkins-bot has submitted this change and it was merged.
Change subject: Show message when user successfully changed password.
......................................................................
Show message when user successfully changed password.
Return a message when password has been successfully changed.
Give a successbox to the message which is the same as it for
saving preference.
Bug: 47399
Change-Id: I255c53d82cf0a58ee9ff1c0c939854e7392872e5
---
M RELEASE-NOTES-1.22
M includes/specials/SpecialChangePassword.php
M languages/messages/MessagesEn.php
M maintenance/language/messages.inc
4 files changed, 14 insertions(+), 15 deletions(-)
Approvals:
IAlex: Looks good to me, approved
jenkins-bot: Verified
diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index e6836da..b1e88a4 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -189,6 +189,7 @@
* New hook ResetSessionID, called when the session id is reset.
* Add a mode parameter to <gallery> tag with potential options of
"traditional",
"nolines", "packed", "packed-overlay", or "packed-hover".
+* (bug 47399) A success message is now displayed after changing the password.
=== Bug fixes in 1.22 ===
* Disable Special:PasswordReset when $wgEnableEmail is false. Previously one
diff --git a/includes/specials/SpecialChangePassword.php
b/includes/specials/SpecialChangePassword.php
index d297a2f..139bb6d 100644
--- a/includes/specials/SpecialChangePassword.php
+++ b/includes/specials/SpecialChangePassword.php
@@ -59,7 +59,12 @@
}
if ( $request->wasPosted() && $request->getBool( 'wpCancel' ) )
{
- $this->doReturnTo();
+ $titleObj = Title::newFromText( $request->getVal(
'returnto' ) );
+ if ( !$titleObj instanceof Title ) {
+ $titleObj = Title::newMainPage();
+ }
+ $query = $request->getVal( 'returntoquery' );
+ $this->getOutput()->redirect( $titleObj->getFullURL(
$query ) );
return;
}
@@ -79,7 +84,11 @@
$this->attemptReset( $this->mNewpass,
$this->mRetype );
if ( $user->isLoggedIn() ) {
- $this->doReturnTo();
+ $this->getOutput()->wrapWikiMsg(
+ "<div
class=\"successbox\"><strong>\n$1\n</strong></div>",
+ 'changepassword-success'
+ );
+ $this->getOutput()->returnToMain();
} else {
LoginForm::setLoginToken();
$token = LoginForm::getLoginToken();
@@ -101,16 +110,6 @@
}
}
$this->showForm();
- }
-
- function doReturnTo() {
- $request = $this->getRequest();
- $titleObj = Title::newFromText( $request->getVal( 'returnto' )
);
- if ( !$titleObj instanceof Title ) {
- $titleObj = Title::newMainPage();
- }
- $query = $request->getVal( 'returntoquery' );
- $this->getOutput()->redirect( $titleObj->getFullURL( $query ) );
}
/**
diff --git a/languages/messages/MessagesEn.php
b/languages/messages/MessagesEn.php
index bfe6bd0..7bb3bd2 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -1277,8 +1277,7 @@
'newpassword' => 'New password:',
'retypenew' => 'Retype new password:',
'resetpass_submit' => 'Set password and log in',
-'resetpass_success' => 'Your password has been changed successfully!
-Now logging you in...',
+'changepassword-success' => 'Your password has been changed successfully!',
'resetpass_forbidden' => 'Passwords cannot be changed',
'resetpass-no-info' => 'You must be logged in to access this page
directly.',
'resetpass-submit-loggedin' => 'Change password',
diff --git a/maintenance/language/messages.inc
b/maintenance/language/messages.inc
index 5a42091..aa8d7cc 100644
--- a/maintenance/language/messages.inc
+++ b/maintenance/language/messages.inc
@@ -582,7 +582,7 @@
'newpassword',
'retypenew',
'resetpass_submit',
- 'resetpass_success',
+ 'changepassword-success',
'resetpass_forbidden',
'resetpass-no-info',
'resetpass-submit-loggedin',
--
To view, visit https://gerrit.wikimedia.org/r/61748
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I255c53d82cf0a58ee9ff1c0c939854e7392872e5
Gerrit-PatchSet: 12
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jiabao <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: Jiabao <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: devunt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits