From b9d2bd338f68aace2eb9e999896a787014ac7e46 Mon Sep 17 00:00:00 2001 From: Tarik Gasmi Date: Thu, 7 Jun 2007 17:49:06 +0000 Subject: Aktuelle Version LDAP-Site-Mngmt Webinterface git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1156 95ad53e4-c205-0410-b2fa-d234c58c8868 --- .../webinterface/computers/computers_menu.php | 155 +-------- .../webinterface/computers/dhcphost.dwt | 54 +-- .../webinterface/computers/dhcphost.php | 134 ++++---- .../webinterface/computers/dhcphost_change.php | 56 +-- ldap-site-mngmt/webinterface/computers/host.dwt | 317 +---------------- ldap-site-mngmt/webinterface/computers/host.php | 1 + .../webinterface/computers/host_change.php | 12 +- ldap-site-mngmt/webinterface/computers/hwhost.dwt | 16 +- ldap-site-mngmt/webinterface/computers/hwhost.php | 1 + ldap-site-mngmt/webinterface/computers/menu.dwt | 11 - .../webinterface/computers/menuentry.dwt | 2 +- .../webinterface/computers/new_host.dwt | 25 +- .../webinterface/computers/new_host.php | 3 - ldap-site-mngmt/webinterface/computers/pxe.dwt | 287 ++-------------- ldap-site-mngmt/webinterface/computers/pxe.php | 72 +--- ldap-site-mngmt/webinterface/computers/pxe_add.php | 13 +- .../webinterface/computers/pxe_bootmenue.dwt | 176 ++++++++++ .../webinterface/computers/pxe_bootmenue.php | 199 +++++++++++ .../webinterface/computers/pxe_change.php | 95 +---- .../webinterface/computers/pxe_copy.php | 6 +- .../webinterface/computers/pxe_globals.dwt | 128 +++++++ .../webinterface/computers/pxe_globals.php | 218 ++++++++++++ .../webinterface/computers/pxe_globals_change.php | 126 +++++++ .../webinterface/computers/pxe_wochenplan.php | 262 ++++++++++++++ ldap-site-mngmt/webinterface/computers/rbshost.dwt | 382 +++++++++++++++++++++ ldap-site-mngmt/webinterface/computers/rbshost.php | 248 +++++++++++++ .../webinterface/computers/rbshost_change.php | 95 +++++ ldap-site-mngmt/webinterface/computers/showpxe.dwt | 57 +++ ldap-site-mngmt/webinterface/computers/showpxe.php | 95 +++++ 29 files changed, 2141 insertions(+), 1105 deletions(-) create mode 100644 ldap-site-mngmt/webinterface/computers/pxe_bootmenue.dwt create mode 100644 ldap-site-mngmt/webinterface/computers/pxe_bootmenue.php create mode 100644 ldap-site-mngmt/webinterface/computers/pxe_globals.dwt create mode 100644 ldap-site-mngmt/webinterface/computers/pxe_globals.php create mode 100644 ldap-site-mngmt/webinterface/computers/pxe_globals_change.php create mode 100644 ldap-site-mngmt/webinterface/computers/pxe_wochenplan.php create mode 100644 ldap-site-mngmt/webinterface/computers/rbshost.dwt create mode 100644 ldap-site-mngmt/webinterface/computers/rbshost.php create mode 100644 ldap-site-mngmt/webinterface/computers/rbshost_change.php create mode 100644 ldap-site-mngmt/webinterface/computers/showpxe.dwt create mode 100644 ldap-site-mngmt/webinterface/computers/showpxe.php diff --git a/ldap-site-mngmt/webinterface/computers/computers_menu.php b/ldap-site-mngmt/webinterface/computers/computers_menu.php index 9b681bee..977c8492 100644 --- a/ldap-site-mngmt/webinterface/computers/computers_menu.php +++ b/ldap-site-mngmt/webinterface/computers/computers_menu.php @@ -25,39 +25,17 @@ function createComputersMenu($rollen , $mnr, $auDN, $sbmnr, $mcnr) { "text" => "Neues PXE Bootmenü", "zugriff" => array("MainAdmin","HostAdmin","DhcpAdmin"))); - # Submenu + # Submenus #$comps = array(); $computers_array = get_hosts($auDN,array("dn","hostname","ou")); #if (count($computers_array) != 0){ for($n=0;$n "mcdef.php?dn=".$machineconfigs[$m]['dn']."&mnr=1&sbmnr=".$n."&mcnr=".$m, - "text" => $machineconfigs[$m]['cn'], - "zugriff" => array("MainAdmin","HostAdmin","DhcpAdmin")); - } - }else{$mcc = array();} - - if (count($pxeconfigs) != 0){ - $pxec = array(); - for ($p=0;$p "pxe.php?dn=".$pxeconfigs[$p]['dn']."&mnr=1&sbmnr=".$n."&mcnr=".$z, - "text" => $pxeconfigs[$p]['cn'], - "zugriff" => array("MainAdmin","HostAdmin","DhcpAdmin")); - } - }else{$pxec = array();} - $comps[] = array("link" => "host.php?dn=".$computers_array[$n]['dn']."&sbmnr=".$n, "text" => $computers_array[$n]['hostname'], "zugriff" => array("MainAdmin","HostAdmin","DhcpAdmin")); # print_r($comps); echo "
"; - $mccpxec = array_merge($mcc,$pxec); - $compmc[] = $mccpxec; + } #} @@ -67,39 +45,16 @@ function createComputersMenu($rollen , $mnr, $auDN, $sbmnr, $mcnr) { $groups_array = get_groups($auDN,array("dn","cn")); for($n=0;$n "mcdef.php?dn=".$machineconfigs[$m]['dn']."&mnr=2&sbmnr=".$n."&mcnr=".$m, - "text" => $machineconfigs[$m]['cn'], - "zugriff" => array("MainAdmin","HostAdmin","DhcpAdmin")); - } - }else{$mcg = array();} - if (count($pxeconfigs) != 0){ - $pxeg = array(); - for ($p=0;$p "pxe.php?dn=".$pxeconfigs[$p]['dn']."&mnr=2&sbmnr=".$n."&mcnr=".$z, - "text" => $pxeconfigs[$p]['cn'], - "zugriff" => array("MainAdmin","HostAdmin","DhcpAdmin")); - } - }else{$pxeg = array();} $groups = array(); $groups[] = array("link" => "group.php?dn=".$groups_array[$n]['dn']."&sbmnr=".$n, "text" => $groups_array[$n]['cn'], "zugriff" => array("MainAdmin","HostAdmin","DhcpAdmin")); - $mcgpxeg = array_merge($mcg,$pxeg); - $groupmc[] = $mcgpxeg; } $groups[] = array("link" => "new_group.php?sbmnr=".$n, "text" => "Neue Gruppe", "zugriff" => array("MainAdmin","HostAdmin")); - # print_r($compmc); echo "

"; - # print_r($groupmc); echo "

"; # default machine-configs $mcdef_array = get_machineconfigs("cn=computers,".$auDN,array("dn","cn","timerange")); @@ -116,17 +71,9 @@ function createComputersMenu($rollen , $mnr, $auDN, $sbmnr, $mcnr) { array()); #echo "submenu: ";print_r($submenu);echo "

"; - $subsubmenu = array(array(array(array())), - $compmc, - $groupmc, - array(array(array())), - array(array(array()))); - #echo "subsubmenu: ";print_r($subsubmenu);echo "

"; - - # Zusammenstellen der Menuleiste + # Zusammenstellen der Menuleiste $template->define_dynamic("Hauptmenu", "Menu"); $template->define_dynamic("Submenu", "Menu"); - $template->define_dynamic("Subsubmenu", "Menu"); $i=0; $maxmenu = count($hauptmenu); @@ -144,105 +91,10 @@ function createComputersMenu($rollen , $mnr, $auDN, $sbmnr, $mcnr) { #echo "_"; print_r($maxsub); echo "_"; if($maxsub > 0){ foreach($submenu[$mnr] as $item2) { - - $template->clear_parse("SUBSUBMENU_LIST"); - if($item2['zugriff'] === "alle" || vergleicheArrays($rollen, $item2['zugriff'])) { - ######################################################################## - # SUBSUBMENU - $subsubempty = 0; - $k=0; - $maxsubsub = count($subsubmenu[$mnr][$sbmnr]); - #print_r($maxsubsub); - if ($maxsubsub > 0){ - if($sbmnr >= 0){ - foreach($subsubmenu[$mnr][$sbmnr] as $item3) { - - if($item3['zugriff'] === "alle" || vergleicheArrays($rollen, $item3['zugriff'])) { - - if($j != $sbmnr || $i != $mnr){ - - $template->assign(array("SUBSUB" => "")); - # "LINK_S" => "", - # "TEXT_S" => "")); - $template->parse("SUBSUBMENU_LIST", ".Subsubmenu"); - $template->clear_dynamic("Subsubmenu"); - $template->clear_parse("SUBSUBMENU_LIST"); - } - else{ - if ($k==0) { - if ($mcnr==0) { - if($maxsubsub == 1){$zwisch="branchbottom2";} - else {$zwisch="branch2";} - $lastaktive=true; - $farb="#505050"; - } - else{ - if($maxsubsub == 1){$zwisch="branchbottom2";} - else {$zwisch="branch2";} - $farb="#A0A0A0"; - $lastaktive=false; - } - } - else { - if ($mcnr==$k) { - if($maxsubsub == $k+1){$zwisch="branchbottom2";} - else {$zwisch="branch2";} - $lastaktive=true; - $farb="#505050"; - } - else { - $farb="#A0A0A0"; - if($maxsubsub == $k+1){$zwisch="branchbottom2";} - else {$zwisch="branch2";} - # if ($lastaktive) {$zwisch="branch";} - # else {$zwisch="branch";} - $lastaktive=false; - } - } - $htmlcode= " - - - - -   -   - - - ".$item3['text']." -   - - "; - $template->assign(array("SUBSUB" => $htmlcode)); - $template->assign(array("FARBE_MC" => $farb)); - $template->parse("SUBSUBMENU_LIST", ".Subsubmenu"); - $template->clear_dynamic("Subsubmenu"); - - } - } - else { - $subsubempty++; - } - $k=$k+1; - } - } - - if($subsubempty == count($subsubmenu[$mnr][$sbmnr])) { - $template->assign(array("SUBSUB" => "")); - # "LINK_S" => "", - # "TEXT_S" => "")); - $template->parse("SUBSUBMENU_LIST", ".Subsubmenu"); - $template->clear_dynamic("Subsubmenu"); - $template->clear_parse("SUBSUBMENU_LIST"); - } - - } - $template->assign(array("SUBSUB" => "")); - # SUBSUBMENU - ######################################################################## if($i != $mnr){ $template->assign(array("SUB" => "")); # "LINK_S" => "", @@ -320,7 +172,6 @@ function createComputersMenu($rollen , $mnr, $auDN, $sbmnr, $mcnr) { $template->clear_dynamic("Submenu"); } - $template->assign(array("SUBSUB" => "")); # SUBMENU ##################################################################### diff --git a/ldap-site-mngmt/webinterface/computers/dhcphost.dwt b/ldap-site-mngmt/webinterface/computers/dhcphost.dwt index 8ab5c7af..a9d18707 100644 --- a/ldap-site-mngmt/webinterface/computers/dhcphost.dwt +++ b/ldap-site-mngmt/webinterface/computers/dhcphost.dwt @@ -1,46 +1,34 @@ - - - - - - + - + + - + + + +

