From: Tim Starling Date: Sat, 14 May 2005 05:39:39 +0000 (+0000) Subject: Fixed duplicate group problem, fixed isNewbie() function X-Git-Tag: 1.5.0alpha2~209 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=d5110cbdc353594dad0453b3632a0038badd01a7;p=lhc%2Fweb%2Fwiklou.git Fixed duplicate group problem, fixed isNewbie() function --- 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; } /**