apply CSS::Janus when user preview its CSS style
[lhc/web/wiklou.git] / includes / AjaxDispatcher.php
index 17b154d..5bc9f06 100644 (file)
@@ -68,7 +68,7 @@ class AjaxDispatcher {
         * request.
         */
        function performAction() {
-               global $wgAjaxExportList, $wgOut;
+               global $wgAjaxExportList, $wgOut, $wgUser;
 
                if ( empty( $this->mode ) ) {
                        return;
@@ -84,6 +84,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" );