From 63fb4881767b2f34c84b75b566a4dec8d5f807eb Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Tue, 29 Aug 2017 11:52:34 +0200 Subject: [PATCH] Clean code --- pandora_console/include/ajax/events.php | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index 4f28012b2b..09e9642893 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -136,22 +136,9 @@ if ($perform_event_response) { echo "Only stdin/stdout commands are supported"; } else { - $return_val = array(); - $return_val['correct'] = false; +html_debug("ssh pandora_exec_proxy@" . $server_data['ip_address'] . " \"" . $command . " 2>&1\"", true); + $exec_val = system("ssh pandora_exec_proxy@" . $server_data['ip_address'] . " \"" . io_safe_output($command) . " 2>&1\"", $ret_val); - $exec_val = system("ssh pandora_exec_proxy@" . $server_data['ip_address'] . " \"" . $command . " 2>&1\"", $ret_val); - - if ($ret_val != 0) { - $return_val['message'] = "Conection error"; - } - else { - if ($exec_val == "root") { - $return_val['correct'] = true; - } - else { - $return_val['message'] = "User must be pandora_exec_proxy"; - } - } ob_clean(); echo $exec_val;