summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/includes/restfunctions.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/WebConsole/includes/restfunctions.php')
-rw-r--r--admin/WebConsole/includes/restfunctions.php22
1 files changed, 15 insertions, 7 deletions
diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php
index 274ca708..adf09b2e 100644
--- a/admin/WebConsole/includes/restfunctions.php
+++ b/admin/WebConsole/includes/restfunctions.php
@@ -116,6 +116,17 @@ function shell($case, $string_ips, $command) {
$ips = explode(';',$string_ips);
switch ($case) {
+ case 1:
+ $data = array(OG_REST_PARAM_CLIENTS => $ips,
+ OG_REST_PARAM_RUN => $command,
+ OG_REST_PARAM_ECHO => true);
+ $command = OG_REST_CMD_RUN;
+ break;
+ default:
+ case 2:
+ $data = array(OG_REST_PARAM_CLIENTS => $ips);
+ $command = OG_REST_CMD_OUTPUT;
+ break;
case 3:
$decoded_cmds = rawurldecode(substr($command, 4));
$command = substr($decoded_cmds, 0, -2);
@@ -124,16 +135,13 @@ function shell($case, $string_ips, $command) {
OG_REST_PARAM_ECHO => false);
$command = OG_REST_CMD_RUN;
break;
- case 1:
+ case 4:
+ $decoded_cmds = rawurldecode(substr($command, 4));
+ $command = substr($decoded_cmds, 0, -1);
$data = array(OG_REST_PARAM_CLIENTS => $ips,
OG_REST_PARAM_RUN => $command,
- OG_REST_PARAM_ECHO => true);
+ OG_REST_PARAM_ECHO => false);
$command = OG_REST_CMD_RUN;
- break;
- default:
- case 2:
- $data = array(OG_REST_PARAM_CLIENTS => $ips);
- $command = OG_REST_CMD_OUTPUT;
}
$result = common_request($command, POST,