From e7ad0b867a0784a432d1f6c6d4d47107a3ee8bfa Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Tue, 12 Nov 2019 13:54:23 +0100 Subject: #915 Adapt web to use 'echo' parameter of POST /shell/run --- admin/WebConsole/includes/restfunctions.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'admin/WebConsole/includes/restfunctions.php') 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: -- cgit v1.2.3-18-g5258