From 0e8bf3143c18cd3e558917034ba27e43f089569d Mon Sep 17 00:00:00 2001 From: Hydriz Date: Mon, 12 Nov 2012 11:25:12 +0800 Subject: [PATCH] Revert "(issue #1) Add a whitelist of commands that a person can run" This reverts commit 6a1986449f277314700e59665987dd22740225ed. Conflicts: SpecialHostStats.php --- SpecialHostStats.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/SpecialHostStats.php b/SpecialHostStats.php index f07efc1..d8d3133 100644 --- a/SpecialHostStats.php +++ b/SpecialHostStats.php @@ -7,8 +7,6 @@ */ class SpecialHostStats extends SpecialPage { - protected $cmdwhitelist; - public function __construct() { parent::__construct( 'HostStats' ); } @@ -16,6 +14,7 @@ public function __construct() { public function execute( $par ) { global $wgHostStatsCommands; $this->setHeaders(); +<<<<<<< HEAD $this->whitelistedcmds(); $commands = array(); foreach ( $wgHostStatsCommands as $cmd ) { @@ -30,9 +29,12 @@ public function execute( $par ) { } } $this->getOutput()->setPageTitle( wfMessage( 'hoststats-title' )->escaped() ); +======= + $this->getOutput->setPageTitle( wfMessage( 'hoststats-title' )->escaped() ); +>>>>>>> parent of 6a19864... (issue #1) Add a whitelist of commands that a person can run $outpage = wfMessage( 'hoststats-intro' )->escaped(); $outpage .= "\n"; - foreach ( $commands as $cmd ) { + foreach ( $wgHostStatsCommands as $cmd ) { $outpage .= '

' . $cmd . '

'; $outpage .= "\n
\n" . $this->query( $cmd ) . "
"; } @@ -43,12 +45,4 @@ protected function query( $query ) { $output = wfShellExec( $query ); return $output; } - - protected function whitelistedcmds() { - $this->cmdwhitelist = array( - 'df', - 'whoami', - 'hostname', - ); - } }