From ee7ab4900efac8aa36750a377b732d4dd8a2d80b Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Sun, 16 Jul 2006 16:42:15 +0000 Subject: [PATCH] Making User::isBot deprecated, using User::isAllowed('bot') instead, making it a wrapper of User::isAllowed, and deleting several obsolete comments. --- includes/Article.php | 2 +- includes/RecentChange.php | 8 ++++---- includes/User.php | 8 ++------ 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 52e491dc80..64168896a0 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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 ); diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 1f035d367f..a1352ce145 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -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, diff --git a/includes/User.php b/includes/User.php index 64c1f0cdf6..7bc52aba25 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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' ); } /** -- 2.20.1