From 3d1c5b579e95ed20ed7552f404eecd0d7763d112 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Mon, 15 Feb 2021 13:15:57 +0000 Subject: #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") --- admin/WebConsole/comandos/gestores/gestor_Comandos.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'admin/WebConsole/comandos/gestores/gestor_Comandos.php') 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 -- cgit v1.2.3-18-g5258