summaryrefslogtreecommitdiffstats
path: root/ldap-site-mngmt/webinterface/ip/ip_rechner.php
blob: 66ea23ee5ba3bab81116101182a164cfac9579bb (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
<?php

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

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

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

include("ip_header.inc.php");

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

# Menuleiste erstellen
createMainMenu($rollen, $mainnr);
createIPMenu($rollen, $mnr);

include("ip_blocks.inc.php");

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

$template->assign(array("IP" => "",
                        "OLDIP" => "",
                        "DHCPCONT" => "",
                        "HOSTNAME" => "Noch keine Rechner angelegt",
                        "HOSTDN" => ""));

$host_array = get_hosts($auDN,array("dn","hostname","ipaddress","dhcphlpcont"));
# print_r ($host_array);

$template->define_dynamic("Hosts", "Webseite");

foreach ($host_array as $host){
	$hostip = explode('_',$host['ipaddress']);

	if ( count($host['dhcphlpcont']) != 0 && $host['ipaddress'] == "" ){
		$subnetCN = explode('cn=',$host['dhcphlpcont']);
		$dynsubnet = explode(',', $subnetCN[1]);
		$dhcpcont = " DYNAMISCH &nbsp;&nbsp;(DHCP, Subnet $dynsubnet[0])";	 
	}elseif( count($host['dhcphlpcont']) != 0 && $host['ipaddress'] != "" ){
		$subnetCN = explode('cn=',$host['dhcphlpcont']);
		$dynsubnet = explode(',', $subnetCN[1]);
		$dhcpcont = " STATISCH &nbsp;&nbsp;(DHCP, Subnet $dynsubnet[0])";
	}else{$dhcpcont = "";}
	
	$template->assign(array("IP" => $hostip[0],
                           "OLDIP" => $hostip[0],
                           "DHCPCONT" => $dhcpcont,
                           "HOSTNAME" => $host['hostname'],
                           "HOSTDN" => $host['dn'],
                           "AUDN" => $auDN ));
   $template->parse("HOSTS_LIST", ".Hosts");			
}


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

include("ip_footer.inc.php");

?>