Show password-required message only if $wgRequirePasswordforEmailChange = true
authorAlangi Derick <alangiderick@gmail.com>
Mon, 5 Oct 2015 15:54:21 +0000 (16:54 +0100)
committerGlaisher <glaisher.wiki@gmail.com>
Mon, 5 Oct 2015 17:26:01 +0000 (17:26 +0000)
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
languages/i18n/en.json
languages/i18n/qqq.json

index 65fa01f..361b7b1 100644 (file)
@@ -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 ) {
index 2005ee8..af99a9d 100644 (file)
        "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:",
index 3893577..dd5f201 100644 (file)
        "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}}",