From 6da9b403d8ef73b2503b6fe130e1ff8714f84cbd Mon Sep 17 00:00:00 2001 From: Rob Church Date: Wed, 11 Jan 2006 03:37:51 +0000 Subject: [PATCH] Clear up some instances of old OutputPage::sysopRequired() function usage, replace with permissionRequired() --- RELEASE-NOTES | 2 +- includes/Article.php | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 21ea9f7259..7e7dd8855a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -457,7 +457,7 @@ fully support the editing toolbar, but was found to be too confusing. * Enforce $wgSVGMaxSize when rendering, even for SVGs with a very large source size. This is necessary to limit server memory usage. * Cleanup and error checking on Special:Listredirects - +* Clear up some instances of old OutputPage::sysopRequired() function usage === Caveats === diff --git a/includes/Article.php b/includes/Article.php index c34d2d9806..ac18a182f0 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1504,21 +1504,23 @@ class Article { global $wgOut, $wgRequest, $wgOnlySysopsCanPatrol, $wgUseRCPatrol, $wgUser; $wgOut->setRobotpolicy( 'noindex,follow' ); - if ( !$wgUseRCPatrol ) - { - $wgOut->errorpage( 'rcpatroldisabled', 'rcpatroldisabledtext' ); + # Check RC patrol config. option + if( !$wgUseRCPatrol ) { + $wgOut->errorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' ); return; } - if ( $wgUser->isAnon() ) - { + + # Check permissions + if( $wgUser->isLoggedIn() ) { + if( !$wgUser->isAllowed( 'patrol' ) ) { + $wgOut->permissionRequired( 'patrol' ); + return; + } + } else { $wgOut->loginToUse(); return; } - if ( $wgOnlySysopsCanPatrol && !$wgUser->isAllowed('patrol') ) - { - $wgOut->sysopRequired(); - return; - } + $rcid = $wgRequest->getVal( 'rcid' ); if ( !is_null ( $rcid ) ) { @@ -1715,7 +1717,7 @@ class Article { return; } } else { - $wgOut->sysopRequired(); + $wgOut->permissionRequired( 'delete' ); return; } @@ -2043,7 +2045,7 @@ class Article { return; } } else { - $wgOut->sysopRequired(); + $wgOut->permissionRequired( 'rollback' ); return; } -- 2.20.1