diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2019-08-22 13:43:24 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2019-08-22 13:43:24 +0200 |
commit | 0b97d9697a51f2ddca71b57bd4af57e67f9d0cd4 (patch) | |
tree | 0bccb6c52a5e74b1842c263f5355d13ccc07e0b8 /admin/WebConsole/includes | |
parent | e3b1b1e2a90629eff6d42d0004a8c1b9ae2f1cda (diff) |
#834: Setting a default value for some PHP variables to avoid warnings.
Diffstat (limited to 'admin/WebConsole/includes')
-rw-r--r-- | admin/WebConsole/includes/restfunctions.php | 10 | ||||
-rw-r--r-- | admin/WebConsole/includes/tftputils.php | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php index 7f710adf..14cace17 100644 --- a/admin/WebConsole/includes/restfunctions.php +++ b/admin/WebConsole/includes/restfunctions.php @@ -98,14 +98,18 @@ function clients($case, $ips) { break; case 2: $type = GET; + $data = null; break; } $result = common_request(OG_REST_CMD_CLIENTS, $type, $data); - foreach ($result[OG_REST_PARAM_CLIENTS] as $client) { - $trama_notificacion = $trama_notificacion.$client[OG_REST_PARAM_ADDR].'/'. - $client[OG_REST_PARAM_STATE].';'; + $trama_notificacion = ""; + if (isset($result[OG_REST_PARAM_CLIENTS])) { + foreach ($result[OG_REST_PARAM_CLIENTS] as $client) { + $trama_notificacion .= $client[OG_REST_PARAM_ADDR].'/'. + $client[OG_REST_PARAM_STATE].';'; + } } return $trama_notificacion; diff --git a/admin/WebConsole/includes/tftputils.php b/admin/WebConsole/includes/tftputils.php index 87da6287..aca054a5 100644 --- a/admin/WebConsole/includes/tftputils.php +++ b/admin/WebConsole/includes/tftputils.php @@ -98,7 +98,7 @@ function createBootMode ($cmd, $bootopt, $hostname, $lang) { $description=exec("awk 'NR==1 {print $2}' ".PXEDIRBIOS."/templates/".$bootopt); if ($description === "") $description=exec("awk 'NR==1 {print $2}' ".PXEDIRUEFI."/templates/".$bootopt); // Llamamos al script setclientmode - shell_exec("export LANG=$lang $acceso; /opt/opengnsys/bin/setclientmode $description $hostname PERM $file"); + shell_exec("export LANG=$lang $acceso; /opt/opengnsys/bin/setclientmode $description $hostname PERM"); } |