From: Rob Church Date: Wed, 29 Mar 2006 02:31:15 +0000 (+0000) Subject: Add UserRights hook, fires after a user's group memberships are changed X-Git-Tag: 1.6.0~88 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=fd2fd4ec47aa28f9b31df10f02a3abe1b871b51a;p=lhc%2Fweb%2Fwiklou.git Add UserRights hook, fires after a user's group memberships are changed --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 92ef739e9f..132d0f2219 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/docs/hooks.txt b/docs/hooks.txt index f6f3cb9240..eb48c1ec6c 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/SpecialUserrights.php b/includes/SpecialUserrights.php index 60a97f8873..ef65f16587 100644 --- a/includes/SpecialUserrights.php +++ b/includes/SpecialUserrights.php @@ -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 ) ) );