diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2021-02-15 13:15:57 +0000 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2021-02-15 16:41:08 +0100 |
commit | 3d1c5b579e95ed20ed7552f404eecd0d7763d112 (patch) | |
tree | 2b63f8b423792aeb045a1efed349aeb12a5144f2 /admin/WebConsole/comandos/gestores/gestor_Comandos.php | |
parent | d3c553830b9f964d2d402932b5722ff7ea952384 (diff) |
#990 restfunctions: wol: require clients and wol_type params only
Webconsole is directly querying the database to build the payload for
requesting the ogServer a Wake On Lan.
ogServer is expected to query the database for the netmask and mac
parameters. Do not require the client request to have such parameters.
Adjust calls to the wol php method by other OpenGnsys components.
Fixes: a35b7c4 ("#990 Use client broadcast address on WoL")
Diffstat (limited to 'admin/WebConsole/comandos/gestores/gestor_Comandos.php')
-rw-r--r-- | admin/WebConsole/comandos/gestores/gestor_Comandos.php | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/admin/WebConsole/comandos/gestores/gestor_Comandos.php b/admin/WebConsole/comandos/gestores/gestor_Comandos.php index a90cde56..f8b283d4 100644 --- a/admin/WebConsole/comandos/gestores/gestor_Comandos.php +++ b/admin/WebConsole/comandos/gestores/gestor_Comandos.php @@ -48,8 +48,7 @@ function clean_shell_params($cmd_id, $params) { return $params; } -function run_command($idcomando, $cadenaip, $cadenamac, $netmasks_string, - $atributos) { +function run_command($idcomando, $cadenaip, $cadenamac, $atributos) { global $cmd; switch ($idcomando) { case OG_CMD_ID_WAKEUP: @@ -163,14 +162,12 @@ $cadenaid=""; $cadenaip=""; $cadenamac=""; $cadenaoga=""; // Clave de acceso a la API REST de OGAgent. -$netmasks_string=""; if(!empty($filtro)){ // Ambito restringido a un subconjuto de ordenadores if(substr($filtro,strlen($cadenaid)-1,1)==";") // Si el último caracter es una coma $filtro=substr($filtro,0,strlen($filtro)-1); // Quita la coma } RecopilaIpesMacs($cmd,$ambito,$idambito,$filtro); -get_netmasks($cmd, $cadenamac, $netmasks_string); /*-------------------------------------------------------------------------------------------------------------------- Creación de parametros para sentencias SQL @@ -269,7 +266,7 @@ if($sw_ejya=='on' || $sw_ejprg=="on" ){ $when['map_am_pm'], $when['map_minute']); } else { - run_command($idcomando, $cadenaip, $cadenamac, $netmasks_string, $atributos); + run_command($idcomando, $cadenaip, $cadenamac, $atributos); } // En agente nuevo devuelvo siempre correcto |