r24701 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24700‎ | r24701 | r24702 >
Date:16:36, 9 August 2007
Author:robchurch
Status:old
Tags:
Comment:
* (bug 10859) Introduce 'UserGetImplicitGroups' hook; see docs/hooks.txt for more information
* Move the list of implicit groups in User::getAllGroups() to a new User::getImplicitGroups() method so there's no confusion over where to add these
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -692,6 +692,9 @@
693693 $user: user that watched
694694 $article: article object that was watched
695695
 696+'UserGetImplicitGroups': Called in User::getImplicitGroups()
 697+&$groups: List of implicit (automatically-assigned) groups
 698+
696699 'UserGetRights': Called in User::getRights()
697700 $user: User to get rights for
698701 &$rights: Current rights
Index: trunk/phase3/includes/User.php
@@ -2561,10 +2561,25 @@
25622562 global $wgGroupPermissions;
25632563 return array_diff(
25642564 array_keys( $wgGroupPermissions ),
2565 - array( '*', 'user', 'autoconfirmed', 'emailconfirmed' ) );
 2565+ self::getImplicitGroups()
 2566+ );
25662567 }
25672568
25682569 /**
 2570+ * Get a list of implicit groups
 2571+ *
 2572+ * @return array
 2573+ */
 2574+ public static function getImplicitGroups() {
 2575+ static $groups = null;
 2576+ if( !is_array( $groups ) ) {
 2577+ $groups = array( '*', 'user', 'autoconfirmed', 'emailconfirmed' );
 2578+ wfRunHooks( 'UserGetImplicitGroups', array( &$groups ) );
 2579+ }
 2580+ return $groups;
 2581+ }
 2582+
 2583+ /**
25692584 * Get the title of a page describing a particular group
25702585 *
25712586 * @param $group Name of the group
Index: trunk/phase3/RELEASE-NOTES
@@ -167,6 +167,8 @@
168168 * Show standard tool links for blocked users in Special:Ipblocklist
169169 * Miscellaneous aesthetic improvements to Special:Ipblocklist
170170 * (bug 10826) Added link trail with Cyrillic characters for Mongolian language
 171+* (bug 10859) Introduce 'UserGetImplicitGroups' hook; see docs/hooks.txt for
 172+ more information
171173
172174 == Bugfixes since 1.10 ==
173175

Follow-up revisions

RevisionCommit summaryAuthorDate
r24755Merged revisions 24694-24754 via svnmerge from...david19:48, 13 August 2007

Status & tagging log