r70747 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70746‎ | r70747 | r70748 >
Date:06:40, 9 August 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added required siteadmin for the special pages
Modified paths:
  • /trunk/extensions/Deployment/specials/SpecialDashboard.php (modified) (history)
  • /trunk/extensions/Deployment/specials/SpecialExtensions.php (modified) (history)
  • /trunk/extensions/Deployment/specials/SpecialInstall.php (modified) (history)
  • /trunk/extensions/Deployment/specials/SpecialUpdate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Deployment/specials/SpecialExtensions.php
@@ -40,7 +40,7 @@
4141 * Constructor.
4242 */
4343 public function __construct() {
44 - parent::__construct( 'Extensions' );
 44+ parent::__construct( 'Extensions', 'siteadmin' );
4545 }
4646
4747 /**
@@ -51,8 +51,16 @@
5252 * @param $arg String
5353 */
5454 public function execute( $arg ) {
55 - global $wgOut;
56 - $wgOut->addWikiText( $this->getExtensionList() );
 55+ global $wgOut, $wgUser;
 56+
 57+ //$wgOut->setPageTitle( wfMsg( 'extensions' ) );
 58+
 59+ // If the user is authorized, display the page, if not, show an error.
 60+ if ( $this->userCanExecute( $wgUser ) ) {
 61+ $wgOut->addWikiText( $this->getExtensionList() );
 62+ } else {
 63+ $this->displayRestrictionError();
 64+ }
5765 }
5866
5967 /**
Index: trunk/extensions/Deployment/specials/SpecialUpdate.php
@@ -27,7 +27,7 @@
2828 * @since 0.1
2929 */
3030 public function __construct() {
31 - parent::__construct( 'Update' );
 31+ parent::__construct( 'Update', 'siteadmin' );
3232 }
3333
3434 /**
@@ -38,7 +38,14 @@
3939 * @param $arg String
4040 */
4141 public function execute( $arg ) {
 42+ global $wgOut, $wgUser;
4243
 44+ // If the user is authorized, display the page, if not, show an error.
 45+ if ( $this->userCanExecute( $wgUser ) ) {
 46+ $wgOut->addWikiText( $this->getExtensionList() );
 47+ } else {
 48+ $this->displayRestrictionError();
 49+ }
4350 }
4451
4552 }
\ No newline at end of file
Index: trunk/extensions/Deployment/specials/SpecialInstall.php
@@ -27,7 +27,7 @@
2828 * @since 0.1
2929 */
3030 public function __construct() {
31 - parent::__construct( 'Install' );
 31+ parent::__construct( 'Install', 'siteadmin' );
3232 }
3333
3434 /**
@@ -38,7 +38,14 @@
3939 * @param $arg String
4040 */
4141 public function execute( $arg ) {
 42+ global $wgOut, $wgUser;
4243
 44+ // If the user is authorized, display the page, if not, show an error.
 45+ if ( $this->userCanExecute( $wgUser ) ) {
 46+ $wgOut->addWikiText( $this->getExtensionList() );
 47+ } else {
 48+ $this->displayRestrictionError();
 49+ }
4350 }
4451
4552 }
\ No newline at end of file
Index: trunk/extensions/Deployment/specials/SpecialDashboard.php
@@ -27,7 +27,7 @@
2828 * @since 0.1
2929 */
3030 public function __construct() {
31 - parent::__construct( 'Dashboard' );
 31+ parent::__construct( 'Dashboard', 'siteadmin' );
3232 }
3333
3434 /**
@@ -38,7 +38,14 @@
3939 * @param $arg String
4040 */
4141 public function execute( $arg ) {
 42+ global $wgOut, $wgUser;
4243
 44+ // If the user is authorized, display the page, if not, show an error.
 45+ if ( $this->userCanExecute( $wgUser ) ) {
 46+ $wgOut->addWikiText( $this->getExtensionList() );
 47+ } else {
 48+ $this->displayRestrictionError();
 49+ }
4350 }
4451
4552 }
\ No newline at end of file

Status & tagging log