From f9c1a0c3c78846a368d792b6bb2a78d9ded6d1af Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Wed, 19 Dec 2007 17:59:53 +0000 Subject: [PATCH] Code style, avoiding warnings. --- includes/SpecialUserrights.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/includes/SpecialUserrights.php b/includes/SpecialUserrights.php index 2f1cf02033..6378d0858c 100644 --- a/includes/SpecialUserrights.php +++ b/includes/SpecialUserrights.php @@ -448,6 +448,17 @@ class UserrightsForm extends HTMLForm { function changeableGroups() { global $wgUser; + if( $wgUser->isAllowed( 'userrights' ) ) { + // This group gives the right to modify everything (reverse- + // compatibility with old "userrights lets you change + // everything") + return array( + 'add' => User::getAllGroups(), + 'remove' => User::getAllGroups() + ); + } + + // Okay, it's not so simple, we will have to go through the arrays $groups = array( 'add' => array(), 'remove' => array() ); $addergroups = $wgUser->getEffectiveGroups(); @@ -466,21 +477,10 @@ class UserrightsForm extends HTMLForm { * * @param String $group The group to check for whether it can add/remove * @return Array array( 'add' => array( addablegroups ), 'remove' => array( removablegroups ) ) - */ + */ private function changeableByGroup( $group ) { - global $wgGroupPermissions, $wgAddGroups, $wgRemoveGroups; - - if( $wgGroupPermissions[$group]['userrights'] == true ) { - // This group gives the right to modify everything (reverse- - // compatibility with old "userrights lets you change - // everything") - return array( - 'add' => User::getAllGroups(), - 'remove' => User::getAllGroups() - ); - } - - // Okay, it's not so simple, we have to go through the arrays + global $wgAddGroups, $wgRemoveGroups; + $groups = array( 'add' => array(), 'remove' => array() ); if( empty($wgAddGroups[$group]) ) { // Don't add anything to $groups -- 2.20.1