diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2019-05-30 12:38:51 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2019-05-30 17:17:39 +0200 |
commit | 251bb977c45e89ff7bbf0d7c89ca1fb5a7296e69 (patch) | |
tree | 72343fb9274ae274c1099b49a476653caddd6ab9 /admin/WebConsole/includes/restfunctions.php | |
parent | 34ba8687b7ce306363e15a2d0c9c93951f5e8d96 (diff) |
#915 adapt web console to use new poweroff command in REST API
SocketHidra poweroff has been replaced by POST /poweroff.
Diffstat (limited to 'admin/WebConsole/includes/restfunctions.php')
-rw-r--r-- | admin/WebConsole/includes/restfunctions.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php index 59f9bb98..ea4ad8bd 100644 --- a/admin/WebConsole/includes/restfunctions.php +++ b/admin/WebConsole/includes/restfunctions.php @@ -11,6 +11,7 @@ define('OG_REST_CMD_WOL', 'wol'); define('OG_REST_CMD_SESSION', 'session'); define('OG_REST_CMD_RUN', 'shell/run'); define('OG_REST_CMD_OUTPUT', 'shell/output'); +define('OG_REST_CMD_POWEROFF', 'poweroff'); define('OG_REST_PARAM_CLIENTS', 'clients'); define('OG_REST_PARAM_ADDR', 'addr'); @@ -135,6 +136,15 @@ function session($string_ips, $params) { common_request(OG_REST_CMD_SESSION, POST, $data); } +function poweroff($string_ips) { + + $ips = explode(';',$string_ips); + + $data = array(OG_REST_PARAM_CLIENTS => $ips); + + common_request(OG_REST_CMD_POWEROFF, POST, $data); +} + /* * @function multiRequest. * @param URLs array (may include header and POST data), cURL options array. |