From 8217ef81a32797c0f175cca735ecb5c5231acef9 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Thu, 24 Apr 2008 08:11:36 +0000 Subject: [PATCH] Also split off logging from Userrights class. This is the last of the modifications needed for the modified version in centralauth to work. --- includes/SpecialUserrights.php | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) 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 -- 2.20.1