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
@@ -449,7 +449,8 @@
450450 }
451451
452452 # Proxy blocking
453 - if ( !$this->isSysop() && !in_array( $ip, $wgProxyWhitelist ) ) {
 453+ # FIXME ? proxyunbannable is to deprecate the old isSysop()
 454+ if ( !$this->isAllowed('proxyunbannable') && !in_array( $ip, $wgProxyWhitelist ) ) {
454455
455456 # Local list
456457 if ( wfIsLocallyBlockedProxy( $ip ) ) {
@@ -1171,21 +1172,30 @@
11721173 }
11731174
11741175 /**
1175 - * Check if a user is sysop
 1176+ * Deprecated in 1.6, die in 1.7, to be removed in 1.8
11761177 * @deprecated
11771178 */
11781179 function isSysop() {
1179 - return $this->isAllowed( 'protect' );
 1180+ wfDebugDieBacktrace( "Call to deprecated (v1.7) User::isSysop() method\n" );
 1181+ #return $this->isAllowed( 'protect' );
11801182 }
11811183
1182 - /** @deprecated */
 1184+ /**
 1185+ * Deprecated in 1.6, die in 1.7, to be removed in 1.8
 1186+ * @deprecated
 1187+ */
11831188 function isDeveloper() {
1184 - return $this->isAllowed( 'siteadmin' );
 1189+ wfDebugDieBacktrace( "Call to deprecated (v1.7) User::isDeveloper() method\n" );
 1190+ #return $this->isAllowed( 'siteadmin' );
11851191 }
11861192
1187 - /** @deprecated */
 1193+ /**
 1194+ * Deprecated in 1.6, die in 1.7, to be removed in 1.8
 1195+ * @deprecated
 1196+ */
11881197 function isBureaucrat() {
1189 - return $this->isAllowed( 'makesysop' );
 1198+ wfDebugDieBacktrace( "Call to deprecated (v1.7) User::isBureaucrat() method\n" );
 1199+ #return $this->isAllowed( 'makesysop' );
11901200 }
11911201
11921202 /**
Index: trunk/phase3/includes/Article.php
@@ -972,7 +972,7 @@
973973 $tbtext = "";
974974 while ($o = $dbr->fetchObject($tbs)) {
975975 $rmvtxt = "";
976 - if ($wgUser->isSysop()) {
 976+ if ($wgUser->isAllowed( 'trackback' )) {
977977 $delurl = $this->mTitle->getFullURL("action=deletetrackback&tbid="
978978 . $o->tb_id . "&token=" . $wgUser->editToken());
979979 $rmvtxt = wfMsg('trackbackremove', $delurl);
Index: trunk/phase3/includes/DefaultSettings.php
@@ -857,7 +857,9 @@
858858 $wgGroupPermissions['sysop']['move'] = true;
859859 $wgGroupPermissions['sysop']['patrol'] = true;
860860 $wgGroupPermissions['sysop']['protect'] = true;
 861+$wgGroupPermissions['sysop']['proxyunbannable'] = true;
861862 $wgGroupPermissions['sysop']['rollback'] = true;
 863+$wgGroupPermissions['sysop']['trackback'] = true;
862864 $wgGroupPermissions['sysop']['upload'] = true;
863865 $wgGroupPermissions['sysop']['reupload'] = true;
864866 $wgGroupPermissions['sysop']['reupload-shared'] = true;
Index: trunk/phase3/RELEASE-NOTES
@@ -239,6 +239,8 @@
240240 * --force-normal parameter on dump scripts to force check for ICU extension
241241 * (bug 5895) Update for Dutch language (nl)
242242 * (bug 5891) Linktrail for Polish language (pl)
 243+* User::isBureaucrat , User::isDeveloper , User::isSysop deprecated in
 244+ v1.6 now die with a backtrace. They will be removed in v1.8
243245
244246 == Compatibility ==
245247

Status & tagging log

  • 01:58, 13 October 2010 ^demon (talk | contribs) changed the status of r14158 [removed: new added: old]