r12600 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12599‎ | r12600 | r12601 >
Date:03:37, 11 January 2006
Author:robchurch
Status:old
Tags:
Comment:
Clear up some instances of old OutputPage::sysopRequired() function usage, replace with permissionRequired()
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -1504,21 +1504,23 @@
15051505 global $wgOut, $wgRequest, $wgOnlySysopsCanPatrol, $wgUseRCPatrol, $wgUser;
15061506 $wgOut->setRobotpolicy( 'noindex,follow' );
15071507
1508 - if ( !$wgUseRCPatrol )
1509 - {
1510 - $wgOut->errorpage( 'rcpatroldisabled', 'rcpatroldisabledtext' );
 1508+ # Check RC patrol config. option
 1509+ if( !$wgUseRCPatrol ) {
 1510+ $wgOut->errorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' );
15111511 return;
15121512 }
1513 - if ( $wgUser->isAnon() )
1514 - {
 1513+
 1514+ # Check permissions
 1515+ if( $wgUser->isLoggedIn() ) {
 1516+ if( !$wgUser->isAllowed( 'patrol' ) ) {
 1517+ $wgOut->permissionRequired( 'patrol' );
 1518+ return;
 1519+ }
 1520+ } else {
15151521 $wgOut->loginToUse();
15161522 return;
15171523 }
1518 - if ( $wgOnlySysopsCanPatrol && !$wgUser->isAllowed('patrol') )
1519 - {
1520 - $wgOut->sysopRequired();
1521 - return;
1522 - }
 1524+
15231525 $rcid = $wgRequest->getVal( 'rcid' );
15241526 if ( !is_null ( $rcid ) )
15251527 {
@@ -1715,7 +1717,7 @@
17161718 return;
17171719 }
17181720 } else {
1719 - $wgOut->sysopRequired();
 1721+ $wgOut->permissionRequired( 'delete' );
17201722 return;
17211723 }
17221724
@@ -2043,7 +2045,7 @@
20442046 return;
20452047 }
20462048 } else {
2047 - $wgOut->sysopRequired();
 2049+ $wgOut->permissionRequired( 'rollback' );
20482050 return;
20492051 }
20502052
Index: trunk/phase3/RELEASE-NOTES
@@ -457,8 +457,8 @@
458458 * Enforce $wgSVGMaxSize when rendering, even for SVGs with a very large source
459459 size. This is necessary to limit server memory usage.
460460 * Cleanup and error checking on Special:Listredirects
 461+* Clear up some instances of old OutputPage::sysopRequired() function usage
461462
462 -
463463 === Caveats ===
464464
465465 Some output, particularly involving user-supplied inline HTML, may not

Status & tagging log