* (bug 10859) Introduce 'UserGetImplicitGroups' hook; see docs/hooks.txt for more...
authorRob Church <robchurch@users.mediawiki.org>
Thu, 9 Aug 2007 16:36:15 +0000 (16:36 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Thu, 9 Aug 2007 16:36:15 +0000 (16:36 +0000)
* 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

RELEASE-NOTES
docs/hooks.txt
includes/User.php

index 1ff18dd..ccda196 100644 (file)
@@ -167,6 +167,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Show standard tool links for blocked users in Special:Ipblocklist
 * Miscellaneous aesthetic improvements to Special:Ipblocklist
 * (bug 10826) Added link trail with Cyrillic characters for Mongolian language
+* (bug 10859) Introduce 'UserGetImplicitGroups' hook; see docs/hooks.txt for
+  more information
 
 == Bugfixes since 1.10 ==
 
index 55bca1e..b33a951 100644 (file)
@@ -692,6 +692,9 @@ $article: article object watched
 $user: user that watched
 $article: article object that was watched
 
+'UserGetImplicitGroups': Called in User::getImplicitGroups()
+&$groups: List of implicit (automatically-assigned) groups
+
 'UserGetRights': Called in User::getRights()
 $user: User to get rights for
 &$rights: Current rights
index 38fd5d0..fb735e8 100644 (file)
@@ -2561,7 +2561,22 @@ class User {
                global $wgGroupPermissions;
                return array_diff(
                        array_keys( $wgGroupPermissions ),
-                       array( '*', 'user', 'autoconfirmed', 'emailconfirmed' ) );
+                       self::getImplicitGroups()
+               );
+       }
+
+       /**
+        * Get a list of implicit groups
+        *
+        * @return array
+        */
+       public static function getImplicitGroups() {
+               static $groups = null;
+               if( !is_array( $groups ) ) {
+                       $groups = array( '*', 'user', 'autoconfirmed', 'emailconfirmed' );
+                       wfRunHooks( 'UserGetImplicitGroups', array( &$groups ) );
+               }
+               return $groups;
        }
 
        /**