summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2019-11-12 13:54:23 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2019-11-12 21:37:11 +0100
commite7ad0b867a0784a432d1f6c6d4d47107a3ee8bfa (patch)
tree98fac86adc4898ac2679836f5a465618dfa79058
parent6dc823e4d2f2378981cd84a59dcfcc241076bc20 (diff)
#915 Adapt web to use 'echo' parameter of POST /shell/run
-rw-r--r--admin/WebConsole/includes/restfunctions.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php
index 34c4085c..486ac682 100644
--- a/admin/WebConsole/includes/restfunctions.php
+++ b/admin/WebConsole/includes/restfunctions.php
@@ -58,6 +58,7 @@ define('OG_REST_PARAM_PATH', 'path');
define('OG_REST_PARAM_DIFF_ID', 'diff_id');
define('OG_REST_PARAM_DIFF_NAME', 'diff_name');
define('OG_REST_PARAM_METHOD', 'method');
+define('OG_REST_PARAM_ECHO', 'echo');
$conf_file = parse_ini_file(__DIR__ . '/../../etc/ogAdmServer.cfg');
define('OG_REST_API_TOKEN', 'Authorization: ' . $conf_file['APITOKEN']);
@@ -106,10 +107,15 @@ function shell($case, $string_ips, $command) {
switch ($case) {
case 3:
$command = substr($command, 4);
- /* fall through */
+ $data = array(OG_REST_PARAM_CLIENTS => $ips,
+ OG_REST_PARAM_RUN => $command,
+ OG_REST_PARAM_ECHO => false);
+ $command = OG_REST_CMD_RUN;
+ break;
case 1:
$data = array(OG_REST_PARAM_CLIENTS => $ips,
- OG_REST_PARAM_RUN => $command);
+ OG_REST_PARAM_RUN => $command,
+ OG_REST_PARAM_ECHO => true);
$command = OG_REST_CMD_RUN;
break;
default: