r98559 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98558‎ | r98559 | r98560 >
Date:20:43, 30 September 2011
Author:aaron
Status:resolved (Comments)
Tags:
Comment:
(bug 31283) Made ChangeEmail check $wgAuth->allowPropChange( 'emailaddress' ). Fix for r92924. Mark beat me to committing the rest of the fix in r98558, which just hid the link to the special page.
Modified paths:
  • /trunk/phase3/includes/Preferences.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialChangeEmail.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialChangeEmail.php
@@ -31,10 +31,16 @@
3232 parent::__construct( 'ChangeEmail' );
3333 }
3434
 35+ function isListed() {
 36+ global $wgAuth;
 37+ return $wgAuth->allowPropChange( 'emailaddress' );
 38+ }
 39+
3540 /**
3641 * Main execution point
3742 */
3843 function execute( $par ) {
 44+ global $wgAuth;
3945 if ( wfReadOnly() ) {
4046 throw new ReadOnlyError;
4147 }
@@ -51,6 +57,11 @@
5258
5359 $user = $this->getUser();
5460
 61+ if ( !$wgAuth->allowPropChange( 'emailaddress' ) ) {
 62+ $this->error( wfMsgExt( 'cannotchangeemail', 'parseinline' ) );
 63+ return;
 64+ }
 65+
5566 if ( !$request->wasPosted() && !$user->isLoggedIn() ) {
5667 $this->error( wfMsg( 'changeemail-no-info' ) );
5768 return;
Index: trunk/phase3/includes/Preferences.php
@@ -1424,6 +1424,7 @@
14251425 /*
14261426 * Try to set a user's email address.
14271427 * This does *not* try to validate the address.
 1428+ * Caller is responsible for checking $wgAuth.
14281429 * @param $user User
14291430 * @param $newaddr string New email address
14301431 * @return Array (true on success or Status on failure, info string)
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1126,6 +1126,7 @@
11271127 'emailconfirmlink' => 'Confirm your e-mail address',
11281128 'invalidemailaddress' => 'The e-mail address cannot be accepted as it appears to have an invalid format.
11291129 Please enter a well-formatted address or empty that field.',
 1130+'cannotchangeemail' => 'Account e-mail addresses cannot be changed on this wiki.',
11301131 'accountcreated' => 'Account created',
11311132 'accountcreatedtext' => 'The user account for $1 has been created.',
11321133 'createaccount-title' => 'Account creation for {{SITENAME}}',

Follow-up revisions

RevisionCommit summaryAuthorDate
r98570FU r98559: added 'cannotchangeemail' msgaaron21:40, 30 September 2011
r98647FU r98559: added cannotchangeemailaaron23:39, 1 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92924* Moved email changing from sp:Preferences to new sp:ChangeEmail, which requi...aaron00:48, 23 July 2011
r98558re r92924 andFix Bug #31283 - "Change E-mail" option in Preference should be ...mah20:36, 30 September 2011

Comments

#Comment by Siebrand (talk | contribs)   20:58, 30 September 2011

Needs messages.inc entry. Please add message documentation for the newly added messages. Thanks.

#Comment by Aaron Schulz (talk | contribs)   21:38, 30 September 2011

I was about to add that, got distracted with fixing a broken SQL query.

#Comment by Siebrand (talk | contribs)   22:37, 30 September 2011

Please add message documentation for the newly added messages. Thanks.

#Comment by Aaron Schulz (talk | contribs)   22:52, 30 September 2011

Did you see r98570 or is this for something else?

#Comment by Siebrand (talk | contribs)   00:52, 1 October 2011

I do not see MessagesQqq.php changed in r98570. So YES, it is about something else. Did you actually READ i18n#Message_documentation, because I'm fairly certain you may not have done that.

#Comment by Aaron Schulz (talk | contribs)   00:53, 1 October 2011

You said "Needs messages.inc entry.". It would have been clearer to just give the link by itself.

#Comment by Siebrand (talk | contribs)   04:25, 1 October 2011

What's the problem here? Just add the message documentation (!).

Status & tagging log