From d5110cbdc353594dad0453b3632a0038badd01a7 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 14 May 2005 05:39:39 +0000 Subject: [PATCH] Fixed duplicate group problem, fixed isNewbie() function --- includes/User.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/User.php b/includes/User.php index 35cfca3926..9305a49593 100644 --- a/includes/User.php +++ b/includes/User.php @@ -525,13 +525,16 @@ class User { // Get groups id $res = $dbr->select( 'user_groups', array( 'ug_group' ), array( 'ug_user' => $this->mId ) ); + + // add the default group for logged in user + $this->mGroups = array( $wgLoggedInGroupId ); while($group = $dbr->fetchRow($res)) { - $this->mGroups[] = $group[0]; + if ( $group[0] != $wgLoggedInGroupId ) { + $this->mGroups[] = $group[0]; + } } - // add the default group for logged in user - $this->mGroups[] = $wgLoggedInGroupId; $this->mRights = array(); // now we merge groups rights to get this user rights @@ -1260,7 +1263,7 @@ class User { * @return bool True if it is a newbie. */ function isNewbie() { - return $this->mId > User::getMaxID() * 0.99 && !$this->isSysop() && !$this->isBot() || $this->getID() == 0; + return $this->mId > User::getMaxID() * 0.99 && !$this->isAllowed( 'delete' ) && !$this->isBot() || $this->getID() == 0; } /** -- 2.20.1