summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/comandos
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2019-05-30 17:05:53 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2019-05-30 17:17:39 +0200
commitda462c863441073ca429811bd1d023e929d611db (patch)
tree108f10a863b973f105dae3b32f79ee07a0980f6b /admin/WebConsole/comandos
parent251bb977c45e89ff7bbf0d7c89ca1fb5a7296e69 (diff)
#915 adapt web console to use new reboot command in REST API
SocketHidra reboot has been replaced by POST /reboot.
Diffstat (limited to 'admin/WebConsole/comandos')
-rw-r--r--admin/WebConsole/comandos/gestores/gestor_Comandos.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/admin/WebConsole/comandos/gestores/gestor_Comandos.php b/admin/WebConsole/comandos/gestores/gestor_Comandos.php
index 84d3520c..2ea51f86 100644
--- a/admin/WebConsole/comandos/gestores/gestor_Comandos.php
+++ b/admin/WebConsole/comandos/gestores/gestor_Comandos.php
@@ -25,6 +25,7 @@ define('OG_CMD_ID_WAKEUP', 1);
define('OG_CMD_ID_SENDMESSAGE', 16);
define('OG_CMD_ID_SESSION', 9);
define('OG_CMD_ID_POWEROFF', 2);
+define('OG_CMD_ID_REBOOT', 5);
// Recoge parametros de seguimiento
$sw_ejya="";
@@ -130,6 +131,9 @@ switch ($idcomando) {
break;
case OG_CMD_ID_POWEROFF:
poweroff($cadenaip);
+ break;
+ case OG_CMD_ID_REBOOT:
+ reboot($cadenaip);
}
if($ambito==0){ // Ambito restringido a un subconjuto de ordenadores con formato (idordenador1,idordenador2,etc)
@@ -189,7 +193,8 @@ if($sw_ejya=='on' || $sw_ejprg=="on" ){
if ($idcomando != OG_CMD_ID_SENDMESSAGE &&
$idcomando != OG_CMD_ID_WAKEUP &&
$idcomando != OG_CMD_ID_SESSION &&
- $idcomando != OG_CMD_ID_POWEROFF) {
+ $idcomando != OG_CMD_ID_POWEROFF &&
+ $idcomando != OG_CMD_ID_REBOOT) {
// Envío al servidor
$shidra=new SockHidra($servidorhidra,$hidraport);
if ($shidra->conectar()){ // Se ha establecido la conexión con el servidor hidra