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
|
<?php
include('../standard_header.inc.php');
# 3. Dateiname und evtl. Pfad des Templates für die Webseite
$webseite = "ip_rechner.dwt";
include('computers_header.inc.php');
#############################################################################
$mnr = 1;
$sbmnr = -1;
$mcnr = -1;
# Menuleiste erstellen
createMainMenu($rollen, $mainnr);
createComputersMenu($rollen, $mnr, $auDN, $sbmnr, $mcnr);
#############################################################################
$sort = "hostname";
$sort = $_GET['sort'];
$template->assign(array("IP" => "",
"OLDIP" => "",
"DHCPCONT" => "",
"FIXADD" => "",
"HOSTNAME" => "Noch keine Rechner angelegt",
"HOSTDN" => ""));
$host_array = get_hosts($auDN,array("dn","hostname","ipaddress","dhcphlpcont","dhcpoptfixed-address"),$sort);
# print_r ($host_array);
if ($sort == "ipaddress"){
$host_array = array_natsort($host_array, "ipaddress", "ipaddress");
}
$template->define_dynamic("Hosts", "Webseite");
foreach ($host_array as $host){
$hostip = explode('_',$host['ipaddress']);
$dhcpcont = "";
$fixadd = "";
if ( count($host['dhcphlpcont']) != 0 ){ #&& $host['ipaddress'] == "" ){
$dhcpcont = " dynamisch";
#$fixadd = $host['dhcpoptfixed-address'];
#}elseif( count($host['dhcphlpcont']) != 0 && $host['ipaddress'] != "" ){
if ( $host['dhcpoptfixed-address'] == "ip") {
$dhcpcont = " fix";
#$fixadd = $host['dhcpoptfixed-address'];
}
if ( $host['dhcpoptfixed-address'] == "hostname") {
$dhcpcont = " fix (über DNS Name)";
#$fixadd = $host['dhcpoptfixed-address'];
}
$fixadd = $host['dhcpoptfixed-address'];
}
$template->assign(array("IP" => $hostip[0],
"OLDIP" => $hostip[0],
"DHCPCONT" => $dhcpcont,
"FIXADD" => $fixadd,
"HOSTNAME" => $host['hostname'],
"HOSTDN" => $host['dn'],
"AUDN" => $auDN ));
$template->parse("HOSTS_LIST", ".Hosts");
}
#####################################################################################
include("computers_footer.inc.php");
?>
|