From 5a41dcaa6e803dd982266d3ae5e07e7fd0253f84 Mon Sep 17 00:00:00 2001 From: mhutti1 Date: Fri, 11 Dec 2015 00:07:20 +0100 Subject: [PATCH] Fixed Special:PasswordReset message The message now varies depening on whether the user supplied an email or username. Bug: T118851 Change-Id: I6eb33e2409c391aa37ed8fe1196727c2e907719d --- includes/specials/SpecialPasswordReset.php | 14 +++++++++++++- languages/i18n/en.json | 3 ++- languages/i18n/qqq.json | 7 ++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/includes/specials/SpecialPasswordReset.php b/includes/specials/SpecialPasswordReset.php index 53e1d1b9bc..292b575396 100644 --- a/includes/specials/SpecialPasswordReset.php +++ b/includes/specials/SpecialPasswordReset.php @@ -42,6 +42,11 @@ class SpecialPasswordReset extends FormSpecialPage { */ private $result; + /** + * @var string $method Identifies which password reset field was specified by the user. + */ + private $method; + public function __construct() { parent::__construct( 'PasswordReset', 'editmyprivateinfo' ); } @@ -196,6 +201,8 @@ class SpecialPasswordReset extends FormSpecialPage { return array( $error ); } + $this->method = $method; + if ( count( $users ) == 0 ) { if ( $method == 'email' ) { // Don't reveal whether or not an email address is in use @@ -310,7 +317,12 @@ class SpecialPasswordReset extends FormSpecialPage { $this->getOutput()->addHTML( Html::rawElement( 'pre', array(), $this->email->escaped() ) ); } - $this->getOutput()->addWikiMsg( 'passwordreset-emailsent' ); + if ( $this->method === 'email' ) { + $this->getOutput()->addWikiMsg( 'passwordreset-emailsentemail' ); + } else { + $this->getOutput()->addWikiMsg( 'passwordreset-emailsentusername' ); + } + $this->getOutput()->returnToMain(); } diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 70a2b805b7..66533f27e4 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -554,7 +554,8 @@ "passwordreset-emailtext-ip": "Someone (probably you, from IP address $1) requested a reset of your\npassword for {{SITENAME}} ($4). The following user {{PLURAL:$3|account is|accounts are}}\nassociated with this email address:\n\n$2\n\n{{PLURAL:$3|This temporary password|These temporary passwords}} will expire in {{PLURAL:$5|one day|$5 days}}.\nYou should log in and choose a new password now. If someone else made this\nrequest, or if you have remembered your original password, and you no longer\nwish to change it, you may ignore this message and continue using your old\npassword.", "passwordreset-emailtext-user": "User $1 on {{SITENAME}} requested a reset of your password for {{SITENAME}}\n($4). The following user {{PLURAL:$3|account is|accounts are}} associated with this email address:\n\n$2\n\n{{PLURAL:$3|This temporary password|These temporary passwords}} will expire in {{PLURAL:$5|one day|$5 days}}.\nYou should log in and choose a new password now. If someone else made this\nrequest, or if you have remembered your original password, and you no longer\nwish to change it, you may ignore this message and continue using your old\npassword.", "passwordreset-emailelement": "Username:\n$1\n\nTemporary password:\n$2", - "passwordreset-emailsent": "If this is a registered email address for your account, then a password reset email will be sent.", + "passwordreset-emailsentemail": "If this is a registered email address for your account, then a password reset email will be sent.", + "passwordreset-emailsentusername": "If there is a corresponding registered email address, then a password reset email will be sent.", "passwordreset-emailsent-capture": "A password reset email has been sent, which is shown below.", "passwordreset-emailerror-capture": "A password reset email was generated, which is shown below, but sending it to the {{GENDER:$2|user}} failed: $1", "changeemail": "Change or remove email address", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index fc72a4b281..58b1b8ec24 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -729,9 +729,10 @@ "passwordreset-emailtext-ip": "Be consistent with {{msg-mw|Passwordreset-emailtext-user}}.\n\nParameters:\n* $1 - an IP address\n* $2 - message {{msg-mw|Passwordreset-emailelement}} repeated $3 times\n* $3 - the number of repetitions in $2\n* $4 - base URL of the wiki\n* $5 - number of days", "passwordreset-emailtext-user": "Be consistent with {{msg-mw|Passwordreset-emailtext-ip}}.\n\nParameters:\n* $1 - a user name, no GENDER suport.\n* $2 - message {{msg-mw|Passwordreset-emailelement|notext=1}} repeated $3 times\n* $3 - the number of repetitions in $2\n* $4 - base URL of the wiki\n* $5 - number of days", "passwordreset-emailelement": "This is a body of a password reset email to allow them into the system with a new password. Parameters:\n* $1 - the user's login name. This parameter can be used for GENDER.\n* $2 - the temporary password given by the system", - "passwordreset-emailsent": "Used in [[Special:PasswordReset]].\n\nSee also:\n* {{msg-mw|Passwordreset-emailsent-capture}}\n* {{msg-mw|Passwordreset-emailerror-capture}}", - "passwordreset-emailsent-capture": "Used in [[Special:PasswordReset]].\n\nSee also:\n* {{msg-mw|Passwordreset-emailsent}}\n* {{msg-mw|Passwordreset-emailerror-capture}}", - "passwordreset-emailerror-capture": "Error message displayed in [[Special:PasswordReset]] when sending an email fails. Parameters:\n* $1 - error message\n* $2 - username, used for GENDER\nSee also:\n* {{msg-mw|Passwordreset-emailsent}}\n* {{msg-mw|Passwordreset-emailsent-capture}}", + "passwordreset-emailsentemail": "Used in [[Special:PasswordReset]].\n\nSee also:\n* {{msg-mw|Passwordreset-emailsent-capture}}\n* {{msg-mw|Passwordreset-emailerror-capture}}", + "passwordreset-emailsentusername": "Used in [[Special:PasswordReset]].\n\nSee also:\n* {{msg-mw|Passwordreset-emailsent-capture}}\n* {{msg-mw|Passwordreset-emailerror-capture}}", + "passwordreset-emailsent-capture": "Used in [[Special:PasswordReset]].\n\nSee also:\n* {{msg-mw|Passwordreset-emailsentemail}}\n* {msg-mw|Passwordreset-emailsentusername}}\n* {{msg-mw|Passwordreset-emailerror-capture}}", + "passwordreset-emailerror-capture": "Error message displayed in [[Special:PasswordReset]] when sending an email fails. Parameters:\n* $1 - error message\n* $2 - username, used for GENDER\nSee also:\n* {{msg-mw|Passwordreset-emailsentemail}}\n* {msg-mw|Passwordreset-emailsentusername}}\n* {{msg-mw|Passwordreset-emailsent-capture}}", "changeemail": "Title of [[Special:ChangeEmail|special page]]. This page also allows removing the user's email address.", "changeemail-summary": "{{ignored}}", "changeemail-header": "Text of [[Special:ChangeEmail]].", -- 2.20.1