Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -637,6 +637,10 @@ |
638 | 638 | $user: user that watched |
639 | 639 | $article: article object that was watched |
640 | 640 | |
| 641 | +'UserEffectiveGroups': Called in User::getEffectiveGroups() |
| 642 | +$user: User to get groups for |
| 643 | +&$groups: Current effective groups |
| 644 | + |
641 | 645 | 'CategoryPageView': before viewing a categorypage in CategoryPage::view |
642 | 646 | $catpage: CategoryPage instance |
643 | 647 | |
Index: trunk/phase3/includes/User.php |
— | — | @@ -1637,6 +1637,8 @@ |
1638 | 1638 | $this->mEffectiveGroups[] = 'emailconfirmed'; |
1639 | 1639 | } |
1640 | 1640 | } |
| 1641 | + # Hook for additional groups |
| 1642 | + wfRunHooks( 'UserEffectiveGroups', array( &$this, &$this->mEffectiveGroups ) ); |
1641 | 1643 | } |
1642 | 1644 | } |
1643 | 1645 | return $this->mEffectiveGroups; |
— | — | @@ -2467,6 +2469,18 @@ |
2468 | 2470 | $this->mEmailToken && |
2469 | 2471 | $this->mEmailTokenExpires > wfTimestamp(); |
2470 | 2472 | } |
| 2473 | + |
| 2474 | + /** |
| 2475 | + * Get the timestamp of account creation, or false for |
| 2476 | + * non-existent/anonymous user accounts |
| 2477 | + * |
| 2478 | + * @return mixed |
| 2479 | + */ |
| 2480 | + public function getRegistration() { |
| 2481 | + return $this->mId > 0 |
| 2482 | + ? $this->mRegistration |
| 2483 | + : false; |
| 2484 | + } |
2471 | 2485 | |
2472 | 2486 | /** |
2473 | 2487 | * @param array $groups list of groups |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -109,6 +109,7 @@ |
110 | 110 | classes: mw-code, mw-css, mw-js) |
111 | 111 | * (bug 6711) Add $wgAddGroups and $wgRemoveGroups to allow finer control over |
112 | 112 | usergroup assignment. |
| 113 | +* Introduce 'UserEffectiveGroups' hook; see docs/hooks.txt for more information |
113 | 114 | |
114 | 115 | == Bugfixes since 1.10 == |
115 | 116 | |