Rechner   {HOSTNAME}

{HOSTLINK} Allgemein

DHCP/RBS

DHCP

{RBSLINK} RBS/PXE

{HWLINK} Hardware

 
+

DHCP Setup - Rechner   {HOSTNAME}

- + - - - + + {DHCPCONT} + {HOST_DHCPOPT} @@ -50,23 +38,7 @@ - - + diff --git a/ldap-site-mngmt/webinterface/computers/dhcphost.php b/ldap-site-mngmt/webinterface/computers/dhcphost.php index 6a934202..3eb07d19 100644 --- a/ldap-site-mngmt/webinterface/computers/dhcphost.php +++ b/ldap-site-mngmt/webinterface/computers/dhcphost.php @@ -41,20 +41,42 @@ $rbsDN = $host['hlprbservice']; $rbs_dhcpopt = ""; $host_dhcpopt = ""; +$dhcp_selectbox = ""; + +########################################################## +# DHCP Setup # DHCP Daten if ($dhcphlpcont == ""){ - $dhcp = "Rechner ist in keinem DHCP Dienst angemeldet
+ $objecttype = "nodhcp"; + + # DHCP Selectbox + $altdhcp = alternative_dhcpobjects($objecttype,$objectDN,$hostip[0]); + $dhcp_selectbox .= ""; + + $dhcp = " + ".$dhcp_selectbox; + $rbs = ""; }else{ - # Subnet? + # Host in Service oder Subnet? $objecttype = "service"; $dhcp = ""; $ocarray = get_node_data($dhcphlpcont,array("objectclass","dhcphlpcont")); @@ -71,9 +93,26 @@ if ($dhcphlpcont == ""){ $exp1 = explode(',',$dhcphlpcont); $expdhcp = explode('=',$exp1[0]); $dhcpserv = $expdhcp[1]; $expdhcpau = explode('=',$exp1[2]); $dhcpau = $expdhcpau[1]; - $dhcp .= "Service ".$dhcpserv." / AU ".$dhcpau."
+ + # DHCP Selectbox + $altdhcp = alternative_dhcpobjects($objecttype,$objectDN,$hostip[0]); + $dhcp_selectbox .= ""; + + $dhcp .= " + ".$dhcp_selectbox; $fixedaddselopt = ""; @@ -91,7 +130,7 @@ if ($dhcphlpcont == ""){ "; break; case "hostname": - $fixedaddress = "".$host['hostname']."
(Fixe IP Adresse über Hostnamen aufgelöst)"; + $fixedaddress = "".$host['hostname']."
(Fixe IP Adresse über DNS aufgelöst)"; if ( $hostip[0] != "" ){ $fixedaddselopt .= ""; } @@ -115,59 +154,6 @@ if ($dhcphlpcont == ""){ "; - - ########################################################### - # RBS Setup - $rbs_selectbox = ""; - $rbs_dhcpopt = ""; - $altrbs = alternative_rbservices($rbsDN); - - - $rbs_selectbox .= ""; - - # RBS Daten - if ($rbsDN == ""){ - - $rbs = " - - ".$rbs_selectbox; - }else{ - - $rbs = ""; - $rbsdata = get_node_data($rbsDN,array("tftpserverip")); - #print_r($rbsdata); echo "
"; - $exp2 = explode(',',$host['hlprbservice']); - $exprbs = explode('=',$exp2[0]); $rbserv = $exprbs[1]; - $exprbsau = explode('=',$exp2[2]); $rbsau = $exprbsau[1]; - $rbs .= " - - ".$rbs_selectbox; - - $rbs_dhcpopt = " - - - - - - - - "; - } } @@ -181,12 +167,11 @@ $template->assign(array("HOSTDN" => $hostDN, "OLDFIXADD" => $host['dhcpoptfixed-address'], "OLDRBS" => $rbsDN, "DHCPCONT" => $dhcp, - "HOST_DHCPOPT" => $host_dhcpopt, - "RBS" => $rbs, - "RBS_DHCPOPT" => $rbs_dhcpopt, + "HOST_DHCPOPT" => $host_dhcpopt, "NEXTSERVER" => $host['dhcpoptnext-server'], "FILENAME" => $host['dhcpoptfilename'], "HOSTLINK" => "", + "RBSLINK" => "", "HWLINK" => "", "AUDN" => $auDN, "SBMNR" => $sbmnr)); @@ -195,23 +180,22 @@ $template->assign(array("HOSTDN" => $hostDN, ########################################################## # DHCP Setup +/*$dhcp_selectbox = ""; $altdhcp = alternative_dhcpobjects($objecttype,$objectDN,$hostip[0]); -#echo "

";print_r($altdhcp); +echo "

";print_r($altdhcp); + +$dhcp_selectbox .= "
";*/ ########################################################### # RBS Setup diff --git a/ldap-site-mngmt/webinterface/computers/dhcphost_change.php b/ldap-site-mngmt/webinterface/computers/dhcphost_change.php index 907fae8f..2a78f109 100644 --- a/ldap-site-mngmt/webinterface/computers/dhcphost_change.php +++ b/ldap-site-mngmt/webinterface/computers/dhcphost_change.php @@ -5,20 +5,17 @@ $syntax = new Syntaxcheck; $dhcp = $_POST['dhcpcont']; $olddhcp = $_POST['olddhcp']; + $hostip = $_POST['hostip']; $fixedaddress = $_POST['fixadd']; $oldfixedaddress = $_POST['oldfixadd']; -$rbs = $_POST['rbs']; -$oldrbs = $_POST['oldrbs']; - $hostDN = $_POST['hostdn']; $sbmnr = $_POST['sbmnr']; $dhcp = htmlentities($dhcp); $olddhcp = htmlentities($olddhcp); -$rbs = htmlentities($rbs); -$oldrbs = htmlentities($oldrbs); + /*echo "new dhcp:"; print_r($dhcp); echo "
"; @@ -72,7 +69,7 @@ if ($dhcp != "none" && $dhcp != $olddhcp){ } }else{ $entrydhcp ['dhcphlpcont'] = array(); - if ( $fixedaddress != "" ){ + if ( $oldfixedaddress != "" ){ $entrydhcp ['dhcpoptfixed-address'] = array(); } echo "DHCP delete "; echo "
"; @@ -119,53 +116,6 @@ if ($fixedaddress != "none" && $fixedaddress != $oldfixedaddress){ } -########################################## -# RBS - -if ($rbs != "none" && $rbs != $oldrbs){ - if ($rbs != ""){ - $exp = ldap_explode_dn($rbs, 1); - $rbscn = $exp[0]; - $rbsau = $exp[2]; - - $dhcpdata = get_node_data($rbs,array("tftpserverip","initbootfile")); - $entryrbs ['hlprbservice'] = $rbs; - $entryrbs ['dhcpoptnext-server'] = $dhcpdata['tftpserverip']; - $entryrbs ['dhcpoptfilename'] = $dhcpdata['initbootfile']; - if ($oldrbs != ""){ - echo "RBS replace "; print_r($oldrbs); echo " with "; print_r($entryrbs); echo "
"; - if ($result = ldap_mod_replace($ds,$hostDN,$entryrbs)){ - rbs_adjust_host($hostDN, $rbs); - $mesg = "Remote Boot Service erfolgreich zu ".$rbscn." [Abt.: ".$rbsau."] geändert

"; - }else{ - $mesg = "Fehler beim ändern des Remote Boot Services zu ".$rbscn."!

"; - } - }else{ - echo "RBS add "; print_r($entryrbs); echo "
"; - if ($result = ldap_mod_add($ds,$hostDN,$entryrbs)){ - rbs_adjust_host($hostDN, $rbs); - $mesg = "Remote Boot Service erfolgreich zu ".$rbscn." [Abt.: ".$rbsau."] geändert

"; - }else{ - $mesg = "Fehler beim ändern des Remote Boot Services zu ".$rbscn."!

"; - } - } - }else{ - $entryrbs ['hlprbservice'] = array(); - $entryrbs ['dhcpoptnext-server'] = array(); - $entryrbs ['dhcpoptfilename'] = array(); - echo "RBS delete "; echo "
"; - if ($result = ldap_mod_del($ds,$hostDN,$entryrbs)){ - $mesg = "Rechner erfolgreich aus RBS gelöscht

"; - }else{ - $mesg = "Fehler beim löschen aus RBS!

"; - } - } -} -if ($rbs == "none"){ - echo "RBS none
"; -} - - ##################### $mesg .= "
Sie werden automatisch auf die vorherige Seite zurückgeleitet.
diff --git a/ldap-site-mngmt/webinterface/computers/host.dwt b/ldap-site-mngmt/webinterface/computers/host.dwt index 13d1da11..8eedca62 100644 --- a/ldap-site-mngmt/webinterface/computers/host.dwt +++ b/ldap-site-mngmt/webinterface/computers/host.dwt @@ -1,20 +1,21 @@

DHCP Setup

DHCP Administration - Diensteinbindung, Optionen    
Eingebunden in DHCP Dienst:   - {DHCPCONT}
- -
- - - - - - - - - - {RBS} - - - {RBS_DHCPOPT} - -

PXE/TFTP Setup

 
+ Eingebunden in DHCP Dienst:   + Rechner ist in keinem DHCP Dienst angemeldet
- DHCP Dienst auswählen: "; - $objecttype = "nodhcp"; + DHCP Dienst auswählen:
Sie müssen den Rechner zuerst in einem DHCP Dienst anmelden, bevor Sie ihn einem Remote Boot Dienst zuordnen können
(DHCP Optionen!!).
+ Eingebunden in DHCP Dienst:   + Service ".$dhcpserv." / AU ".$dhcpau."
- DHCP Dienst ändern: "; + DHCP Dienst ändern:
- Remote Boot Dienst:   - Rechner ist in keinem Remote Boot Dienst angemeldet
- RBS auswählen:
Remote Boot Dienst:   - Remote Boot Service ".$rbserv." / AU ".$rbsau."
- TFTP (Boot) Server: ".$rbsdata['tftpserverip']."
- RBS ändern:
DHCP Optionen:
next-server  (TFTP Server):".$host['dhcpoptnext-server']." 
filename  (initiale remote Bootdatei):".$host['dhcpoptfilename']." 
+
- - - - - - + - + + - + + + + - - - - - + - + + - + + + +

Rechner   {HOSTNAME}

Allgemein

{DHCPLINK} DHCP/RBS

{DHCPLINK} DHCP

{RBSLINK} RBS/PXE

{HWLINK} Hardware

 
+ +

Administration Rechner   {HOSTNAME}

@@ -89,7 +90,7 @@ --> - + @@ -100,7 +101,6 @@
- - - - - - - - - - - - - - - - - - - - - - - -
Der Rechner wird komplett gelöscht,
d.h. inklusive aller spezifisch für ihn angelegten @@ -120,302 +120,5 @@

Wochen Übersicht Machine Configs Rechner  {HOSTNAME}  :

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
UhrzeitMontagDienstagMittwochDonnerstagFreitagSamstagSonntag
0       
        
2       
        
4       
        
6       
        
8       
        
10       
        
12       
        
14       
        
16        
        
