]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blobdiff - includes/AjaxDispatcher.php
MediaWiki 1.17.1-scripts
[autoinstalls/mediawiki.git] / includes / AjaxDispatcher.php
index e36787fdf445856d221f6b5136651c42ee57d7e8..f7583188a74749b75ebf6ecf30f44153d35c983b 100644 (file)
@@ -74,7 +74,7 @@ class AjaxDispatcher {
         * request.
         */
        function performAction() {
-               global $wgAjaxExportList, $wgOut;
+               global $wgAjaxExportList, $wgOut, $wgUser;
 
                if ( empty( $this->mode ) ) {
                        return;
@@ -90,6 +90,13 @@ class AjaxDispatcher {
                                'Bad Request',
                                "unknown function " . (string) $this->func_name
                        );
+               } elseif ( !in_array( 'read', User::getGroupPermissions( array( '*' ) ), true ) 
+                       && !$wgUser->isAllowed( 'read' ) )
+               {
+                       wfHttpError(
+                               403,
+                               'Forbidden',
+                               'You must log in to view pages.' );
                } else {
                        wfDebug( __METHOD__ . ' dispatching ' . $this->func_name . "\n" );