http://www.mediawiki.org/wiki/Special:Code/MediaWiki/94905

Revision: 94905
Author:   ashley
Date:     2011-08-18 16:21:54 +0000 (Thu, 18 Aug 2011)
Log Message:
-----------
SocialProfile: don't allow the user to access Special:SendBoardBlast if 1) the 
user in question is blocked or 2) if the database is locked

Modified Paths:
--------------
    trunk/extensions/SocialProfile/UserBoard/SpecialSendBoardBlast.php

Modified: trunk/extensions/SocialProfile/UserBoard/SpecialSendBoardBlast.php
===================================================================
--- trunk/extensions/SocialProfile/UserBoard/SpecialSendBoardBlast.php  
2011-08-18 16:11:21 UTC (rev 94904)
+++ trunk/extensions/SocialProfile/UserBoard/SpecialSendBoardBlast.php  
2011-08-18 16:21:54 UTC (rev 94905)
@@ -27,12 +27,6 @@
        public function execute( $params ) {
                global $wgRequest, $wgOut, $wgUser, $wgUserBoardScripts;
 
-               // Add CSS & JS
-               $wgOut->addExtensionStyle( $wgUserBoardScripts . 
'/BoardBlast.css' );
-               $wgOut->addScriptFile( $wgUserBoardScripts . '/BoardBlast.js' );
-
-               $output = '';
-
                // This feature is available only to logged-in users.
                if ( !$wgUser->isLoggedIn() ) {
                        $wgOut->setPageTitle( wfMsg( 'boardblastlogintitle' ) );
@@ -40,6 +34,24 @@
                        return '';
                }
 
+               // Is the database locked?
+               if( wfReadOnly() ) {
+                       $wgOut->readOnlyPage();
+                       return false;
+               }
+
+               // Blocked through Special:Block? No access for you!
+               if( $wgUser->isBlocked() ) {
+                       $wgOut->blockedPage( false );
+                       return false;
+               }
+
+               // Add CSS & JS
+               $wgOut->addExtensionStyle( $wgUserBoardScripts . 
'/BoardBlast.css' );
+               $wgOut->addScriptFile( $wgUserBoardScripts . '/BoardBlast.js' );
+
+               $output = '';
+
                if ( $wgRequest->wasPosted() ) {
                        $wgOut->setPageTitle( wfMsg( 'messagesenttitle' ) );
                        $b = new UserBoard();


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to