From: Antoine Musso Date: Wed, 10 May 2006 20:09:30 +0000 (+0000) Subject: Die with a backtrace when using User::isBureaucrat User::isDeveloper User::isSysop X-Git-Tag: 1.31.0-rc.0~57183 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=2bc251967c2fbe45f5a27c5987e3b3b99b071139;p=lhc%2Fweb%2Fwiklou.git Die with a backtrace when using User::isBureaucrat User::isDeveloper User::isSysop Related to #2498 and helps a bit bug 700: Code quality issues (tracking) --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5597b52e1b..30fd27e8a5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/Article.php b/includes/Article.php index 52ecca4bdd..945f5c5da0 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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); diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 138ee1cc19..3637407559 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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; diff --git a/includes/User.php b/includes/User.php index 65e49f4857..cb6a6de588 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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' ); } /**