Clear up some instances of old OutputPage::sysopRequired() function usage, replace...
authorRob Church <robchurch@users.mediawiki.org>
Wed, 11 Jan 2006 03:37:51 +0000 (03:37 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Wed, 11 Jan 2006 03:37:51 +0000 (03:37 +0000)
RELEASE-NOTES
includes/Article.php

index 21ea9f7..7e7dd88 100644 (file)
@@ -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 ===
 
index c34d2d9..ac18a18 100644 (file)
@@ -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;
                }