MediaWiki r14158 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r14157‎ | r14158 (on ViewVC)‎ | r14159 >
Date:20:09, 10 May 2006
Author:hashar
Status:old
Tags:
Comment:
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)
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/User.php
===================================================================
--- trunk/phase3/includes/User.php	(revision 14157)
+++ trunk/phase3/includes/User.php	(revision 14158)
@@ -449,7 +449,8 @@
 		}
 
 		# 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 @@
 	}
 
 	/**
-	 * 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' );
 	}
 
 	/**
Index: trunk/phase3/includes/Article.php
===================================================================
--- trunk/phase3/includes/Article.php	(revision 14157)
+++ trunk/phase3/includes/Article.php	(revision 14158)
@@ -972,7 +972,7 @@
 		$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: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 14157)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 14158)
@@ -857,7 +857,9 @@
 $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: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 14157)
+++ trunk/phase3/RELEASE-NOTES	(revision 14158)
@@ -239,6 +239,8 @@
 * --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 ==
 

Status & tagging log

  • 01:58, 13 October 2010 ^demon (Talk | contribs) changed the status of r14158 [removed: new added: old]
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox