r85385 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85384‎ | r85385 | r85386 >
Date:21:55, 4 April 2011
Author:brion
Status:ok (Comments)
Tags:
Comment:
* (bug 23126) CentralAuth: restore original behavior where 'locked' global accounts cannot be used to log in or merge, *unless* $wgCentralAuthLockedCanEdit is non-empty, in which case we allow them through so their edits can be filtered by that whitelist.

This avoids polluting logs and user namespaces with merges unless the feature for allowing locked accounts to edit certain request pages has been explicitly enabled. (It does not appear to be enabled on any Wikimedia sites at the moment, but if it were it would probably be on Meta.)
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuthUser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/CentralAuthUser.php
@@ -1221,6 +1221,15 @@
12221222 return "no user";
12231223 }
12241224
 1225+ // If the global account has been locked, we don't want to spam
 1226+ // other wikis with local account creations. But, if we have explicitly
 1227+ // given a list of pages that locked accounts should be able to edit,
 1228+ // we'll allow it.
 1229+ global $wgCentralAuthLockedCanEdit;
 1230+ if (empty($wgCentralAuthLockedCanEdit) && $this->isLocked()) {
 1231+ return "locked";
 1232+ }
 1233+
12251234 // Don't allow users to autocreate if they are oversighted.
12261235 // If they do, their name will appear on local user list
12271236 // (and since it contains private info, its inacceptable).

Follow-up revisions

RevisionCommit summaryAuthorDate
r85394$r85385->ocd++;reedy23:10, 4 April 2011

Comments

#Comment by Reedy (talk | contribs)   21:57, 4 April 2011

empty? :P

Also, should have more spaces on your if statement ;)

#Comment by Brion VIBBER (talk | contribs)   22:05, 4 April 2011

Oh poop, I still haven't retrained my muscle memory for our space style. ;) The empty() should be fine for arrays, but if it makes you feel better change it to check the count() or something. I'll re-add it to my internal blacklist :D

Status & tagging log