r98147 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98146‎ | r98147 | r98148 >
Date:17:40, 26 September 2011
Author:aaron
Status:resolved (Comments)
Tags:lamecommitsummary 
Comment:
FU r98058
* Updated permission checks in attemptAddUser() so this right actually works
* Added i18n message for right
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuth.i18n.php (modified) (history)
  • /trunk/extensions/CentralAuth/CentralAuthHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/CentralAuthHooks.php
@@ -435,14 +435,18 @@
436436 // The user can log in via Special:UserLogin to bypass the blacklist and get a proper
437437 // error message.
438438 $session = CentralAuthUser::getSession();
439 - if ( isset( $session['auto-create-blacklist'] ) && in_array( wfWikiID(), (array)$session['auto-create-blacklist'] ) ) {
 439+ if ( isset( $session['auto-create-blacklist'] )
 440+ && in_array( wfWikiID(), (array)$session['auto-create-blacklist'] ) )
 441+ {
440442 wfDebug( __METHOD__ . ": blacklisted by session\n" );
441443 return false;
442444 }
443445
444446 // Is the user blocked?
445447 $anon = new User;
446 - if ( !$anon->isAllowedToCreateAccount() ) {
 448+ if ( !$anon->isAllowedAny( 'createaccount', 'centralauth-autoaccount' )
 449+ || $this->isBlockedFromCreateAccount() )
 450+ {
447451 // Blacklist the user to avoid repeated DB queries subsequently
448452 // First load the session again in case it changed while the above DB query was in progress
449453 wfDebug( __METHOD__ . ": user is blocked from this wiki, blacklisting\n" );
Index: trunk/extensions/CentralAuth/CentralAuth.i18n.php
@@ -361,12 +361,13 @@
362362 'centralauth-editset-return' => 'Return to main view',
363363
364364 // User rights
365 - 'right-globalgroupmembership' => 'Edit membership to global groups',
366 - 'right-centralauth-unmerge' => 'Unmerge global account',
367 - 'right-centralauth-lock' => 'Lock or hide global account',
368 - 'right-centralauth-oversight' => 'Suppress global account',
369 - 'right-centralauth-merge' => 'Merge their account',
370 - 'right-globalgrouppermissions' => 'Manage global groups',
 365+ 'right-globalgroupmembership' => 'Edit membership to global groups',
 366+ 'right-centralauth-autoaccount' => 'Automatically login with global account',
 367+ 'right-centralauth-unmerge' => 'Unmerge global account',
 368+ 'right-centralauth-lock' => 'Lock or hide global account',
 369+ 'right-centralauth-oversight' => 'Suppress global account',
 370+ 'right-centralauth-merge' => 'Merge their account',
 371+ 'right-globalgrouppermissions' => 'Manage global groups',
371372 );
372373
373374 /** Message documentation (Message documentation)
@@ -517,6 +518,7 @@
518519 'centralauth-editset-grouplink' => '{{optional}}',
519520 'centralauth-editset-nouse' => '{{Identical|None}}',
520521 'right-globalgroupmembership' => '{{doc-right}}',
 522+ 'right-centralauth-autoaccount' => '{{doc-right|centralauth-autoaccount}}',
521523 'right-centralauth-unmerge' => '{{doc-right|centralauth-unmerge}}',
522524 'right-centralauth-lock' => '{{doc-right|centralauth-lock}}',
523525 'right-centralauth-oversight' => '{{doc-right|centralauth-oversight}}',

Follow-up revisions

RevisionCommit summaryAuthorDate
r98922Follwoup r98147...reedy21:06, 4 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r98058(bug 25732) Added new 'centralauth-autoaccount' to let anons get local accoun...aaron06:37, 25 September 2011

Comments

#Comment by Reedy (talk | contribs)   21:07, 4 October 2011
			|| $this->isBlockedFromCreateAccount() )
#Comment by Reedy (talk | contribs)   21:07, 4 October 2011

Blah. I was going to leave a fixme comment, but just fixed it in the followup

Status & tagging log