Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -692,6 +692,9 @@ |
693 | 693 | $user: user that watched |
694 | 694 | $article: article object that was watched |
695 | 695 | |
| 696 | +'UserGetImplicitGroups': Called in User::getImplicitGroups() |
| 697 | +&$groups: List of implicit (automatically-assigned) groups |
| 698 | + |
696 | 699 | 'UserGetRights': Called in User::getRights() |
697 | 700 | $user: User to get rights for |
698 | 701 | &$rights: Current rights |
Index: trunk/phase3/includes/User.php |
— | — | @@ -2561,10 +2561,25 @@ |
2562 | 2562 | global $wgGroupPermissions; |
2563 | 2563 | return array_diff( |
2564 | 2564 | array_keys( $wgGroupPermissions ), |
2565 | | - array( '*', 'user', 'autoconfirmed', 'emailconfirmed' ) ); |
| 2565 | + self::getImplicitGroups() |
| 2566 | + ); |
2566 | 2567 | } |
2567 | 2568 | |
2568 | 2569 | /** |
| 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 | + /** |
2569 | 2584 | * Get the title of a page describing a particular group |
2570 | 2585 | * |
2571 | 2586 | * @param $group Name of the group |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -167,6 +167,8 @@ |
168 | 168 | * Show standard tool links for blocked users in Special:Ipblocklist |
169 | 169 | * Miscellaneous aesthetic improvements to Special:Ipblocklist |
170 | 170 | * (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 |
171 | 173 | |
172 | 174 | == Bugfixes since 1.10 == |
173 | 175 | |