diff options
author | ramon <ramongomez@us.es> | 2011-12-22 13:38:11 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2011-12-22 13:38:11 +0000 |
commit | c3c7cb3ae6f6600223111a572050f34f2df6fa71 (patch) | |
tree | 96fce1db6bf64fee2845d3a48abcbe07d9937562 /admin/WebConsole/gestores/gestor_pxe_grub4dos.php | |
parent | 4caea352de0d0a19d4e0a2e2dd04980dd28e6be0 (diff) |
Congelar versión 1.0.2 en tags/opengnsys-1.0.2 (modifica #446).opengnsys-1.0.2
git-svn-id: https://opengnsys.es/svn/tags/opengnsys-1.0.2@2405 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/WebConsole/gestores/gestor_pxe_grub4dos.php')
-rw-r--r-- | admin/WebConsole/gestores/gestor_pxe_grub4dos.php | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/admin/WebConsole/gestores/gestor_pxe_grub4dos.php b/admin/WebConsole/gestores/gestor_pxe_grub4dos.php index 790cdf6e..b293ee7d 100644 --- a/admin/WebConsole/gestores/gestor_pxe_grub4dos.php +++ b/admin/WebConsole/gestores/gestor_pxe_grub4dos.php @@ -52,11 +52,13 @@ $cmd->texto="update ordenadores set arranque=@optboot where nombreordenador=@hos $cmd->Ejecutar(); $cmd->texto="SELECT ordenadores.ip AS ip, ordenadores.mac AS mac, - ordenadores.netiface AS netiface, aulas.netmask AS netmask, aulas.router AS router, - repositorios.ip AS iprepo FROM ordenadores - join aulas on ordenadores.idaula=aulas.idaula - join repositorios on ordenadores.idrepositorio=repositorios.idrepositorio - where ordenadores.nombreordenador='". $hostname ."'"; + ordenadores.netiface AS netiface, aulas.netmask AS netmask, + aulas.router AS router, repositorios.ip AS iprepo, + aulas.nombreaula AS grupo + FROM ordenadores + JOIN aulas ON ordenadores.idaula=aulas.idaula + JOIN repositorios ON ordenadores.idrepositorio=repositorios.idrepositorio + WHERE ordenadores.nombreordenador='". $hostname ."'"; $rs=new Recordset; $rs->Comando=&$cmd; if (!$rs->Abrir()) echo "error"; @@ -67,16 +69,26 @@ $rs->Primero(); $router=$rs->campos["router"]; $netmask=$rs->campos["netmask"]; $repo=$rs->campos["iprepo"]; - $infohost="ip=" - . $ip . ":" - . $repo .":" - . $router . ":" - . $netmask .":" - . $hostname .":" - . $netiface . ":none"; # repo=" - #. $repo; + $group=cleanString($rs->campos["grupo"]); $rs->Cerrar(); +$cmd->texto="SELECT ipserveradm FROM entornos"; +$rs=new Recordset; +$rs->Comando=&$cmd; +if (!$rs->Abrir()) echo "error"; + +$rs->Primero(); + $server=$rs->campos["ipserveradm"]; +$rs->Cerrar(); + +$infohost="'ip=$ip:$server:$router:$netmask:$hostname:$netiface:none" . + " group=$group" . + " ogrepo=$repo" . + " oglive=$repo" . + " oglog=$server" . + " ogshare=$server'"; + + ###################obtenemos las variables de red del aula. #02.1 obtenemos nombre fichero mac @@ -106,4 +118,11 @@ function netmask2cidr($netmask) { return $cidr; } -?>
\ No newline at end of file +// Sustituye espacio por "_" y quita acentos y tildes. +function cleanString ($cadena) { + $patron = array ('/ /','/á/','/é/','/í/','/ó/','/ú/','/ñ/','/Á/','/É/','/Í/','/Ó/','/Ú/','/Ñ/'); + $reemplazo = array ('_','a','e','i','o','u','n','A','E','I','O','U','N'); + return preg_replace($patron,$reemplazo,$cadena); +} + +?> |