summaryrefslogtreecommitdiffstats
path: root/ldap-site-mngmt/webinterface/computers/new_pxe.php
blob: 8eef28882b89b85a106d9db5ed7d948aedf543c2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?php

include('../standard_header.inc.php');

# 1. Seitentitel - wird in der Titelleiste des Browser angezeigt. 
$titel = "Computers Management";
# 2. Nummer des zugehörigen Hauptmenus (Registerkarte) beginnend bei 0, siehe Dokumentation.doc.
$mainnr = 3;
$mnr = 3; 
$sbmnr = -1;
$mcnr = -1;
# 3. Dateiname und evtl. Pfad des Templates für die Webseite
$webseite = "new_pxe.dwt";

include("../class.FastTemplate.php");

include('computers_header.inc.php');

###################################################################################

$sbmnr = $_GET['sbmnr'];
$mcnr = $_GET['mcnr']; 

# Menuleisten erstellen
createMainMenu($rollen, $mainnr);
createComputersMenu($rollen, $mnr, $auDN, $sbmnr, $mcnr);

###################################################################################

$pxecn = str_replace ( "_", " ", $_GET['pxecn']);
$pxeday = str_replace ( "_", " ", $_GET['pxeday']);
$pxebeg = str_replace ( "_", " ", $_GET['pxebeg']);
$pxeend = str_replace ( "_", " ", $_GET['pxeend']);

$template->assign(array("PXECN" => $pxecn,
								"PXEDAY" => $pxeday,
           			      "PXEBEG" => $pxebeg,
           			      "PXEEND" => $pxeend,
           		       	# "LDAPURI" => "",
           			      "FILEURI" => "",   
           			      "RBS" => "",
           			      "RBSAU" => "",
           			      "NFS" => "",
           			      "NFSROOT" => "",
           			      "TFTP" => "",
           			      "TFTPROOT" => "",
           			      "FILE" => "",           			      
           		       	"ALLOW" => "",          			      
           		       	"CONSOLE" => "",
           		       	"DEFAULT" => "menu.c32", 
           			      "DISPLAY" => "",          			      
           		       	"FONT" => "",
           		       	"IMPLICIT" => "",
           			      "KBDMAP" => "",          			      
           		       	"MENMPW" => "",
           		       	"MENTIT" => "",                   			      
           		       	"NOESC" => "1",
           		       	"ONERR" => "",          			      
           		       	"ONTIME" => "",
           		       	"PROMPT" => "0",          			      
           		       	"SAY" => "",
           		       	"SERIAL" => "",
								"TIMEOUT" => "600",  			      
           		       	"NODEDN" => "cn=rbs,".$auDN,
           		       	"HDN" => "none",
								"HN" => "",
								"GDN" => "none",
								"GN" => "", 
           		       	"MNR" => $mnr,
           		       	"SBMNR" => $sbmnr));

#############################################
# RB Dienste holen
$rbsoffers = get_rbsoffers($auDN);

$template->assign(array("ALTRBSDN" => "",
   	                  "ALTRBSCN" => "",
   	                  "ALTRBSAU" => ""));

if (count($rbsoffers) != 0){
$template->define_dynamic("Altrbs", "Webseite");
	foreach ($rbsoffers as $item){
		$rbsdnexp = ldap_explode_dn($item,1);
		$rbsoffcn = $rbsdnexp[0];
		$rbsoffau = $rbsdnexp[2];
		#$auexp = explode(',',$item['auDN']);
		#$altrbsau = explode('=',$auexp[0]);
		$template->assign(array("ALTRBSDN" => $item,
   	                        "ALTRBSCN" => $rbsoffcn,
   	                        "ALTRBSAU" => " &nbsp;&nbsp;[ Abt.:  ".$rbsoffau." ]"));
   	$template->parse("ALTRBS_LIST", ".Altrbs");	
	} 
}

#################################################
# Ziel Objekt (nur Rechner und Gruppen, nicht Default)

$hostorgroup = $exp[0];
$hgexp = explode('=',$exp[0]);

$hosts_array = get_hosts($auDN,array("dn","hostname","hlprbservice","hwaddress"));
if ( count($hosts_array) != 0 ){
   $template->define_dynamic("Hosts", "Webseite");
   foreach ($hosts_array as $item){
      # Nur Hosts die in DHCP/TFTP angemeldet und deren MAC eingetragen ist (für PXE-Filename)
      if ( $item['hlprbservice'] != "" && $item['hwaddress'] != "" ){
   	   $template->assign(array("HDN" => $item['dn'],
                                 "HN" => $item['hostname']));
         $template->parse("HOSTS_LIST", ".Hosts");	
      }
   }
}

$groups_array = get_groups($auDN,array("dn","cn","hlprbservice"));
if ( count($groups_array) != 0 ){
   $template->define_dynamic("Groups", "Webseite");
   foreach ($groups_array as $item){
      if ( $item['hlprbservice'] != "" ){
      	$template->assign(array("GDN" => $item['dn'],
                                 "GN" => $item['cn']));
         $template->parse("GROUPS_LIST", ".Groups");
      }	
   }
}

###################################################################################

include("computers_footer.inc.php");

?>