Fixed duplicate group problem, fixed isNewbie() function
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 14 May 2005 05:39:39 +0000 (05:39 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 14 May 2005 05:39:39 +0000 (05:39 +0000)
includes/User.php

index 35cfca3..9305a49 100644 (file)
@@ -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;
        }
 
        /**