r94905 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94904‎ | r94905 | r94906 >
Date:16:21, 18 August 2011
Author:ashley
Status:ok
Tags:
Comment:
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) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserBoard/SpecialSendBoardBlast.php
@@ -27,12 +27,6 @@
2828 public function execute( $params ) {
2929 global $wgRequest, $wgOut, $wgUser, $wgUserBoardScripts;
3030
31 - // Add CSS & JS
32 - $wgOut->addExtensionStyle( $wgUserBoardScripts . '/BoardBlast.css' );
33 - $wgOut->addScriptFile( $wgUserBoardScripts . '/BoardBlast.js' );
34 -
35 - $output = '';
36 -
3731 // This feature is available only to logged-in users.
3832 if ( !$wgUser->isLoggedIn() ) {
3933 $wgOut->setPageTitle( wfMsg( 'boardblastlogintitle' ) );
@@ -40,6 +34,24 @@
4135 return '';
4236 }
4337
 38+ // Is the database locked?
 39+ if( wfReadOnly() ) {
 40+ $wgOut->readOnlyPage();
 41+ return false;
 42+ }
 43+
 44+ // Blocked through Special:Block? No access for you!
 45+ if( $wgUser->isBlocked() ) {
 46+ $wgOut->blockedPage( false );
 47+ return false;
 48+ }
 49+
 50+ // Add CSS & JS
 51+ $wgOut->addExtensionStyle( $wgUserBoardScripts . '/BoardBlast.css' );
 52+ $wgOut->addScriptFile( $wgUserBoardScripts . '/BoardBlast.js' );
 53+
 54+ $output = '';
 55+
4456 if ( $wgRequest->wasPosted() ) {
4557 $wgOut->setPageTitle( wfMsg( 'messagesenttitle' ) );
4658 $b = new UserBoard();

Status & tagging log