summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-07-31 12:58:43 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-07-31 14:22:03 +0200
commitfe3a2548240d04f2fa3e47f334ee55e277057e07 (patch)
tree128b7e1484fc8473a1cb844b022f776cd9fe301a
parentbb992f97f3c29373cc109efa0b974accf682c47a (diff)
#990 Fix WOL call for RemotePC
This patch fixes the call to the WOL rest function by adapting it to the new API.
-rw-r--r--admin/WebConsole/rest/remotepc.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/admin/WebConsole/rest/remotepc.php b/admin/WebConsole/rest/remotepc.php
index 4b8270aa..e11f8870 100644
--- a/admin/WebConsole/rest/remotepc.php
+++ b/admin/WebConsole/rest/remotepc.php
@@ -83,7 +83,7 @@ $app->post('/ous/:ouid/images/:imageid/reserve(/)', 'validateApiKey',
// Choose older not-reserved client with image installed and get ogAdmServer data.
$cmd->texto = <<<EOD
SELECT adm.idusuario, ordenadores.idordenador, ordenadores.nombreordenador, ordenadores.ip,
- ordenadores.mac, ordenadores.agentkey, par.numdisk, par.numpar,
+ ordenadores.mac, ordenadores.mascara, ordenadores.agentkey, par.numdisk, par.numpar,
aulas.idaula, aulas.idcentro, repo.ip AS repoip, repo.apikey AS repokey
FROM ordenadores
JOIN aulas USING(idaula)
@@ -111,6 +111,7 @@ EOD;
$clntname = $rs->campos["nombreordenador"];
$clntip = $rs->campos["ip"];
$clntmac = $rs->campos["mac"];
+ $clntnetmask = $rs->campos["mascara"];
$agentkey = $rs->campos["agentkey"];
$disk = $rs->campos["numdisk"];
$part = $rs->campos["numpar"];
@@ -128,7 +129,7 @@ EOD;
// TODO: if client is busy?????
if ($app->settings['debug'])
writeRemotepcLog($app->request()->getResourceUri(). ": Send boot command through ogAdmServer: iph=$clntip,mac=$clntmac.");
- wol(1, [$clntmac], [$clntip]);
+ wol(1, [$clntmac], [$clntip], [$clntnetmask]);
// Send WOL command to client repository.
$repo[$repoip]['url'] = "https://$repoip/opengnsys/rest/repository/poweron";
$repo[$repoip]['header'] = Array("Authorization: ".$repokey);