r44278 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44277‎ | r44278 | r44279 >
Date:05:49, 7 December 2008
Author:mrzman
Status:deferred
Tags:
Comment:
fix stylesheet loading, don't let people who can't create pages access the page
Modified paths:
  • /trunk/extensions/uniwiki/CreatePage/CreatePage.php (modified) (history)
  • /trunk/extensions/uniwiki/CreatePage/CreatePage_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/uniwiki/CreatePage/CreatePage_body.php
@@ -5,7 +5,7 @@
66 class SpecialCreatePage extends SpecialPage {
77
88 function __construct() {
9 - SpecialPage::SpecialPage( 'CreatePage' );
 9+ SpecialPage::SpecialPage( 'CreatePage', 'createpage' );
1010 }
1111
1212 public function execute( $params ) {
@@ -14,6 +14,11 @@
1515 wfLoadExtensionMessages( 'CreatePage' );
1616
1717 $this->setHeaders();
 18+
 19+ if ( !$this->userCanExecute( $wgUser ) ) {
 20+ $this->displayRestrictionError();
 21+ return;
 22+ }
1823
1924 $skin = $wgUser->getSkin();
2025
@@ -53,6 +58,7 @@
5459 // if this is just a normal GET, then output the form
5560
5661 // prefill the input with the title, if it was passed along
 62+ $newTitle = false;
5763 $newTitleText = $wgRequest->getVal( "newtitle", null );
5864 if ( $newTitleText != null ) {
5965 $newTitle = Title::newFromURL( $newTitleText );
Index: trunk/extensions/uniwiki/CreatePage/CreatePage.php
@@ -34,6 +34,6 @@
3535 $wgHooks['BeforePageDisplay'][] = 'UW_CreatePage_CSS';
3636 function UW_CreatePage_CSS( $out ) {
3737 global $wgScriptPath;
38 - $out->addScript ( "<link rel='stylesheet' href='$wgScriptPath/extensions/uniwiki/CreatePage/style.css' />" );
 38+ $out->addStyle( "$wgScriptPath/extensions/uniwiki/CreatePage/style.css" );
3939 return true;
4040 }

Status & tagging log