summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/includes/tftputils.php
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-08-13 14:02:37 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-08-14 12:59:17 +0200
commit3aadac3b9b8412ac91095ef8586605fe3da0d8b7 (patch)
tree4e8a4f7cf419b316eed79da8c695c20b61e397dc /admin/WebConsole/includes/tftputils.php
parent179e1b1d53ef3d6c964af445c66d423e56cf76c1 (diff)
#980 Update POST /mode to the new ogServer API
This patch selects the machines whose modes need to be changed using the client's IP rather than their scope names.
Diffstat (limited to 'admin/WebConsole/includes/tftputils.php')
-rw-r--r--admin/WebConsole/includes/tftputils.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/admin/WebConsole/includes/tftputils.php b/admin/WebConsole/includes/tftputils.php
index d5d857a2..5c97867c 100644
--- a/admin/WebConsole/includes/tftputils.php
+++ b/admin/WebConsole/includes/tftputils.php
@@ -72,7 +72,7 @@ function clientKernelVersion () {
* @author Irina Gómez - ETSII Universidad de Sevilla
* @date 2019-03-14
*/
-function createBootMode ($cmd, $bootopt, $hostname, $lang) {
+function createBootMode ($cmd, $bootopt, $ip, $lang) {
global $cadenaconexion;
// Datos para el acceso a mysql
@@ -98,7 +98,7 @@ function createBootMode ($cmd, $bootopt, $hostname, $lang) {
// Descripción plantilla PXE
$description=exec("awk 'NR==1 {print $2}' ".PXEDIRBIOS."/templates/".$bootopt);
if ($description === "") $description=exec("awk 'NR==1 {print $2}' ".PXEDIRUEFI."/templates/".$bootopt);
- set_mode($hostname, $bootopt);
+ set_mode($ip, $bootopt);
}
@@ -142,7 +142,7 @@ function updateBootMode ($cmd, $idfield, $idvalue, $lang) {
$idvalue = mysqli_real_escape_string ($cmd->Conexion->controlador, $idvalue);
// Obtener los ordenadores asociados al aula y sus plantillas de arranque.
- $cmd->texto = "SELECT nombreordenador AS hostname, arranque AS bootopt
+ $cmd->texto = "SELECT ip, arranque AS bootopt
FROM ordenadores
WHERE $idfield=$idvalue";
$rs = new Recordset;
@@ -150,12 +150,12 @@ function updateBootMode ($cmd, $idfield, $idvalue, $lang) {
if ($rs->Abrir()) {
$rs->Primero();
while (! $rs->EOF) {
- $hostname=$rs->campos["hostname"];
+ $ip = $rs->campos["ip"];
if (! empty ($hostname)) {
$bootopt=$rs->campos["bootopt"];
// Volver a crear el fichero de arranque.
- createBootMode ($cmd, $bootopt, $hostname, $lang);
+ createBootMode ($cmd, $bootopt, $ip, $lang);
}
$rs->Siguiente();
}