summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/includes/restfunctions.php
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2021-02-15 13:15:57 +0000
committerOpenGnSys Support Team <soporte-og@soleta.eu>2021-02-15 16:41:08 +0100
commit3d1c5b579e95ed20ed7552f404eecd0d7763d112 (patch)
tree2b63f8b423792aeb045a1efed349aeb12a5144f2 /admin/WebConsole/includes/restfunctions.php
parentd3c553830b9f964d2d402932b5722ff7ea952384 (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/includes/restfunctions.php')
-rw-r--r--admin/WebConsole/includes/restfunctions.php13
1 files changed, 2 insertions, 11 deletions
diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php
index 138c2730..b0ae084e 100644
--- a/admin/WebConsole/includes/restfunctions.php
+++ b/admin/WebConsole/includes/restfunctions.php
@@ -36,7 +36,6 @@ define('OG_REST_CMD_MODE', 'mode');
define('OG_REST_PARAM_CLIENTS', 'clients');
define('OG_REST_PARAM_ADDR', 'addr');
define('OG_REST_PARAM_MAC', 'mac');
-define('OG_REST_PARAM_NETMASK', 'netmask');
define('OG_REST_PARAM_DISK', 'disk');
define('OG_REST_PARAM_PART', 'partition');
define('OG_REST_PARAM_RUN', 'run');
@@ -189,7 +188,7 @@ function clients($case, $ips) {
return $trama_notificacion;
}
-function wol($type_wol, $macs, $ips, $netmasks) {
+function wol($type_wol, $ips) {
switch ($type_wol) {
default:
@@ -200,16 +199,8 @@ function wol($type_wol, $macs, $ips, $netmasks) {
$wol = 'unicast';
}
- $clients = array();
-
- for($i=0; $i<count($macs); $i++) {
- $clients[] = array(OG_REST_PARAM_ADDR => $ips[$i],
- OG_REST_PARAM_MAC => $macs[$i],
- OG_REST_PARAM_NETMASK => $netmasks[$i]);
- }
-
$data = array(OG_REST_PARAM_TYPE => $wol,
- OG_REST_PARAM_CLIENTS => $clients);
+ OG_REST_PARAM_CLIENTS => $ips);
common_request(OG_REST_CMD_WOL, POST, $data);
}