Making User::isBot deprecated, using User::isAllowed('bot') instead, making it a...
authorRotem Liss <rotem@users.mediawiki.org>
Sun, 16 Jul 2006 16:42:15 +0000 (16:42 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Sun, 16 Jul 2006 16:42:15 +0000 (16:42 +0000)
includes/Article.php
includes/RecentChange.php
includes/User.php

index 52e491d..6416889 100644 (file)
@@ -1216,7 +1216,7 @@ class Article {
 
                # Silently ignore EDIT_MINOR if not allowed
                $isminor = ( $flags & EDIT_MINOR ) && $wgUser->isAllowed('minoredit');
-               $bot = $wgUser->isBot() || ( $flags & EDIT_FORCE_BOT );
+               $bot = $wgUser->isAllowed( 'bot' ) || ( $flags & EDIT_FORCE_BOT );
 
                $text = $this->preSaveTransform( $text );
 
index 1f035d3..a1352ce 100644 (file)
@@ -201,7 +201,7 @@ class RecentChange
                $newId = 0)
        {
                if ( $bot == 'default' ) {
-                       $bot = $user->isBot();
+                       $bot = $user->isAllowed( 'bot' );
                }
 
                if ( !$ip ) {
@@ -260,7 +260,7 @@ class RecentChange
                        }
                }
                if ( $bot == 'default' ) {
-                       $bot = $user->isBot();
+                       $bot = $user->isAllowed( 'bot' );
                }
 
                $rc = new RecentChange;
@@ -319,7 +319,7 @@ class RecentChange
                        'rc_comment'    => $comment,
                        'rc_this_oldid' => 0,
                        'rc_last_oldid' => 0,
-                       'rc_bot'        => $user->isBot() ? 1 : 0,
+                       'rc_bot'        => $user->isAllowed( 'bot' ) ? 1 : 0,
                        'rc_moved_to_ns'        => $newTitle->getNamespace(),
                        'rc_moved_to_title'     => $newTitle->getDBkey(),
                        'rc_ip'         => $ip,
@@ -369,7 +369,7 @@ class RecentChange
                        'rc_comment'    => $comment,
                        'rc_this_oldid' => 0,
                        'rc_last_oldid' => 0,
-                       'rc_bot'        => $user->isBot() ? 1 : 0,
+                       'rc_bot'        => $user->isAllowed( 'bot' ) ? 1 : 0,
                        'rc_moved_to_ns'        => 0,
                        'rc_moved_to_title'     => '',
                        'rc_ip' => $ip,
index 64c1f0c..7bc52ab 100644 (file)
@@ -1206,7 +1206,6 @@ class User {
         */
        function isSysop() {
                throw new MWException( "Call to deprecated (v1.7) User::isSysop() method\n" );
-               #return $this->isAllowed( 'protect' );
        }
 
        /**
@@ -1215,7 +1214,6 @@ class User {
         */
        function isDeveloper() {
                throw new MWException( "Call to deprecated (v1.7) User::isDeveloper() method\n" );
-               #return $this->isAllowed( 'siteadmin' );
        }
 
        /**
@@ -1224,16 +1222,14 @@ class User {
         */
        function isBureaucrat() {
                throw new MWException( "Call to deprecated (v1.7) User::isBureaucrat() method\n" );
-               #return $this->isAllowed( 'makesysop' );
        }
 
        /**
         * Whether the user is a bot
-        * @todo need to be migrated to the new user level management sytem
+        * @deprecated
         */
        function isBot() {
-               $this->loadFromDatabase();
-               return in_array( 'bot', $this->mRights );
+               return $this->isAllowed( 'bot' );
        }
 
        /**