18       
        
20       
        
22       
        

Legende:

- - - - - - - - - - - - - - - - - - - - -
Machine Config Farbe
Keine Konfiguration    
{MCDESC}     
\ No newline at end of file diff --git a/ldap-site-mngmt/webinterface/computers/host.php b/ldap-site-mngmt/webinterface/computers/host.php index 928df62c..2c522181 100644 --- a/ldap-site-mngmt/webinterface/computers/host.php +++ b/ldap-site-mngmt/webinterface/computers/host.php @@ -61,6 +61,7 @@ $template->assign(array("HOSTDN" => $hostDN, "GRAPHIC" => $host['hw-graphic'], "MONITOR" => $host['hw-monitor'], "DHCPLINK" => "", + "RBSLINK" => "", "HWLINK" => "", "AUDN" => $auDN, "SBMNR" => $sbmnr)); diff --git a/ldap-site-mngmt/webinterface/computers/host_change.php b/ldap-site-mngmt/webinterface/computers/host_change.php index 71c005fa..f54e149d 100644 --- a/ldap-site-mngmt/webinterface/computers/host_change.php +++ b/ldap-site-mngmt/webinterface/computers/host_change.php @@ -146,13 +146,15 @@ if ( $oldmac != "" && $mac != "" && $oldmac != $mac ){ echo "MAC aendern
"; # hier noch Syntaxcheck $entry['hwaddress'] = $mac; + $pxemac = str_replace (":","-",$mac); + $pxeoldmac = str_replace (":","-",$oldmac); $result = ldap_mod_replace($ds,$hostDN,$entry); if($result){ # in den PXEs auch ändern $pxes = get_pxeconfigs($hostDN,array("dn","filename")); if ( count($pxes) != 0 ){ foreach ($pxes as $pxe){ - $entrynewmac ['filename'] = "01-".$mac; + $entrynewmac ['filename'] = "01-".$pxemac; ldap_mod_replace($ds,$pxe['dn'],$entrynewmac); } } @@ -164,15 +166,15 @@ if ( $oldmac != "" && $mac != "" && $oldmac != $mac ){ foreach ($pxes as $pxe){ if (count($pxe['filename']) > 1){ for ($i=0; $i -

Rechner   {HOSTNAME}

{HOSTLINK} Allgemein

{DHCPLINK} DHCP/RBS

{DHCPLINK} DHCP

{RBSLINK} RBS/PXE

Hardware

 
+

Hardware Optionen - Rechner   {HOSTNAME}

diff --git a/ldap-site-mngmt/webinterface/computers/hwhost.php b/ldap-site-mngmt/webinterface/computers/hwhost.php index e401d5ce..7a766266 100644 --- a/ldap-site-mngmt/webinterface/computers/hwhost.php +++ b/ldap-site-mngmt/webinterface/computers/hwhost.php @@ -45,6 +45,7 @@ $template->assign(array("HOSTDN" => $hostDN, "MONITOR" => $host['hw-monitor'], "DHCPLINK" => "", "HOSTLINK" => "", + "RBSLINK" => "", "AUDN" => $auDN, "SBMNR" => $sbmnr)); diff --git a/ldap-site-mngmt/webinterface/computers/menu.dwt b/ldap-site-mngmt/webinterface/computers/menu.dwt index 34e02572..6cb4e63e 100644 --- a/ldap-site-mngmt/webinterface/computers/menu.dwt +++ b/ldap-site-mngmt/webinterface/computers/menu.dwt @@ -14,21 +14,10 @@ - - - {SUB} - - - - {SUBSUB} - - - - diff --git a/ldap-site-mngmt/webinterface/computers/menuentry.dwt b/ldap-site-mngmt/webinterface/computers/menuentry.dwt index 2ad75b93..57c1e0d7 100644 --- a/ldap-site-mngmt/webinterface/computers/menuentry.dwt +++ b/ldap-site-mngmt/webinterface/computers/menuentry.dwt @@ -1,6 +1,6 @@
 
- + diff --git a/ldap-site-mngmt/webinterface/computers/new_host.dwt b/ldap-site-mngmt/webinterface/computers/new_host.dwt index 32366a42..b9bccec4 100644 --- a/ldap-site-mngmt/webinterface/computers/new_host.dwt +++ b/ldap-site-mngmt/webinterface/computers/new_host.dwt @@ -5,9 +5,6 @@ - - - - - - - - - - - - - diff --git a/ldap-site-mngmt/webinterface/computers/new_host.php b/ldap-site-mngmt/webinterface/computers/new_host.php index 9be7b46e..92184308 100644 --- a/ldap-site-mngmt/webinterface/computers/new_host.php +++ b/ldap-site-mngmt/webinterface/computers/new_host.php @@ -41,9 +41,6 @@ $template->assign(array("HOSTNAME" => $hostname, "GRAPHIC" => "", "MONITOR" => "", "AUDN" => $auDN)); - - -# DHCP Stuff ################################################################################### diff --git a/ldap-site-mngmt/webinterface/computers/pxe.dwt b/ldap-site-mngmt/webinterface/computers/pxe.dwt index 0dff23eb..e20f8711 100644 --- a/ldap-site-mngmt/webinterface/computers/pxe.dwt +++ b/ldap-site-mngmt/webinterface/computers/pxe.dwt @@ -1,166 +1,33 @@

Zurück zu  {PXECN}

<< Zurück zu PXE Config  {PXECN}

 

Notwendige Attribute (müssen angegeben werden):

@@ -15,7 +12,7 @@ - + @@ -52,7 +49,7 @@ @@ -83,24 +80,6 @@
AttributNotwendiges Attribut Wert
MAC Adresse (HWAddress) :   - Bsp.: 00-12-03-aa-54-e6   + Bsp.: 00:12:03:aa:54:e6  

Rechner als Host-Objekt in den DHCP Dienst aufnehmen (optional):

- - - - - - - -
DHCP ObjektAuswahl
+ - - - - - - - - - - - - - - + - + + - + - - + + + + + - + + - - - - + - - - - - - - - - - - - - -

PXE Boot Menü   {PXECN}

Klicken Sie auf einen Menüeintrag um zur Detailansicht zu gelangen und den Eintrag bearbeiten zu können
- - - - - - - - - - - - - - - - - - - - - -
#FlagsMenu Label   
{POSITION} {MEDEF} {MEPWD} {MEHIDE} {ANZEIGE}  -
-
- - - - - - - - -

Flags:

-
    -
  • D -> Default Menüeintrag
  • -
  • P -> Passwort geschützt
  • -
  • H -> Hidden
  • -
-

<< Zurück zu Rechner  {NODE}

 

Neuen Menüeintrag anlegen:   

-   zur Eingabemaske  

PXE Konfiguration   {PXECN}

Standard Menüeinträge anlegen:

Allgemein

{OPTLINK} Global Options

{BMLINK} Bootmenue

 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Typ    Position 
Localboot   - Menu Label
 
- Passwort (optional)
 
 
Textzeile    
Leerzeile    
Verweis zu Submenü  Submenü Name
-
Remote Boot Service - -  

Allgemeine Parameter:

Allgemeine Parameter der PXE Konfiguration:

+
@@ -173,26 +40,6 @@ - - - - - - @@ -250,111 +97,19 @@
Remote Boot Dienst:    - {RBS} [Abteilung: {RBSAU}]
- Von diesem Dienst verwendete Bootserver:
- -  NFS Server  {NFS}{NFSROOT}
- -  TFTP Server {TFTP}{TFTPROOT}
- Alternativen Dienst verwenden:
- -
Gültigkeitsdauer
(Time Range(s)):

Zum Löschen einer Time Range
Häkchen setzen 

Globale PXE Parameter:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributWert
Default:   - -   -
Menu Title:   - -   -
Menu Master Passwd:   - -   -
Timeout:   - -   -
No Escape:   - -   -
Prompt:   - -   -
Allow Options:   - -   -
On Error:   - -   -
ON Timeout:   - -   -
File URI:   - tftp://{TFTP}/{TFTPFILE} - -   -

PXE Dateiname:

+

PXE Dateiname:

Achtung: Änderungen hier können zu nicht verwendeten PXE Dateien führen!
Sie sollten hier nur Änderungen vornehmen, wenn der PXE Datei offensichtlich ein falscher Name zugewiesen ist.
Wird z.B. vom betroffenen Rechner die MAC Adresse geändert, so wird dies vom System automatisch an dieser Stelle nachvollzogen. Diese Feld dient daher primär der Kontrolle.
+ @@ -393,13 +148,13 @@ - -

PXE Boot Menü  {PXECN}  kopieren:

+

PXE Boot Menü  {PXECN}  kopieren:

Beachten Sie, dass die Time Ranges des PXE Boot Menüs nicht kopiert werden. Sie müssen diese anschließend neu setzen.
Geben Sie bitte den eindeutigen Namen des neuen PXE Boot Menüs an.
+ @@ -449,17 +204,17 @@ - + - + + "; +}else{ + + ########################################################### + # RBS Setup # Nur wenn angezeigt wenn Host in DHCP + $rbs_selectbox = ""; + $rbs_dhcpopt = ""; + $altrbs = alternative_rbservices($rbsDN); + + + $rbs_selectbox .= ""; + + # RBS Daten + if ($rbsDN == ""){ + + $rbs = " + + ".$rbs_selectbox; + }else{ + + $rbs = ""; + $rbsdata = get_node_data($rbsDN,array("tftpserverip")); + #print_r($rbsdata); echo "
"; + $exp2 = explode(',',$host['hlprbservice']); + $exprbs = explode('=',$exp2[0]); $rbserv = $exprbs[1]; + $exprbsau = explode('=',$exp2[2]); $rbsau = $exprbsau[1]; + $rbs .= " + + + + + + + + + + + + ".$rbs_selectbox." + "; + + $rbs_dhcpopt = " + "; + } + +} + +$template->assign(array("HOSTDN" => $hostDN, + "HOSTNAME" => $host['hostname'], + "DOMAINNAME" => $host['domainname'], + "HWADDRESS" => $host['hwaddress'], + "IPADDRESS" => $hostip[0], + "DESCRIPTION" => $host['description'], + "OLDDHCP" => $objectDN, + "OLDFIXADD" => $host['dhcpoptfixed-address'], + "OLDRBS" => $rbsDN, + "RBS" => $rbs, + "HOSTLINK" => "", + "DHCPLINK" => "", + "HWLINK" => "", + "AUDN" => $auDN, + "SBMNR" => $sbmnr)); + + + + +# Rechnerspezifische PXEs +$hostpxeconfigs = get_pxeconfigs($hostDN, array("dn","cn","description","timerange")); + +$template->assign(array("PXEDN" => "", + "PXECN" => "Keine PXE Config angelegt", + "PXEDESC" => "", + "PXETR" => "",)); +$template->define_dynamic("Rechnerpxes", "Webseite"); + +if (count($hostpxeconfigs) != 0){ + for ($i=0;$i".$hostpxeconfigs[$i]['cn'].""; + + $trange = ""; + if (count($hostpxeconfigs[$i]['timerange']) > 1 ){ + foreach ($hostpxeconfigs[$i]['timerange'] as $tr){ + $exptime = array_merge(explode('_',$tr), array($hostpxeconfigs[$i]['cn'])); + $timeranges[$i][] = $exptime; # Für grafische Wo-Ansicht + if ($exptime[0] == "X"){$exptime[0]="täglich";} + # if ($exptime[1] == "X" && $exptime[2] == "X"){$exptime[1] = ""; $exptime[2]= "";} + $trange .= $exptime[0].", von ".$exptime[1].":00 bis ".$exptime[2].":59
"; + } + }else{ + $exptime = array_merge(explode('_',$hostpxeconfigs[$i]['timerange']), array($hostpxeconfigs[$i]['cn'])); + $timeranges[$i] = $exptime; # Für grafische Wo-Ansicht + if ($exptime[0] == "X"){$exptime[0]="täglich";} + # if ($exptime[1] == "X" && $exptime[2] == "X"){$exptime[1] = ""; $exptime[2]= "";} + $trange .= $exptime[0].", von ".$exptime[1].":00 bis ".$exptime[2].":59"; + } + $template->assign(array("PXEDN" => $hostpxeconfigs[$i]['dn'], + "PXECN" => $pxelink, + "PXEDESC" => $hostpxeconfigs['description'], + "PXETR" => $trange, )); + $template->parse("RECHNERPXES_LIST", ".Rechnerpxes"); + + } +} + +# Default PXEs des RBS +$defaultpxeconfigs = get_pxeconfigs($rbsDN,array("dn","cn","description","timerange","filename")); + +$template->assign(array("DEFPXEDN" => "", + "DEFPXECN" => "Keine PXE Config angelegt", + "DEFPXEDESC" => "", + "DEFPXETR" => "",)); +$template->define_dynamic("Defpxes", "Webseite"); + +if (count($defaultpxeconfigs) != 0){ + for ($i=0;$i".$defaultpxeconfigs[$i]['cn'].""; + + $deftrange = ""; + if (count($defaultpxeconfigs[$i]['timerange']) > 1 ){ + foreach ($defaultpxeconfigs[$i]['timerange'] as $tr){ + $exptime = array_merge(explode('_',$tr), array($defaultpxeconfigs[$i]['cn'])); + $timeranges[$i][] = $exptime; # Für grafische Wo-Ansicht + if ($exptime[0] == "X"){$exptime[0]="täglich";} + # if ($exptime[1] == "X" && $exptime[2] == "X"){$exptime[1] = ""; $exptime[2]= "";} + $deftrange .= $exptime[0].", von ".$exptime[1].":00 bis ".$exptime[2].":59
"; + } + }else{ + $exptime = array_merge(explode('_',$defaultpxeconfigs[$i]['timerange']), array($defaultpxeconfigs[$i]['cn'])); + $timeranges[$i] = $exptime; # Für grafische Wo-Ansicht + if ($exptime[0] == "X"){$exptime[0]="täglich";} + # if ($exptime[1] == "X" && $exptime[2] == "X"){$exptime[1] = ""; $exptime[2]= "";} + $deftrange .= $exptime[0].", von ".$exptime[1].":00 bis ".$exptime[2].":59"; + } + + $template->assign(array("DEFPXEDN" => $defaultpxeconfigs[$i]['dn'], + "DEFPXECN" => $defpxelink, + "DEFPXEDESC" => $defaultpxeconfigs['description'], + "DEFPXETR" => $deftrange, )); + $template->parse("DEFPXES_LIST", ".Defpxes"); + } + } +} + +########################################################## +# PXE Wochenübersicht + +# erst Defaults vom RBS Dienst +for ($i=0; $i 1 ){ + foreach ($defaultpxeconfigs[$i]['timerange'] as $tr){ + $exptime = array_merge(explode('_',$tr),array($defaultpxeconfigs[$i]['cn'])); + $wopldeftranges[$i][] = $exptime; # Für grafische Wo-Ansicht + } + }else{ + $exptime = array_merge(explode('_',$defaultpxeconfigs[$i]['timerange']), array($defaultpxeconfigs[$i]['cn'])); + $wopldeftranges[$i] = $exptime; # Für grafische Wo-Ansicht + } +} +# Diese dann mit möglichen Rechnerspezifischen überschreiben +for ($i=0; $i 1 ){ + foreach ($hostpxeconfigs[$i]['timerange'] as $tr){ + $exptime = array_merge(explode('_',$tr),array($hostpxeconfigs[$i]['cn'])); + $wopltranges[$i][] = $exptime; # Für grafische Wo-Ansicht + } + }else{ + $exptime = array_merge(explode('_',$hostpxeconfigs[$i]['timerange']), array($hostpxeconfigs[$i]['cn'])); + $wopltranges[$i] = $exptime; # Für grafische Wo-Ansicht + } +} + +include("pxe_wochenplan.php"); + +################################################################################### + +include("computers_footer.inc.php"); + +?> \ No newline at end of file diff --git a/ldap-site-mngmt/webinterface/computers/rbshost_change.php b/ldap-site-mngmt/webinterface/computers/rbshost_change.php new file mode 100644 index 00000000..3a812931 --- /dev/null +++ b/ldap-site-mngmt/webinterface/computers/rbshost_change.php @@ -0,0 +1,95 @@ +"; +echo "old dhcp:"; print_r($olddhcp); echo "
"; +echo "new rbs:"; print_r($rbs); echo "
"; +echo "old rbs:"; print_r($oldrbs); echo "
"; +echo "Host DN:"; print_r($hostDN); echo "
"; +echo "submenuNR:"; print_r($sbmnr); echo "

";*/ + + +$seconds = 40; +$url = 'rbshost.php?dn='.$hostDN.'&sbmnr='.$sbmnr; + +echo " + + + AU Management + + + +

PXE Boot Menü  {PXECN}  löschen:

PXE Boot Menü  {PXECN}  löschen:

+ diff --git a/ldap-site-mngmt/webinterface/computers/pxe.php b/ldap-site-mngmt/webinterface/computers/pxe.php index bbc2e5e1..26712077 100644 --- a/ldap-site-mngmt/webinterface/computers/pxe.php +++ b/ldap-site-mngmt/webinterface/computers/pxe.php @@ -29,22 +29,20 @@ createComputersMenu($rollen, $mnr, $auDN, $sbmnr, $mcnr); ################################################################################### $pxeDN = $_GET['dn']; +# DN, CN des übergeordneten Nodes (Host oder Group) +$pxednarray = ldap_explode_dn($pxeDN, 0); +$nodeDN = implode(',',array_slice($pxednarray,2)); +#$nodeDN = $_GET['nodedn']; +$nodednarray = ldap_explode_dn($nodeDN, 1); $attributes = array("dn","cn","rbservicedn","filename","timerange","allowoptions","console","default", "display","font","implicit","kbdmap","menumasterpasswd","menutitle", "noescape","onerror","ontimeout","prompt","say","serial","timeout","ldapuri","fileuri"); $pxe = get_node_data($pxeDN,$attributes); -#print_r($pxe); - -$exp = explode(',',$pxeDN); -$node = array_slice($exp,1); -$nodeDN = implode(',',$node); # RBS Daten $rbsDN = $pxe['rbservicedn']; -$exp = explode(',',$rbsDN); -$exprbsau = explode('=',$exp[2]); $rbsau = $exprbsau[1]; -$rbsdata = get_node_data($rbsDN,array("cn","nfsserverip","exportpath","tftpserverip","tftppath","tftpclientconfpath")); +$rbsdata = get_node_data($rbsDN,array("cn","tftpserverip","tftppath","tftpclientconfpath")); # Timerange Komponenten $template->define_dynamic("TRanges", "Webseite"); @@ -90,67 +88,19 @@ $maxpos = count($menuentries)+1; $template->assign(array("PXEDN" => $pxeDN, "PXECN" => $pxecn, "TIMERANGE" => $pxe['timerange'], - "RBS" => $rbsdata['cn'], - "RBSAU" => $rbsau, - "NFS" => $rbsdata['nfsserverip'], - "NFSROOT" => $rbsdata['exportpath'], "TFTP" => $rbsdata['tftpserverip'], - "TFTPROOT" => $rbsdata['tftppath'], "TFTPFILE" => $rbsdata['tftpclientconfpath'], #"LDAPURI" => $pxe['ldapuri'], - "FILEURI" => $pxe['fileuri'], - "ALLOW" => $pxe['allowoptions'], - "CONSOLE" => $pxe['console'], - "DEFAULT" => $pxe['default'], - "DISPLAY" => $pxe['display'], - "FONT" => $pxe['font'], - "IMPLICIT" => $pxe['implicit'], - "KBDMAP" => $pxe['kbdmap'], - "MENMPW" => $pxe['menumasterpasswd'], - "MENTIT" => $pxe['menutitle'], - "NOESC" => $pxe['noescape'], - "ONERR" => $pxe['onerror'], - "ONTIME" => $pxe['ontimeout'], - "PROMPT" => $pxe['prompt'], - "SAY" => $pxe['say'], - "SERIAL" => $pxe['serial'], - "TIMEOUT" => $pxe['timeout'], - "MAXPOS" => $maxpos, + "FILEURI" => $pxe['fileuri'], "NODEDN" => $nodeDN, + "NODE" => $nodednarray[0], "DEFDN" => "cn=rbs,".$auDN, + "OPTLINK" => "", + "BMLINK" => "", "MNR" => $mnr, "SBMNR" => $sbmnr, "MCNR" => $mcnr)); -# Alternative RB Dienste holen -$altrbs = get_rbsoffers($auDN); - -# $altrbs = get_rbservices($auDN,array("dn","cn")); -$subrbs = $altrbs; -if (count($altrbs) != 0){ - for ($i=0; $i < count($altrbs); $i++){ - if ($rbsDN == $altrbs[$i]){ - array_splice($altrbs, $i, 1); - } - } -} -$template->assign(array("ALTRBSDN" => "", - "ALTRBSCN" => "", - "ALTRBSAU" => "")); -if (count($altrbs) != 0){ -$template->define_dynamic("Altrbs", "Webseite"); - foreach ($altrbs as $item){ - $rbsdnexp = ldap_explode_dn($item,1); - $rbsoffcn = $rbsdnexp[0]; - $rbsoffau = $rbsdnexp[2]; - #$altrbsexp = explode(',',$item['dn']); - #$altrbsau = explode('=',$altrbsexp[2]); - $template->assign(array("ALTRBSDN" => $item, - "ALTRBSCN" => $rbsoffcn, - "ALTRBSAU" => "   [ Abt.: ".$rbsoffau." ]")); - $template->parse("ALTRBS_LIST", ".Altrbs"); - } -} # Für Submenü Einträge $template->assign(array("SUBRBSDN" => "", @@ -230,7 +180,7 @@ foreach ($groups_array as $item){ $dnexp = ldap_explode_dn($pxeDN, 1); if ($dnexp[2] == "computers"){ - $nodetyp = "host"; + $nodetyp = "rbshost"; } if ($dnexp[2] == "groups"){ $nodetyp = "group"; diff --git a/ldap-site-mngmt/webinterface/computers/pxe_add.php b/ldap-site-mngmt/webinterface/computers/pxe_add.php index 8aa54c31..ef245f4d 100644 --- a/ldap-site-mngmt/webinterface/computers/pxe_add.php +++ b/ldap-site-mngmt/webinterface/computers/pxe_add.php @@ -164,19 +164,22 @@ if ( $pxecn != "" && $pxecn != "Hier_PXE_NAME_eintragen" && $rbsDN != "none" ){ $filenames = array(); if ($targettype == "computers"){ $macdata = get_node_data($targetDN, array("hwaddress")); - $filenames[] = "01-".$macdata['hwaddress']; + $pxemac = str_replace (":","-",$macdata['hwaddress']); + $filenames[] = "01-".$pxemac; } if ($targettype == "groups"){ $members = get_node_data($targetDN, array("member")); if (count($members) > 1){ foreach ($members['member'] as $hostDN){ $macdata = get_node_data($hostDN, array("hwaddress")); - $filenames[] = "01-".$macdata['hwaddress']; + $pxemac = str_replace (":","-",$macdata['hwaddress']); + $filenames[] = "01-".$pxemac; } } if (count($members) == 1){ $macdata = get_node_data($members['member'], array("hwaddress")); - $filenames[] = "01-".$macdata['hwaddress']; + $pxemac = str_replace (":","-",$macdata['hwaddress']); + $filenames[] = "01-".$pxemac; } } echo "filenames: ";print_r($filenames); echo "
"; @@ -187,7 +190,7 @@ if ( $pxecn != "" && $pxecn != "Hier_PXE_NAME_eintragen" && $rbsDN != "none" ){ $rbsDN = $rbs['hlprbservice']; print_r($rbsDN); - /*if (add_pxe($pxeDN,$pxecn,$rbsDN,$pxetimerange,$pxeattribs,$filenames,$conffile)){ + if (add_pxe($pxeDN,$pxecn,$rbsDN,$pxetimerange,$pxeattribs,$filenames,$conffile)){ $mesg .= "
Neues PXE Boot Menü erfolgreich angelegt
"; if ($targettype == "computers"){ $mnr=1; @@ -199,7 +202,7 @@ if ( $pxecn != "" && $pxecn != "Hier_PXE_NAME_eintragen" && $rbsDN != "none" ){ } else{ $mesg .= "
Fehler beim anlegen des PXE Boot Menüs!
"; - }*/ + } } } } diff --git a/ldap-site-mngmt/webinterface/computers/pxe_bootmenue.dwt b/ldap-site-mngmt/webinterface/computers/pxe_bootmenue.dwt new file mode 100644 index 00000000..305baf9f --- /dev/null +++ b/ldap-site-mngmt/webinterface/computers/pxe_bootmenue.dwt @@ -0,0 +1,176 @@ +
- Die MachineConfig wird komplett gelöscht. + Die PXE Config wird komplett gelöscht.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

<< Zurück zu Rechner  {NODE}

 

PXE Konfiguration   {PXECN}

{PXELINK} Allgemein

{OPTLINK} Global Options

Bootmenue

 

PXE Bootmenü:

+ Klicken Sie auf einen Menüeintrag um zur Detailansicht zu gelangen und den Eintrag bearbeiten zu können
+ + + + + + + + + + + + + + + + + + + + + +
#FlagsMenu Label   
{POSITION} {MEDEF} {MEPWD} {MEHIDE} {ANZEIGE}  +
+
+ + + + + + + + +

Flags:

+
    +
  • D -> Default Menüeintrag
  • +
  • P -> Passwort geschützt
  • +
  • H -> Hidden
  • +
+

Neuen Menüeintrag anlegen:   

+   zur Eingabemaske  

Standard Menüeinträge anlegen:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Typ    Position 
Localboot   + Menu Label
 
+ Passwort (optional)
 
 
Textzeile    
Leerzeile    
Verweis zu Submenü  Submenü Name
+
Remote Boot Service + +  
diff --git a/ldap-site-mngmt/webinterface/computers/pxe_bootmenue.php b/ldap-site-mngmt/webinterface/computers/pxe_bootmenue.php new file mode 100644 index 00000000..c6b62011 --- /dev/null +++ b/ldap-site-mngmt/webinterface/computers/pxe_bootmenue.php @@ -0,0 +1,199 @@ +define_dynamic("TRanges", "Webseite"); +if (count($pxe['timerange']) > 1){ + foreach($pxe['timerange'] as $tr){ + $exptime = explode('_',$tr); + $template->assign(array("PXEDAY" => $exptime[0], + "PXEBEG" => $exptime[1], + "PXEEND" => $exptime[2])); + $template->parse("TRANGES_LIST", ".TRanges"); + } +}else{ + $exptime = explode('_',$pxe['timerange']); + $template->assign(array("PXEDAY" => $exptime[0], + "PXEBEG" => $exptime[1], + "PXEEND" => $exptime[2])); + $template->parse("TRANGES_LIST", ".TRanges"); +} + +# Filenames +$template->define_dynamic("Filenames", "Webseite"); +if (count($pxe['filename']) > 1){ + foreach($pxe['filename'] as $fi){ + $template->assign(array("FILE" => $fi)); + $template->parse("FILENAMES_LIST", ".Filenames"); + } +}else{ + $exptime = explode('_',$pxe['filename']); + $template->assign(array("FILE" => $pxe['filename'])); + $template->parse("FILENAMES_LIST", ".Filenames"); +} + +$expcn = explode('_',$pxe['cn']); +$name = array_slice($expcn,1); +$pxecn = implode('_',$name); + +# Bootmenü Einträge +$menuentries = get_menuentries($pxeDN,array("dn","menuposition","label","menulabel","menudefault","menupasswd","menuhide")); +# print_r($menuentries); echo "
"; +$maxpos = count($menuentries)+1; + +# Globale Parameter +$template->assign(array("PXEDN" => $pxeDN, + "PXECN" => $pxecn, + "TIMERANGE" => $pxe['timerange'], + "MAXPOS" => $maxpos, + "NODEDN" => $nodeDN, + "NODE" => $nodednarray[0], + "DEFDN" => "cn=rbs,".$auDN, + "PXELINK" => "
", + "OPTLINK" => "", + "MNR" => $mnr, + "SBMNR" => $sbmnr, + "MCNR" => $mcnr)); + + +# Für Submenü Einträge +$template->assign(array("SUBRBSDN" => "", + "SUBRBSCN" => "", + "SUBRBSAU" => "")); +if (count($subrbs) != 0){ +$template->define_dynamic("Subrbs", "Webseite"); + foreach ($subrbs as $item){ + $rbsdnexp = ldap_explode_dn($item,1); + $subrbscn = $rbsdnexp[0]; + $subrbsau = $rbsdnexp[2]; + #$subrbsexp = explode(',',$item['dn']); + #$subrbsau = explode('=',$subrbsexp[2]); + $template->assign(array("SUBRBSDN" => $item, + "SUBRBSCN" => $subrbscn, + "SUBRBSAU" => "[ ".$subrbsau." ]")); + $template->parse("SUBRBS_LIST", ".Subrbs"); + } +} + +################################################ +# Bootmenü Einträge + +$template->define_dynamic("Bootmenu", "Webseite"); +$template->assign(array("MENDN" => "", + "MENULABEL" => "", + "ANZEIGE" => "Noch kein Bootmenü Eintrag angelegt", + "MEDEF" => "", + "MEPWD" => "", + "MEHIDE" => "", + "BGCDEF" => "", + "POSITION" => "")); +foreach ($menuentries as $me){ + $anzeige = ""; + if ($me['label'] != "" && $me['menulabel'] == ""){$anzeige .= $me['label'];} + if ($me['menulabel'] != ""){$anzeige .= $me['menulabel'];} + if ($me['menudefault'] == 1){$medef = "D"; $bgcdef = "background-color:#EEDD82;";} + if ($me['menupasswd'] != ""){$mepwd = "P";} + if ($me['menuhide'] == 1){$mehide = "H"; $bgcdef = "background-color:#A0A0A0;";} + $template->assign(array("MENDN" => $me['dn'], + "ANZEIGE" => "".$anzeige."", + "ANZEIGENAME" => $anzeige, + "POSITION" => $me['menuposition'], + "MEDEF" => $medef, + "MEPWD" => $mepwd, + "MEHIDE" => $mehide, + "BGCDEF" => $bgcdef, + "AUDN" => $auDN)); + $template->parse("BOOTMENU_LIST", ".Bootmenu"); + $medef = ""; + $bgcdef = ""; +} + + +################################################ +# PXE kopieren + +$hostorgroup = $exp[0]; +$hgexp = explode('=',$exp[0]); + + +$hosts_array = get_hosts($auDN,array("dn","hostname")); +$groups_array = get_groups($auDN,array("dn","cn")); + +$template->define_dynamic("Hosts", "Webseite"); +foreach ($hosts_array as $item){ + $template->assign(array("HDN" => $item['dn'], + "HN" => $item['hostname'])); + $template->parse("HOSTS_LIST", ".Hosts"); +} +$template->define_dynamic("Groups", "Webseite"); +foreach ($groups_array as $item){ + $template->assign(array("GDN" => $item['dn'], + "GN" => $item['cn'])); + $template->parse("GROUPS_LIST", ".Groups"); +} + +$dnexp = ldap_explode_dn($pxeDN, 1); +if ($dnexp[2] == "computers"){ + $nodetyp = "rbshost"; +} +if ($dnexp[2] == "groups"){ + $nodetyp = "group"; +} +# falls TR vorhanden dann soll sie gelöscht werden (flag deltr setzen) +if (count($pxe['timerange']) != 0){ + $template->assign(array("DELTR" => "1", + "NODETYP" => $nodetyp)); +} +else{ + $template->assign(array("DELTR" => "0", + "NODETYP" => $nodetyp)); +} + +################################################################################### + +include("computers_footer.inc.php"); + +?> diff --git a/ldap-site-mngmt/webinterface/computers/pxe_change.php b/ldap-site-mngmt/webinterface/computers/pxe_change.php index b3fcd4fa..07af7ed5 100644 --- a/ldap-site-mngmt/webinterface/computers/pxe_change.php +++ b/ldap-site-mngmt/webinterface/computers/pxe_change.php @@ -1,6 +1,8 @@
"; -$oldattribs = $_POST['oldattribs']; -if (count($oldattribs) != 0){ - foreach (array_keys($oldattribs) as $key){ - $oldatts[$key] = htmlentities($oldattribs[$key]); - } -} -#print_r($oldatts); echo "

"; - $seconds = 2; $url = "pxe.php?dn=".$pxeDN."&mnr=".$mnr."&sbmnr=".$sbmnr."&mcnr=".$mcnr; @@ -354,79 +337,7 @@ if ($newfilename != ""){ } - -################################################################## -# Restliche Attribute - -$entryadd = array(); -$entrymod = array(); -$entrydel = array(); - -foreach (array_keys($atts) as $key){ - - if ( $oldatts[$key] == $atts[$key] ){ - - } - if ( $oldatts[$key] == "" && $atts[$key] != "" ){ - # hier noch Syntaxcheck - $entryadd[$key] = $atts[$key]; - } - if ( $oldatts[$key] != "" && $atts[$key] != "" && $oldatts[$key] != $atts[$key] ){ - # hier noch Syntaxcheck - $entrymod[$key] = $atts[$key]; - } - if ( $oldatts[$key] != "" && $atts[$key] == "" ){ - # hier noch Syntaxcheck - $entrydel[$key] = $oldatts[$key]; - } -} - -#print_r($entryadd); echo "
"; -#print_r($entrymod); echo "
"; -#print_r($entrydel); echo "
"; - - -if (count($entryadd) != 0 ){ - #print_r($entryadd); echo "
"; - #echo "neu anlegen
"; - foreach (array_keys($entryadd) as $key){ - $addatts .= "".$key.","; - } - if(ldap_mod_add($ds,$pxeDN,$entryadd)){ - $mesg = "Attribute ".$addatts." erfolgreich eingetragen

"; - }else{ - $mesg = "Fehler beim eintragen der Attribute ".$addatts."

"; - } -} - -if (count($entrymod) != 0 ){ - #print_r($entrymod); echo "
"; - #echo "ändern
"; - foreach (array_keys($entrymod) as $key){ - $modatts .= "".$key.","; - } - if(ldap_mod_replace($ds,$pxeDN,$entrymod)){ - $mesg = "Attribute ".$modatts." erfolgreich geaendert

"; - }else{ - $mesg = "Fehler beim aendern der Attribute ".$modatts."

"; - } -} - -if (count($entrydel) != 0 ){ - #print_r($entrydel); echo "
"; - #echo "löschen
"; - foreach (array_keys($entrydel) as $key){ - $delatts .= "".$key.","; - } - if(ldap_mod_del($ds,$pxeDN,$entrydel)){ - $mesg = "Attribute ".$delatts." erfolgreich geloescht

"; - }else{ - $mesg = "Fehler beim loeschen der Attribute ".$delatts."

"; - } -} - - - +######################### $mesg .= "
Sie werden automatisch auf die vorherige Seite zurückgeleitet.
Falls nicht, klicken Sie hier back"; diff --git a/ldap-site-mngmt/webinterface/computers/pxe_copy.php b/ldap-site-mngmt/webinterface/computers/pxe_copy.php index eb75ea44..61760a8e 100644 --- a/ldap-site-mngmt/webinterface/computers/pxe_copy.php +++ b/ldap-site-mngmt/webinterface/computers/pxe_copy.php @@ -119,7 +119,8 @@ if ( $pxecn != ""){ # Filename anpassen if ($targettype == "computers"){ $macdata = get_node_data($targetDN, array("hwaddress")); - $entrymod ['filename'] = "01-".$macdata['hwaddress']; + $pxemac = str_replace (":","-",$macdata['hwaddress']); + $entrymod ['filename'] = "01-".$pxemac; #$entrymod ['fileuri'] = "01-".$macdata['hwaddress'].".tgz"; } if ($targettype == "groups"){ @@ -127,7 +128,8 @@ if ( $pxecn != ""){ if (count($members) != 0){ foreach ($members['member'] as $hostDN){ $macdata = get_node_data($hostDN, array("hwaddress")); - $entrymod ['filename'][] = "01-".$macdata['hwaddress']; + $pxemac = str_replace (":","-",$macdata['hwaddress']); + $entrymod ['filename'][] = "01-".$pxemac; #$entrymod ['fileuri'] = $target.".tgz"; } } diff --git a/ldap-site-mngmt/webinterface/computers/pxe_globals.dwt b/ldap-site-mngmt/webinterface/computers/pxe_globals.dwt new file mode 100644 index 00000000..78b89481 --- /dev/null +++ b/ldap-site-mngmt/webinterface/computers/pxe_globals.dwt @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

<< Zurück zu Rechner  {NODE}

 

PXE Konfiguration   {PXECN}

{PXELINK} Allgemein

Global Options

{BMLINK} Bootmenue

 

Globale Optionen der PXE Konfiguration:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributWert
Default:   + +   +
Menu Title:   + +   +
Menu Master Passwd:   + +   +
Timeout:   + +   +
No Escape:   + +   +
Prompt:   + +   +
Allow Options:   + +   +
On Error:   + +   +
ON Timeout:   + +   +
File URI:   + tftp://{TFTP}/{TFTPFILE} + +   +
+ + + + + + + +
\ No newline at end of file diff --git a/ldap-site-mngmt/webinterface/computers/pxe_globals.php b/ldap-site-mngmt/webinterface/computers/pxe_globals.php new file mode 100644 index 00000000..7ab7892f --- /dev/null +++ b/ldap-site-mngmt/webinterface/computers/pxe_globals.php @@ -0,0 +1,218 @@ +define_dynamic("TRanges", "Webseite"); +if (count($pxe['timerange']) > 1){ + foreach($pxe['timerange'] as $tr){ + $exptime = explode('_',$tr); + $template->assign(array("PXEDAY" => $exptime[0], + "PXEBEG" => $exptime[1], + "PXEEND" => $exptime[2])); + $template->parse("TRANGES_LIST", ".TRanges"); + } +}else{ + $exptime = explode('_',$pxe['timerange']); + $template->assign(array("PXEDAY" => $exptime[0], + "PXEBEG" => $exptime[1], + "PXEEND" => $exptime[2])); + $template->parse("TRANGES_LIST", ".TRanges"); +} + +# Filenames +$template->define_dynamic("Filenames", "Webseite"); +if (count($pxe['filename']) > 1){ + foreach($pxe['filename'] as $fi){ + $template->assign(array("FILE" => $fi)); + $template->parse("FILENAMES_LIST", ".Filenames"); + } +}else{ + $exptime = explode('_',$pxe['filename']); + $template->assign(array("FILE" => $pxe['filename'])); + $template->parse("FILENAMES_LIST", ".Filenames"); +} + +$expcn = explode('_',$pxe['cn']); +$name = array_slice($expcn,1); +$pxecn = implode('_',$name); + +# Bootmenü Einträge +$menuentries = get_menuentries($pxeDN,array("dn","menuposition","label","menulabel","menudefault","menupasswd","menuhide")); +# print_r($menuentries); echo "
"; +$maxpos = count($menuentries)+1; + +# Globale Parameter +$template->assign(array("PXEDN" => $pxeDN, + "PXECN" => $pxecn, + "TIMERANGE" => $pxe['timerange'], + "TFTP" => $rbsdata['tftpserverip'], + "TFTPFILE" => $rbsdata['tftpclientconfpath'], + #"LDAPURI" => $pxe['ldapuri'], + "FILEURI" => $pxe['fileuri'], + "ALLOW" => $pxe['allowoptions'], + "CONSOLE" => $pxe['console'], + "DEFAULT" => $pxe['default'], + "DISPLAY" => $pxe['display'], + "FONT" => $pxe['font'], + "IMPLICIT" => $pxe['implicit'], + "KBDMAP" => $pxe['kbdmap'], + "MENMPW" => $pxe['menumasterpasswd'], + "MENTIT" => $pxe['menutitle'], + "NOESC" => $pxe['noescape'], + "ONERR" => $pxe['onerror'], + "ONTIME" => $pxe['ontimeout'], + "PROMPT" => $pxe['prompt'], + "SAY" => $pxe['say'], + "SERIAL" => $pxe['serial'], + "TIMEOUT" => $pxe['timeout'], + "NODEDN" => $nodeDN, + "NODE" => $nodednarray[0], + "DEFDN" => "cn=rbs,".$auDN, + "PXELINK" => "", + "BMLINK" => "", + "MNR" => $mnr, + "SBMNR" => $sbmnr, + "MCNR" => $mcnr)); + + +# Für Submenü Einträge +$template->assign(array("SUBRBSDN" => "", + "SUBRBSCN" => "", + "SUBRBSAU" => "")); +if (count($subrbs) != 0){ +$template->define_dynamic("Subrbs", "Webseite"); + foreach ($subrbs as $item){ + $rbsdnexp = ldap_explode_dn($item,1); + $subrbscn = $rbsdnexp[0]; + $subrbsau = $rbsdnexp[2]; + #$subrbsexp = explode(',',$item['dn']); + #$subrbsau = explode('=',$subrbsexp[2]); + $template->assign(array("SUBRBSDN" => $item, + "SUBRBSCN" => $subrbscn, + "SUBRBSAU" => "[ ".$subrbsau." ]")); + $template->parse("SUBRBS_LIST", ".Subrbs"); + } +} + +################################################ +# Bootmenü Einträge + +$template->define_dynamic("Bootmenu", "Webseite"); +$template->assign(array("MENDN" => "", + "MENULABEL" => "", + "ANZEIGE" => "Noch kein Bootmenü Eintrag angelegt", + "MEDEF" => "", + "MEPWD" => "", + "MEHIDE" => "", + "BGCDEF" => "", + "POSITION" => "")); +foreach ($menuentries as $me){ + $anzeige = ""; + if ($me['label'] != "" && $me['menulabel'] == ""){$anzeige .= $me['label'];} + if ($me['menulabel'] != ""){$anzeige .= $me['menulabel'];} + if ($me['menudefault'] == 1){$medef = "D"; $bgcdef = "background-color:#EEDD82;";} + if ($me['menupasswd'] != ""){$mepwd = "P";} + if ($me['menuhide'] == 1){$mehide = "H"; $bgcdef = "background-color:#A0A0A0;";} + $template->assign(array("MENDN" => $me['dn'], + "ANZEIGE" => "".$anzeige."", + "ANZEIGENAME" => $anzeige, + "POSITION" => $me['menuposition'], + "MEDEF" => $medef, + "MEPWD" => $mepwd, + "MEHIDE" => $mehide, + "BGCDEF" => $bgcdef, + "AUDN" => $auDN)); + $template->parse("BOOTMENU_LIST", ".Bootmenu"); + $medef = ""; + $bgcdef = ""; +} + + +################################################ +# PXE kopieren + +$hostorgroup = $exp[0]; +$hgexp = explode('=',$exp[0]); + + +$hosts_array = get_hosts($auDN,array("dn","hostname")); +$groups_array = get_groups($auDN,array("dn","cn")); + +$template->define_dynamic("Hosts", "Webseite"); +foreach ($hosts_array as $item){ + $template->assign(array("HDN" => $item['dn'], + "HN" => $item['hostname'])); + $template->parse("HOSTS_LIST", ".Hosts"); +} +$template->define_dynamic("Groups", "Webseite"); +foreach ($groups_array as $item){ + $template->assign(array("GDN" => $item['dn'], + "GN" => $item['cn'])); + $template->parse("GROUPS_LIST", ".Groups"); +} + +$dnexp = ldap_explode_dn($pxeDN, 1); +if ($dnexp[2] == "computers"){ + $nodetyp = "rbshost"; +} +if ($dnexp[2] == "groups"){ + $nodetyp = "group"; +} +# falls TR vorhanden dann soll sie gelöscht werden (flag deltr setzen) +if (count($pxe['timerange']) != 0){ + $template->assign(array("DELTR" => "1", + "NODETYP" => $nodetyp)); +} +else{ + $template->assign(array("DELTR" => "0", + "NODETYP" => $nodetyp)); +} + +################################################################################### + +include("computers_footer.inc.php"); + +?> diff --git a/ldap-site-mngmt/webinterface/computers/pxe_globals_change.php b/ldap-site-mngmt/webinterface/computers/pxe_globals_change.php new file mode 100644 index 00000000..06f388bb --- /dev/null +++ b/ldap-site-mngmt/webinterface/computers/pxe_globals_change.php @@ -0,0 +1,126 @@ +
"; +$oldattribs = $_POST['oldattribs']; +if (count($oldattribs) != 0){ + foreach (array_keys($oldattribs) as $key){ + $oldatts[$key] = htmlentities($oldattribs[$key]); + } +} +#print_r($oldatts); echo "

"; + + +$seconds = 2; +$url = "pxe_globals.php?dn=".$pxeDN."&mnr=".$mnr."&sbmnr=".$sbmnr."&mcnr=".$mcnr; + +echo " + + + Computers Management + + + + +
"; + + + + + +################################################################## +# Restliche Attribute + +$entryadd = array(); +$entrymod = array(); +$entrydel = array(); + +foreach (array_keys($atts) as $key){ + + if ( $oldatts[$key] == $atts[$key] ){ + + } + if ( $oldatts[$key] == "" && $atts[$key] != "" ){ + # hier noch Syntaxcheck + $entryadd[$key] = $atts[$key]; + } + if ( $oldatts[$key] != "" && $atts[$key] != "" && $oldatts[$key] != $atts[$key] ){ + # hier noch Syntaxcheck + $entrymod[$key] = $atts[$key]; + } + if ( $oldatts[$key] != "" && $atts[$key] == "" ){ + # hier noch Syntaxcheck + $entrydel[$key] = $oldatts[$key]; + } +} + +#print_r($entryadd); echo "
"; +#print_r($entrymod); echo "
"; +#print_r($entrydel); echo "
"; + + +if (count($entryadd) != 0 ){ + #print_r($entryadd); echo "
"; + #echo "neu anlegen
"; + foreach (array_keys($entryadd) as $key){ + $addatts .= "".$key.","; + } + if(ldap_mod_add($ds,$pxeDN,$entryadd)){ + $mesg = "Attribute ".$addatts." erfolgreich eingetragen

"; + }else{ + $mesg = "Fehler beim eintragen der Attribute ".$addatts."

"; + } +} + +if (count($entrymod) != 0 ){ + #print_r($entrymod); echo "
"; + #echo "ändern
"; + foreach (array_keys($entrymod) as $key){ + $modatts .= "".$key.","; + } + if(ldap_mod_replace($ds,$pxeDN,$entrymod)){ + $mesg = "Attribute ".$modatts." erfolgreich geaendert

"; + }else{ + $mesg = "Fehler beim aendern der Attribute ".$modatts."

"; + } +} + +if (count($entrydel) != 0 ){ + #print_r($entrydel); echo "
"; + #echo "löschen
"; + foreach (array_keys($entrydel) as $key){ + $delatts .= "".$key.","; + } + if(ldap_mod_del($ds,$pxeDN,$entrydel)){ + $mesg = "Attribute ".$delatts." erfolgreich geloescht

"; + }else{ + $mesg = "Fehler beim loeschen der Attribute ".$delatts."

"; + } +} + + + + +$mesg .= "
Sie werden automatisch auf die vorherige Seite zurückgeleitet.
+ Falls nicht, klicken Sie hier back"; +redirect($seconds, $url, $mesg, $addSessionId = TRUE); + +echo "
+"; +?> \ No newline at end of file diff --git a/ldap-site-mngmt/webinterface/computers/pxe_wochenplan.php b/ldap-site-mngmt/webinterface/computers/pxe_wochenplan.php new file mode 100644 index 00000000..2e73db85 --- /dev/null +++ b/ldap-site-mngmt/webinterface/computers/pxe_wochenplan.php @@ -0,0 +1,262 @@ +assign(array("A0" => "","B0" => "","C0" => "","D0" => "","E0" => "","F0" => "","G0" => "", + "A1" => "","B1" => "","C1" => "","D1" => "","E1" => "","F1" => "","G1" => "", + "A2" => "","B2" => "","C2" => "","D2" => "","E2" => "","F2" => "","G2" => "", + "A3" => "","B3" => "","C3" => "","D3" => "","E3" => "","F3" => "","G3" => "", + "A4" => "","B4" => "","C4" => "","D4" => "","E4" => "","F4" => "","G4" => "", + "A5" => "","B5" => "","C5" => "","D5" => "","E5" => "","F5" => "","G5" => "", + "A6" => "","B6" => "","C6" => "","D6" => "","E6" => "","F6" => "","G6" => "", + "A7" => "","B7" => "","C7" => "","D7" => "","E7" => "","F7" => "","G7" => "", + "A8" => "","B8" => "","C8" => "","D8" => "","E8" => "","F8" => "","G8" => "", + "A9" => "","B9" => "","C9" => "","D9" => "","E9" => "","F9" => "","G9" => "", + "A10" => "","B10" => "","C10" => "","D10" => "","E10" => "","F10" => "","G10" => "", + "A11" => "","B11" => "","C11" => "","D11" => "","E11" => "","F11" => "","G11" => "", + "A12" => "","B12" => "","C12" => "","D12" => "","E12" => "","F12" => "","G12" => "", + "A13" => "","B13" => "","C13" => "","D13" => "","E13" => "","F13" => "","G13" => "", + "A14" => "","B14" => "","C14" => "","D14" => "","E14" => "","F14" => "","G14" => "", + "A15" => "","B15" => "","C15" => "","D15" => "","E15" => "","F15" => "","G15" => "", + "A16" => "","B16" => "","C16" => "","D16" => "","E16" => "","F16" => "","G16" => "", + "A17" => "","B17" => "","C17" => "","D17" => "","E17" => "","F17" => "","G17" => "", + "A18" => "","B18" => "","C18" => "","D18" => "","E18" => "","F18" => "","G18" => "", + "A19" => "","B19" => "","C19" => "","D19" => "","E19" => "","F19" => "","G19" => "", + "A20" => "","B20" => "","C20" => "","D20" => "","E20" => "","F20" => "","G20" => "", + "A21" => "","B21" => "","C21" => "","D21" => "","E21" => "","F21" => "","G21" => "", + "A22" => "","B22" => "","C22" => "","D22" => "","E22" => "","F22" => "","G22" => "", + "A23" => "","B23" => "","C23" => "","D23" => "","E23" => "","F23" => "","G23" => "")); + +#print_r($timeranges); echo "
"; + +############################################################################ +# Default-Dienst PXE Timeranges +# vom spezifischsten zum unspezifischsten : +# FR_0_7 -> FR_X_X -> X_0_7 -> X_X_X +$daytime = array(); +$timex = array(); +$dayx = array(); +$allx = array(); +$legend = array(); +if(count($wopldeftranges) != 0){ +foreach ($wopldeftranges as $tr){ + if (count($tr[0]) > 1){ + foreach ($tr as $item){ + if ($item[0] != "X" && $item[1] != "X" && $item[2] != "X" && ($item[0] == "MO" || $item[0] == "DI" || $item[0] == "MI" || $item[0] == "DO" || $item[0] == "FR" || $item[0] == "SA" || $item[0] == "SO")){ + $daytime[] = $item; + } + if ($item[0] != "X" && $item[1] == "X" && $item[2] == "X"){ + $timex[] = $item; + } + if ($item[0] == "X" && $item[1] != "X" && $item[2] != "X"){ + $dayx[] = $item; + } + if ($item[0] == "X" && $item[1] == "X" && $item[2] == "X"){ + $allx[] = $item; + } + } + }else{ + if ($tr[0] != "X" && $tr[1] != "X" && $tr[2] != "X" && ($tr[0] == "MO" || $tr[0] == "DI" || $tr[0] == "MI" || $tr[0] == "DO" || $tr[0] == "FR" || $tr[0] == "SA" || $tr[0] == "SO")){ + $daytime[] = $tr; + } + if ($tr[0] != "X" && $tr[1] == "X" && $tr[2] == "X"){ + $timex[] = $tr; + } + if ($tr[0] == "X" && $tr[1] != "X" && $tr[2] != "X"){ + $dayx[] = $tr; + } + if ($tr[0] == "X" && $tr[1] == "X" && $tr[2] == "X"){ + $allx[] = $tr; + } + } +} + +#print_r($daytime); echo "
"; +#print_r($timex); echo "
"; +#print_r($dayx); echo "
"; +#print_r($allx); echo "
"; + +$daycode = array("MO" => "A", "DI" => "B", "MI" => "C", "DO" => "D", "FR" => "E", "SA" => "F", "SO" => "G"); +$allxcolors = array("#BEBEBE","A0A0A0","#696969","#EEDFCC","#D8BFD8","#505050"); +$dayxcolors = array("#483D8B","#7B68EE","#191970","#8470FF","#708090","#6A5ACD"); +$timexcolors = array("#CDC673","#A2CD5A","#BDB76B","#8B864E","#6B8E23","#CDBE70"); +$daytimecolors = array("880000","#CD6839","#CC3300","#CC6600","#993300","#8B4C39"); + + +if (count($allx) != 0){ + $c = 0; + foreach ($allx as $range){ + foreach ($daycode as $dc){ + for ($i = 0; $i <= 23; $i++){ + $template->assign(array($dc.$i => "background-color:".$allxcolors[$c].";")); + } + } + $legend[] = array($range ,$allxcolors[$c]); + $c++; + } +} + +if (count($dayx) != 0){ + $c = 0; + foreach ($dayx as $range){ + foreach ($daycode as $dc){ + for ($i = $range[1]; $i<= $range[2]; $i++){ + $template->assign(array($dc.$i => "background-color:".$dayxcolors[$c].";")); + } + } + $legend[] = array($range ,$dayxcolors[$c]); + $c++; + } +} + +if (count($timex) != 0){ + $c = 0; + foreach ($timex as $range){ + $dc = $daycode[$range[0]]; + for ($i = 0; $i<= 23; $i++){ + $template->assign(array($dc.$i => "background-color:".$timexcolors[$c].";")); + } + $legend[] = array($range ,$timexcolors[$c]); + $c++; + } +} + +if (count($daytime) != 0){ + $c = 0; + foreach ($daytime as $range){ + $dc = $daycode[$range[0]]; + for ($i = $range[1]; $i<= $range[2]; $i++){ + $template->assign(array($dc.$i => "background-color:".$daytimecolors[$c].";")); + } + $legend[] = array($range ,$daytimecolors[$c]); + $c++; + } +} + +} + +############################################################################ +# Rechner-spezifische PXE Timeranges +# vom spezifischsten zum unspezifischsten : +# FR_0_7 -> FR_X_X -> X_0_7 -> X_X_X +$daytime = array(); +$timex = array(); +$dayx = array(); +$allx = array(); + +if(count($wopltranges) != 0){ +foreach ($wopltranges as $tr){ + if (count($tr[0]) > 1){ + foreach ($tr as $item){ + if ($item[0] != "X" && $item[1] != "X" && $item[2] != "X" && ($item[0] == "MO" || $item[0] == "DI" || $item[0] == "MI" || $item[0] == "DO" || $item[0] == "FR" || $item[0] == "SA" || $item[0] == "SO")){ + $daytime[] = $item; + } + if ($item[0] != "X" && $item[1] == "X" && $item[2] == "X"){ + $timex[] = $item; + } + if ($item[0] == "X" && $item[1] != "X" && $item[2] != "X"){ + $dayx[] = $item; + } + if ($item[0] == "X" && $item[1] == "X" && $item[2] == "X"){ + $allx[] = $item; + } + } + }else{ + if ($tr[0] != "X" && $tr[1] != "X" && $tr[2] != "X" && ($tr[0] == "MO" || $tr[0] == "DI" || $tr[0] == "MI" || $tr[0] == "DO" || $tr[0] == "FR" || $tr[0] == "SA" || $tr[0] == "SO")){ + $daytime[] = $tr; + } + if ($tr[0] != "X" && $tr[1] == "X" && $tr[2] == "X"){ + $timex[] = $tr; + } + if ($tr[0] == "X" && $tr[1] != "X" && $tr[2] != "X"){ + $dayx[] = $tr; + } + if ($tr[0] == "X" && $tr[1] == "X" && $tr[2] == "X"){ + $allx[] = $tr; + } + } +} + +#print_r($daytime); echo "
"; +#print_r($timex); echo "
"; +#print_r($dayx); echo "
"; +#print_r($allx); echo "
"; + +$daycode = array("MO" => "A", "DI" => "B", "MI" => "C", "DO" => "D", "FR" => "E", "SA" => "F", "SO" => "G"); +$allxcolors = array("#BEBEBE","A0A0A0","#696969","#EEDFCC","#D8BFD8","#505050"); +$dayxcolors = array("#483D8B","#7B68EE","#191970","#8470FF","#708090","#6A5ACD"); +$timexcolors = array("#CDC673","#A2CD5A","#BDB76B","#8B864E","#6B8E23","#CDBE70"); +$daytimecolors = array("880000","#CD6839","#CC3300","#CC6600","#993300","#8B4C39"); + + +if (count($allx) != 0){ + $c = 0; + foreach ($allx as $range){ + foreach ($daycode as $dc){ + for ($i = 0; $i <= 23; $i++){ + $template->assign(array($dc.$i => "background-color:".$allxcolors[$c].";")); + } + } + $legend[] = array($range ,$allxcolors[$c]); + $c++; + } +} + +if (count($dayx) != 0){ + $c = 0; + foreach ($dayx as $range){ + foreach ($daycode as $dc){ + for ($i = $range[1]; $i<= $range[2]; $i++){ + $template->assign(array($dc.$i => "background-color:".$dayxcolors[$c].";")); + } + } + $legend[] = array($range ,$dayxcolors[$c]); + $c++; + } +} + +if (count($timex) != 0){ + $c = 0; + foreach ($timex as $range){ + $dc = $daycode[$range[0]]; + for ($i = 0; $i<= 23; $i++){ + $template->assign(array($dc.$i => "background-color:".$timexcolors[$c].";")); + } + $legend[] = array($range ,$timexcolors[$c]); + $c++; + } +} + +if (count($daytime) != 0){ + $c = 0; + foreach ($daytime as $range){ + $dc = $daycode[$range[0]]; + for ($i = $range[1]; $i<= $range[2]; $i++){ + $template->assign(array($dc.$i => "background-color:".$daytimecolors[$c].";")); + } + $legend[] = array($range ,$daytimecolors[$c]); + $c++; + } +} + +} + +$template->assign(array("PXEDESC" => "")); +#print_r($legend); +if (count($legend) != 0){ + $template->define_dynamic("Legende", "Webseite"); + foreach ($legend as $item){ + # Timerange Komponente + $color = $item[1]; + $template->assign(array("TR1" => $item[0][0], + "TR2" => $item[0][1], + "TR3" => $item[0][2], + "PXEDESC" => $item[0][3], + "COLOR" => $color)); + $template->parse("LEGENDE_LIST", ".Legende"); + } +} + + +?> \ No newline at end of file diff --git a/ldap-site-mngmt/webinterface/computers/rbshost.dwt b/ldap-site-mngmt/webinterface/computers/rbshost.dwt new file mode 100644 index 00000000..6fd774cd --- /dev/null +++ b/ldap-site-mngmt/webinterface/computers/rbshost.dwt @@ -0,0 +1,382 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

{HOSTLINK} Allgemein

{DHCPLINK} DHCP

RBS/PXE

{HWLINK} Hardware

 

RBS/PXE Setup - Rechner   {HOSTNAME}

+ + + + + + + + + + + + {RBS} + + +
Remote Boot Dienst Einbindung (DHCP/TFTP) 
+
+ + + + + + + + + + + + + + + +
Rechner-spezifische PXE Konfigurationen (Bootmenüs)
{PXECN}  {PXETR}  {PXEDESC}  
+ + + + + + + + + + + + + + + +
Default PXE Konfigurationen des Remote Boot Dienstes
{DEFPXECN}  {DEFPXETR}  {DEFPXEDESC}  

Wochen Übersicht PXE Configs für Rechner  {HOSTNAME}  :

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UhrzeitMontagDienstagMittwochDonnerstagFreitagSamstagSonntag
0       
        
2       
        
4       
        
6       
        
8       
        
10       
        
12       
        
14       
        
16        
        
18       
        
20       
        
22       
        
+ + + + + + + + + + + + + + + + + + + + + +
PXE Config Farbe
No Config    
{PXEDESC}     
\ No newline at end of file diff --git a/ldap-site-mngmt/webinterface/computers/rbshost.php b/ldap-site-mngmt/webinterface/computers/rbshost.php new file mode 100644 index 00000000..83c2056d --- /dev/null +++ b/ldap-site-mngmt/webinterface/computers/rbshost.php @@ -0,0 +1,248 @@ +
"; +$dhcphlpcont = $host['dhcphlpcont']; +$objectDN = $dhcphlpcont; +$rbsDN = $host['hlprbservice']; + +$rbs_dhcpopt = ""; +$host_dhcpopt = ""; +$dhcp_selectbox = ""; + + +# Falls nicht DHCP Dienst dann kein RBS Setup +if ($dhcphlpcont == ""){ + + $rbs = "
+ Sie müssen den Rechner zuerst in einem DHCP Dienst anmelden, bevor Sie ihn + einem Remote Boot Dienst zuordnen können
(DHCP Optionen!!).
+ Remote Boot Dienst:   + Rechner ist in keinem Remote Boot Dienst angemeldet
+ RBS auswählen:
Remote Boot Dienst:   + Remote Boot Service ".$rbserv." / AU ".$rbsau."
DHCP Option next-server  (TFTP Boot Server IP):".$host['dhcpoptnext-server']." 
DHCP Option filename  (initiale remote Bootdatei):".$host['dhcpoptfilename']." 
+ RBS Einbindung ändern:
+
"; + + +########################################## +# RBS + +if ($rbs != "none" && $rbs != $oldrbs){ + if ($rbs != ""){ + $exp = ldap_explode_dn($rbs, 1); + $rbscn = $exp[0]; + $rbsau = $exp[2]; + + $dhcpdata = get_node_data($rbs,array("tftpserverip","initbootfile")); + $entryrbs ['hlprbservice'] = $rbs; + $entryrbs ['dhcpoptnext-server'] = $dhcpdata['tftpserverip']; + $entryrbs ['dhcpoptfilename'] = $dhcpdata['initbootfile']; + if ($oldrbs != ""){ + echo "RBS replace "; print_r($oldrbs); echo " with "; print_r($entryrbs); echo "
"; + if ($result = ldap_mod_replace($ds,$hostDN,$entryrbs)){ + rbs_adjust_host($hostDN, $rbs); + $mesg = "Remote Boot Service erfolgreich zu ".$rbscn." [Abt.: ".$rbsau."] geändert

"; + }else{ + $mesg = "Fehler beim ändern des Remote Boot Services zu ".$rbscn."!

"; + } + }else{ + echo "RBS add "; print_r($entryrbs); echo "
"; + if ($result = ldap_mod_add($ds,$hostDN,$entryrbs)){ + rbs_adjust_host($hostDN, $rbs); + $mesg = "Remote Boot Service erfolgreich zu ".$rbscn." [Abt.: ".$rbsau."] geändert

"; + }else{ + $mesg = "Fehler beim ändern des Remote Boot Services zu ".$rbscn."!

"; + } + } + }else{ + $entryrbs ['hlprbservice'] = array(); + $entryrbs ['dhcpoptnext-server'] = array(); + $entryrbs ['dhcpoptfilename'] = array(); + echo "RBS delete "; echo "
"; + if ($result = ldap_mod_del($ds,$hostDN,$entryrbs)){ + $mesg = "Rechner erfolgreich aus RBS gelöscht

"; + }else{ + $mesg = "Fehler beim löschen aus RBS!

"; + } + } +} +if ($rbs == "none"){ + echo "RBS none
"; +} + + +##################### + +$mesg .= "
Sie werden automatisch auf die vorherige Seite zurückgeleitet.
+ Falls nicht, klicken Sie hier back"; +redirect($seconds, $url, $mesg, $addSessionId = TRUE); + +echo "
+"; +?> \ No newline at end of file diff --git a/ldap-site-mngmt/webinterface/computers/showpxe.dwt b/ldap-site-mngmt/webinterface/computers/showpxe.dwt new file mode 100644 index 00000000..d6f37f66 --- /dev/null +++ b/ldap-site-mngmt/webinterface/computers/showpxe.dwt @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

<< Zurück zu Rechner  {HOST}

 

Default PXE Config   {PXECN}

Diese PXE Config wird vom RBS Betreiber verwaltet (Sie haben keine Schreibrechte).
+ + + + + + + + + + + + + + + + + + +
#FlagsMenu Label 
{POSITION} {MEDEF} {MEPWD} {MEHIDE} {ANZEIGE} 

Flags:

+
    +
  • D -> Default Menüeintrag
  • +
  • P -> Passwort geschützt
  • +
  • H -> Hidden
  • +
+
diff --git a/ldap-site-mngmt/webinterface/computers/showpxe.php b/ldap-site-mngmt/webinterface/computers/showpxe.php new file mode 100644 index 00000000..8ed9b70d --- /dev/null +++ b/ldap-site-mngmt/webinterface/computers/showpxe.php @@ -0,0 +1,95 @@ +"; +$maxpos = count($menuentries)+1; + + +################################################ +# Bootmenü Einträge + +$template->define_dynamic("Bootmenu", "Webseite"); +$template->assign(array("PXECN" => $pxecn, + "HOSTDN" => $hostdn, + "HOST" => $hostdnarray[0], + "SBMNR" => $sbmnr, + "MENDN" => "", + "MENULABEL" => "", + "ANZEIGE" => "Kein Bootmenü Eintrag angelegt", + "MEDEF" => "", + "MEPWD" => "", + "MEHIDE" => "", + "BGCDEF" => "", + "POSITION" => "")); +foreach ($menuentries as $me){ + $anzeige = ""; + if ($me['label'] != "" && $me['menulabel'] == ""){$anzeige .= $me['label'];} + if ($me['menulabel'] != ""){$anzeige .= $me['menulabel'];} + if ($me['menudefault'] == 1){$medef = "D"; $bgcdef = "background-color:#EEDD82;";} + if ($me['menupasswd'] != ""){$mepwd = "P";} + if ($me['menuhide'] == 1){$mehide = "H"; $bgcdef = "background-color:#A0A0A0;";} + $template->assign(array("MENDN" => $me['dn'], + "ANZEIGE" => $anzeige, + "ANZEIGENAME" => $anzeige, + "POSITION" => $me['menuposition'], + "MEDEF" => $medef, + "MEPWD" => $mepwd, + "MEHIDE" => $mehide, + "BGCDEF" => $bgcdef, + "AUDN" => $auDN)); + $template->parse("BOOTMENU_LIST", ".Bootmenu"); + $medef = ""; + $bgcdef = ""; +} + + +################################################################################### + +include("computers_footer.inc.php"); + +?> -- cgit v1.2.3-55-g7522