From 3d41a0321c47be30070307334e2e4aea4d574bc6 Mon Sep 17 00:00:00 2001 From: Alangi Derick Date: Mon, 5 Oct 2015 16:54:21 +0100 Subject: [PATCH] Show password-required message only if $wgRequirePasswordforEmailChange = true Special:ChangeEmail now only shows password-required message only if $wgRequirePasswordforEmailChange is set to true. "changeemail-text" message previously used has been replaced with two other messages: "changeemail-header and "changeemail-passwordrequired". Bug: T113974 Change-Id: Ice09a73a1ab9b440cbd1feafef0aefcf67aec994 --- includes/specials/SpecialChangeEmail.php | 5 +++++ languages/i18n/en.json | 3 ++- languages/i18n/qqq.json | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialChangeEmail.php b/includes/specials/SpecialChangeEmail.php index 65fa01fe2c..361b7b1b64 100644 --- a/includes/specials/SpecialChangeEmail.php +++ b/includes/specials/SpecialChangeEmail.php @@ -116,6 +116,11 @@ class SpecialChangeEmail extends FormSpecialPage { $form->setTableId( 'mw-changeemail-table' ); $form->setSubmitTextMsg( 'changeemail-submit' ); $form->addHiddenFields( $this->getRequest()->getValues( 'returnto', 'returntoquery' ) ); + + $form->addHeaderText( $this->msg( 'changeemail-header' )->parseAsBlock() ); + if ( $this->getConfig()->get( 'RequirePasswordforEmailChange' ) ) { + $form->addHeaderText( $this->msg( 'changeemail-passwordrequired' )->parseAsBlock() ); + } } public function onSubmit( array $data ) { diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 2005ee81a2..af99a9dbdf 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -555,7 +555,8 @@ "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", "changeemail-summary": "", - "changeemail-text": "Complete this form to change your email address. You will need to enter your password to confirm this change. If you would like to remove the association of any email address from your account, leave the new email address blank when submitting the form.", + "changeemail-header": "Complete this form to change your email address. If you would like to remove the association of any email address from your account, leave the new email address blank when submitting the form.", + "changeemail-passwordrequired": "You will need to enter your password to confirm this change.", "changeemail-no-info": "You must be logged in to access this page directly.", "changeemail-oldemail": "Current email address:", "changeemail-newemail": "New email address:", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 3893577dc2..dd5f20187c 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -728,7 +728,8 @@ "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}}", "changeemail": "Title of [[Special:ChangeEmail|special page]]. This page also allows removing the user's email address.", "changeemail-summary": "{{ignored}}", - "changeemail-text": "Text of [[Special:ChangeEmail]].", + "changeemail-header": "Text of [[Special:ChangeEmail]].", + "changeemail-passwordrequired": "Shown on [[Special:ChangeEmail]] if users are required to enter their password to change their email address..", "changeemail-no-info": "Error message for [[Special:ChangeEmail]].\n\nParameters:\n* $1 (unused) - a link to [[Special:UserLogin]] with {{msg-mw|loginreqlink}} as link description", "changeemail-oldemail": "Label for e-mail address field in [[Special:ChangeEmail]].", "changeemail-newemail": "Label for e-mail address field in [[Special:ChangeEmail]]. See also {{msg-mw|changeemail-newemail-help}}", -- 2.20.1