From: Andrew Garrett Date: Thu, 24 Apr 2008 08:11:36 +0000 (+0000) Subject: Also split off logging from Userrights class. This is the last of the modifications... X-Git-Tag: 1.31.0-rc.0~48107 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=8217ef81a32797c0f175cca735ecb5c5231acef9;p=lhc%2Fweb%2Fwiklou.git Also split off logging from Userrights class. This is the last of the modifications needed for the modified version in centralauth to work. --- diff --git a/includes/SpecialUserrights.php b/includes/SpecialUserrights.php index 22418f3b35..c13a8ad486 100644 --- a/includes/SpecialUserrights.php +++ b/includes/SpecialUserrights.php @@ -123,7 +123,7 @@ class UserrightsPage extends SpecialPage { return; } - $allgroups = User::getAllGroups(); + $allgroups = $this->getAllGroups(); $addgroup = array(); $removegroup = array(); @@ -182,18 +182,25 @@ class UserrightsPage extends SpecialPage { } if( $newGroups != $oldGroups ) { - $log = new LogPage( 'rights' ); - - $log->addEntry( 'rights', - $user->getUserPage(), - $wgRequest->getText( 'user-reason' ), - array( - $this->makeGroupNameList( $oldGroups ), - $this->makeGroupNameList( $newGroups ) - ) - ); + $this->addLogEntry( $user, $oldGroups, $newGroups ); } } + + /** + * Add a rights log entry for an action. + */ + function addLogEntry( $user, $oldGroups, $newGroups ) { + $log = new LogPage( 'rights' ); + + $log->addEntry( 'rights', + $user->getUserPage(), + $wgRequest->getText( 'user-reason' ), + array( + $this->makeGroupNameList( $oldGroups ), + $this->makeGroupNameList( $newGroups ) + ) + ); + } /** * Edit user groups membership