Die with a backtrace when using User::isBureaucrat User::isDeveloper User::isSysop
authorAntoine Musso <hashar@users.mediawiki.org>
Wed, 10 May 2006 20:09:30 +0000 (20:09 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Wed, 10 May 2006 20:09:30 +0000 (20:09 +0000)
Related to #2498 and helps a bit bug 700: Code quality issues (tracking)

RELEASE-NOTES
includes/Article.php
includes/DefaultSettings.php
includes/User.php

index 5597b52..30fd27e 100644 (file)
@@ -239,6 +239,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * --force-normal parameter on dump scripts to force check for ICU extension
 * (bug 5895) Update for Dutch language (nl)
 * (bug 5891) Linktrail for Polish language (pl)
+* User::isBureaucrat , User::isDeveloper , User::isSysop deprecated in
+  v1.6 now die with a backtrace. They will be removed in v1.8
 
 == Compatibility ==
 
index 52ecca4..945f5c5 100644 (file)
@@ -972,7 +972,7 @@ class Article {
                $tbtext = "";
                while ($o = $dbr->fetchObject($tbs)) {
                        $rmvtxt = "";
-                       if ($wgUser->isSysop()) {
+                       if ($wgUser->isAllowed( 'trackback' )) {
                                $delurl = $this->mTitle->getFullURL("action=deletetrackback&tbid="
                                                . $o->tb_id . "&token=" . $wgUser->editToken());
                                $rmvtxt = wfMsg('trackbackremove', $delurl);
index 138ee1c..3637407 100644 (file)
@@ -857,7 +857,9 @@ $wgGroupPermissions['sysop']['importupload']    = true;
 $wgGroupPermissions['sysop']['move']            = true;
 $wgGroupPermissions['sysop']['patrol']          = true;
 $wgGroupPermissions['sysop']['protect']         = true;
+$wgGroupPermissions['sysop']['proxyunbannable'] = true;
 $wgGroupPermissions['sysop']['rollback']        = true;
+$wgGroupPermissions['sysop']['trackback']       = true;
 $wgGroupPermissions['sysop']['upload']          = true;
 $wgGroupPermissions['sysop']['reupload']        = true;
 $wgGroupPermissions['sysop']['reupload-shared'] = true;
index 65e49f4..cb6a6de 100644 (file)
@@ -449,7 +449,8 @@ class User {
                }
 
                # Proxy blocking
-               if ( !$this->isSysop() && !in_array( $ip, $wgProxyWhitelist ) ) {
+               # FIXME ? proxyunbannable is to deprecate the old isSysop()
+               if ( !$this->isAllowed('proxyunbannable') && !in_array( $ip, $wgProxyWhitelist ) ) {
 
                        # Local list
                        if ( wfIsLocallyBlockedProxy( $ip ) ) {
@@ -1171,21 +1172,30 @@ class User {
        }
 
        /**
-        * Check if a user is sysop
+        * Deprecated in 1.6, die in 1.7, to be removed in 1.8
         * @deprecated
         */
        function isSysop() {
-               return $this->isAllowed( 'protect' );
+               wfDebugDieBacktrace( "Call to deprecated (v1.7) User::isSysop() method\n" );
+               #return $this->isAllowed( 'protect' );
        }
 
-       /** @deprecated */
+       /**
+        * Deprecated in 1.6, die in 1.7, to be removed in 1.8
+        * @deprecated
+        */
        function isDeveloper() {
-               return $this->isAllowed( 'siteadmin' );
+               wfDebugDieBacktrace( "Call to deprecated (v1.7) User::isDeveloper() method\n" );
+               #return $this->isAllowed( 'siteadmin' );
        }
 
-       /** @deprecated */
+       /**
+        * Deprecated in 1.6, die in 1.7, to be removed in 1.8
+        * @deprecated
+        */
        function isBureaucrat() {
-               return $this->isAllowed( 'makesysop' );
+               wfDebugDieBacktrace( "Call to deprecated (v1.7) User::isBureaucrat() method\n" );
+               #return $this->isAllowed( 'makesysop' );
        }
 
        /**