Add UserRights hook, fires after a user's group memberships are changed
authorRob Church <robchurch@users.mediawiki.org>
Wed, 29 Mar 2006 02:31:15 +0000 (02:31 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Wed, 29 Mar 2006 02:31:15 +0000 (02:31 +0000)
RELEASE-NOTES
docs/hooks.txt
includes/SpecialUserrights.php

index 92ef739..132d0f2 100644 (file)
@@ -90,6 +90,7 @@ Hooks:
   from an extension that changes rendering based on nonstandard options.
 * Add 'GetInternalURL' hook to match the GetFullURL and GetLocalURL ones
 * (bug 4456) Add hook for marking article patrolled
+* Add UserRights hook, fires after a user's group memberships are changed
 
 Images:
 * Support SVG rendering with rsvg
index f6f3cb9..eb48c1e 100644 (file)
@@ -400,6 +400,11 @@ $user: the user object that is about to be logged out
        
 'UserLogoutComplete': after a user has logged out
 $user: the user object _after_ logout (won't have name, ID, etc.)
+
+'UserRights': After a user's group memberships are changed
+$user  : User object that was changed
+$add   : Array of strings corresponding to groups added
+$remove: Array of strings corresponding to groups removed
                      
 'WatchArticle': before a watch is added to an article
 $user: user that will watch
index 60a97f8..ef65f16 100644 (file)
@@ -108,6 +108,7 @@ class UserrightsForm extends HTMLForm {
                wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) );
                wfDebug( 'newGroups: ' . print_r( $newGroups, true ) );
 
+               wfRunHooks( 'UserRights', array( &$u, $addgroup, $removegroup ) );      
                $log = new LogPage( 'rights' );
                $log->addEntry( 'rights', Title::makeTitle( NS_USER, $u->getName() ), '', array( $this->makeGroupNameList( $oldGroups ),
                        $this->makeGroupNameList( $newGroups ) ) );