summaryrefslogtreecommitdiffstats
path: root/ldap-site-mngmt/webinterface/computers
diff options
context:
space:
mode:
Diffstat (limited to 'ldap-site-mngmt/webinterface/computers')
-rw-r--r--ldap-site-mngmt/webinterface/computers/computers_menu.php33
-rw-r--r--ldap-site-mngmt/webinterface/computers/computers_start.dwt4
-rw-r--r--ldap-site-mngmt/webinterface/computers/delete_confirm.php2
-rw-r--r--ldap-site-mngmt/webinterface/computers/dhcphost.dwt15
-rw-r--r--ldap-site-mngmt/webinterface/computers/dhcphost.php18
-rw-r--r--ldap-site-mngmt/webinterface/computers/dhcphost_change.php101
-rw-r--r--ldap-site-mngmt/webinterface/computers/groupoverview.php3
-rw-r--r--ldap-site-mngmt/webinterface/computers/host.dwt1
-rw-r--r--ldap-site-mngmt/webinterface/computers/host_add.php6
-rw-r--r--ldap-site-mngmt/webinterface/computers/host_change.php14
-rw-r--r--ldap-site-mngmt/webinterface/computers/host_delete.php5
-rw-r--r--ldap-site-mngmt/webinterface/computers/new_host.dwt9
-rw-r--r--ldap-site-mngmt/webinterface/computers/new_host.php11
-rw-r--r--ldap-site-mngmt/webinterface/computers/new_pxe.php2
-rw-r--r--ldap-site-mngmt/webinterface/computers/rbshost.php71
-rw-r--r--ldap-site-mngmt/webinterface/computers/rbshost_change.php6
16 files changed, 219 insertions, 82 deletions
diff --git a/ldap-site-mngmt/webinterface/computers/computers_menu.php b/ldap-site-mngmt/webinterface/computers/computers_menu.php
index 564f9b28..201192ab 100644
--- a/ldap-site-mngmt/webinterface/computers/computers_menu.php
+++ b/ldap-site-mngmt/webinterface/computers/computers_menu.php
@@ -15,32 +15,27 @@ function createComputersMenu($rollen , $mnr, $auDN, $sbmnr, $mcnr) {
array("link" => "groupoverview.php",
"text" => "Rechnergruppen",
"zugriff" => array("MainAdmin","HostAdmin","DhcpAdmin")),
- array("link" => "machineconfig_default.php",
- "text" => "Default MachineConfigs",
- "zugriff" => array("MainAdmin","HostAdmin")),
- array("link" => "new_mcdef.php",
- "text" => "Neue MachineConfig",
- "zugriff" => array("MainAdmin","HostAdmin")),
+ #array("link" => "machineconfig_default.php",
+ # "text" => "Default MachineConfigs",
+ # "zugriff" => array("MainAdmin","HostAdmin")),
+ #array("link" => "new_mcdef.php",
+ # "text" => "Neue MachineConfig",
+ # "zugriff" => array("MainAdmin","HostAdmin")),
array("link" => "new_pxe.php",
"text" => "Neues PXE Bootmenü",
"zugriff" => array("MainAdmin","HostAdmin","DhcpAdmin")));
# Submenus
- #$comps = array();
- $computers_array = get_hosts($auDN,array("dn","hostname","ou"));
- #if (count($computers_array) != 0){
+ /*$computers_array = get_hosts($auDN,array("dn","hostname","ou"));
for($n=0;$n<count($computers_array);$n++){
$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 "<br>";
-
-
- }
- #}
- $comps[] = array("link" => "new_host.php?sbmnr=".$n,
- "text" => "Neuer Rechner",
+ }*/
+ $comps[] = array("link" => "new_host.php?sbmnr=0", #.$n,
+ "text" => "Neuen Rechner anlegen",
"zugriff" => array("MainAdmin","HostAdmin"));
$groups_array = get_groups($auDN,array("dn","cn"));
@@ -53,7 +48,7 @@ function createComputersMenu($rollen , $mnr, $auDN, $sbmnr, $mcnr) {
}
$groups[] = array("link" => "new_group.php?sbmnr=".$n,
- "text" => "Neue Gruppe",
+ "text" => "Neue Gruppe anlegen",
"zugriff" => array("MainAdmin","HostAdmin"));
# default machine-configs
@@ -140,14 +135,14 @@ function createComputersMenu($rollen , $mnr, $auDN, $sbmnr, $mcnr) {
}
}
$htmlcode= "
- <tr height='3'>
+ <tr height='4'>
<td></td><td></td><td></td><td></td>
</tr>
<tr>
<td width='8%'>&nbsp;</td>
<td width='8%' align='right'>".$zwisch2."</td>
- <td width='5%' align='left' style='border-width:1 0 1 1;border-color:#000000;border-style:solid;padding:2;background-color:{FARBE_S}'>&nbsp;</td>
- <td width='69%' align='left' style='border-width:1 1 1 0;border-color:#000000;border-style:solid;padding:2;padding-left:15px;background-color:{FARBE_S}'>
+ <td width='5%' align='left' style='border-width:1 0 1 1;border-color:#000000;border-style:solid;padding:4;background-color:{FARBE_S}'>&nbsp;</td>
+ <td width='69%' align='left' style='border-width:1 1 1 0;border-color:#000000;border-style:solid;padding:4;padding-left:12px;background-color:{FARBE_S}'>
<a href='".$item2['link']."' style='text-decoration:none'><b class='standard_schrift'>".$item2['text']."</b></a></td>
<td width='10%'>&nbsp;</td>
</tr>
diff --git a/ldap-site-mngmt/webinterface/computers/computers_start.dwt b/ldap-site-mngmt/webinterface/computers/computers_start.dwt
index 09cade01..378e5d76 100644
--- a/ldap-site-mngmt/webinterface/computers/computers_start.dwt
+++ b/ldap-site-mngmt/webinterface/computers/computers_start.dwt
@@ -21,7 +21,7 @@
ihre gemeinsamen Hardware-Parameter. Daneben verwalten Sie hier gruppen-spezifische
Computer-Profile (MachineConfig) und PXE Boot Konfigurationen.
</li>
- <li><p><b>Default MachineConfig</b></p>
+ <!-- <li><p><b>Default MachineConfig</b></p>
Hier verwalten Sie ihre Default Computer-Profile (bearbeiten, l&ouml;schen, kopieren),
d.h. Computer-Profile, die beim booten von Rechnern verwendet werden, f&uuml;r die
keine rechner- oder gruppen-spezifischen MachineConfigs angelegt sind.
@@ -29,7 +29,7 @@
<li><p><b>Neue MachineConfig</b></p>
Hier k&ouml;ennen Sie neue Computer-Profile (MachineConfigs) als rechner-, gruppen-
spezifische, oder Default MachineConfigs anlegen.
- </li>
+ </li> -->
<li><p><b>Neues PXE Bootmen&uuml;</b></p>
Hier k&ouml;nnen Sie neue PXE Bootmen&uuml;s (PXEConfigs) f&uuml;r ihre Rechner oder
Rechnergruppen anlegen.
diff --git a/ldap-site-mngmt/webinterface/computers/delete_confirm.php b/ldap-site-mngmt/webinterface/computers/delete_confirm.php
index c3f2bc8b..32eb4cf4 100644
--- a/ldap-site-mngmt/webinterface/computers/delete_confirm.php
+++ b/ldap-site-mngmt/webinterface/computers/delete_confirm.php
@@ -3,6 +3,7 @@ include('../standard_header.inc.php');
$dn = $_POST['dn'];
$name = $_POST['name'];
+$dhcphlpcont = $_POST['dhcphlpcont'];
$delurl = $_POST['delurl'];
$backurl = $_POST['backurl'];
$successurl = $_POST['successurl'];
@@ -23,6 +24,7 @@ echo "
Falls ja:<br><br>
<input type='hidden' name='dn' value='".$dn."'>
<input type='hidden' name='name' value='".$name."'>
+ <input type='hidden' name='dhcphlpcont' value='".$dhcphlpcont."'>
<input type='hidden' name='successurl' value='".$successurl."'>
<input type='hidden' name='pxedn' value='".$pxedn."'>
<input type='Submit' name='apply' value='l&ouml;schen' class='small_loginform_button'><br><br>
diff --git a/ldap-site-mngmt/webinterface/computers/dhcphost.dwt b/ldap-site-mngmt/webinterface/computers/dhcphost.dwt
index 2f381850..ba9a8872 100644
--- a/ldap-site-mngmt/webinterface/computers/dhcphost.dwt
+++ b/ldap-site-mngmt/webinterface/computers/dhcphost.dwt
@@ -32,6 +32,21 @@
</tr>
{HOST_DHCPOPT}
+
+ <tr>
+ <td style='border-color: black; border-style: solid; border-width: 0 0 0 0;'><b>Default Lease Time:</b></td>
+ <td colspan='2' style='border-color: black; border-style: solid; border-width: 0 0 0 0;'>
+ <input type='Text' name='attribs[dhcpoptdefault-lease-time]' value='{DEFAULTLEASE}' size='30' class='medium_form_field'>
+ <input type='hidden' name='oldattribs[dhcpoptdefault-lease-time]' value='{DEFAULTLEASE}'> &nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td style='border-color: black; border-style: solid; border-width: 0 0 1 0;'><b>Max Lease Time:</b></td>
+ <td colspan='2' style='border-color: black; border-style: solid; border-width: 0 0 1 0;'>
+ <input type='Text' name='attribs[dhcpoptmax-lease-time]' value='{MAXLEASE}' size='30' class='medium_form_field'>
+ <input type='hidden' name='oldattribs[dhcpoptmax-lease-time]' value='{MAXLEASE}'> &nbsp;
+ </td>
+ </tr>
</table></td>
</tr>
diff --git a/ldap-site-mngmt/webinterface/computers/dhcphost.php b/ldap-site-mngmt/webinterface/computers/dhcphost.php
index 3eb07d19..27ce686b 100644
--- a/ldap-site-mngmt/webinterface/computers/dhcphost.php
+++ b/ldap-site-mngmt/webinterface/computers/dhcphost.php
@@ -31,11 +31,13 @@ $hostDN = $_GET['dn'];
# Rechner Daten
$attributes = array("hostname","domainname","ipaddress","hwaddress","description","hlprbservice",
"dhcphlpcont","dhcpoptfixed-address","dhcpopthardware","dhcpoptfilename",
- "dhcpoptnext-server","hw-mouse","hw-graphic","hw-monitor");
+ "dhcpoptnext-server","dhcpoptmax-lease-time","dhcpoptdefault-lease-time","hw-mouse","hw-graphic","hw-monitor");
$host = get_node_data($hostDN,$attributes);
$hostip = explode('_',$host['ipaddress']);
# print_r($hostip); echo "<br><br>";
$dhcphlpcont = $host['dhcphlpcont'];
+$dhcpmaxlease = $host['dhcpoptmax-lease-time'];
+$dhcpdefaultlease = $host['dhcpoptdefault-lease-time'];
$objectDN = $dhcphlpcont;
$rbsDN = $host['hlprbservice'];
@@ -79,7 +81,8 @@ if ($dhcphlpcont == ""){
# Host in Service oder Subnet?
$objecttype = "service";
$dhcp = "";
- $ocarray = get_node_data($dhcphlpcont,array("objectclass","dhcphlpcont"));
+
+ /*$ocarray = get_node_data($dhcphlpcont,array("objectclass","dhcphlpcont"));
#print_r($ocarray); echo "<br>";
$sub = array_search('dhcpSubnet', $ocarray['objectclass']);
#print_r($sub);
@@ -89,7 +92,8 @@ if ($dhcphlpcont == ""){
$expsub = explode('=',$exp0[0]); $dhcpsub = $expsub[1];
$dhcp .= "Subnet <b>".$dhcpsub."</b> / ";
$dhcphlpcont = $ocarray['dhcphlpcont'];
- }
+ }*/
+
$exp1 = explode(',',$dhcphlpcont);
$expdhcp = explode('=',$exp1[0]); $dhcpserv = $expdhcp[1];
$expdhcpau = explode('=',$exp1[2]); $dhcpau = $expdhcpau[1];
@@ -146,9 +150,9 @@ if ($dhcphlpcont == ""){
<td class='tab_d_ohne'>&nbsp;</td>
</tr>
<tr valign='top'>
- <td class='tab_d'><b>fixed-address:</b> &nbsp;</td>
- <td class='tab_d'>".$fixedaddress."&nbsp;</td>
- <td class='tab_d'>
+ <td class='tab_d_ohne'><b>fixed-address:</b> &nbsp;</td>
+ <td class='tab_d_ohne'>".$fixedaddress."&nbsp;</td>
+ <td class='tab_d_ohne'>
<select name='fixadd' size='3' class='medium_form_selectbox'>
".$fixedaddselopt."
</select>
@@ -170,6 +174,8 @@ $template->assign(array("HOSTDN" => $hostDN,
"HOST_DHCPOPT" => $host_dhcpopt,
"NEXTSERVER" => $host['dhcpoptnext-server'],
"FILENAME" => $host['dhcpoptfilename'],
+ "DEFAULTLEASE" => $dhcpdefaultlease,
+ "MAXLEASE" => $dhcpmaxlease,
"HOSTLINK" => "<a href='host.php?dn=".$hostDN."&sbmnr=".$sbmnr."' class='headerlink'>",
"RBSLINK" => "<a href='rbshost.php?dn=".$hostDN."&sbmnr=".$sbmnr."' class='headerlink'>",
"HWLINK" => "<a href='hwhost.php?dn=".$hostDN."&sbmnr=".$sbmnr."' class='headerlink'>",
diff --git a/ldap-site-mngmt/webinterface/computers/dhcphost_change.php b/ldap-site-mngmt/webinterface/computers/dhcphost_change.php
index a35a29cb..9cd71f41 100644
--- a/ldap-site-mngmt/webinterface/computers/dhcphost_change.php
+++ b/ldap-site-mngmt/webinterface/computers/dhcphost_change.php
@@ -17,7 +17,21 @@ $sbmnr = $_POST['sbmnr'];
$dhcp = htmlentities($dhcp);
$olddhcp = htmlentities($olddhcp);
-
+# sonstige Attribute
+$attribs = $_POST['attribs'];
+if (count($attribs) != 0){
+ foreach (array_keys($attribs) as $key){
+ $atts[$key] = htmlentities($attribs[$key]);
+ }
+}
+#print_r($atts); echo "<br><br>";
+$oldattribs = $_POST['oldattribs'];
+if (count($oldattribs) != 0){
+ foreach (array_keys($oldattribs) as $key){
+ $oldatts[$key] = htmlentities($oldattribs[$key]);
+ }
+}
+#print_r($oldatts); echo "<br><br>";
/*echo "new dhcp:"; print_r($dhcp); echo "<br>";
echo "old dhcp:"; print_r($olddhcp); echo "<br>";
@@ -53,7 +67,7 @@ if ($dhcp != "none" && $dhcp != $olddhcp){
if ($olddhcp != ""){
echo "DHCP replace "; print_r($olddhcp); echo " with "; print_r($entrydhcp); echo "<br>";
if ($result = ldap_mod_replace($ds,$hostDN,$entrydhcp)){
- update_dhcpmtime();
+ update_dhcpmtime(array());
$mesg = "Rechner erfolgreich in DHCP <b>".$dhcpcn." [Abt.: ".$dhcpau."]</b> angemeldet<br><br>";
}else{
$mesg = "Fehler beim &auml;ndern des DHCP Dienstes zu <b>".$dhcpcn."</b>!<br><br>";
@@ -64,7 +78,7 @@ if ($dhcp != "none" && $dhcp != $olddhcp){
}
echo "DHCP add "; print_r($entrydhcp); echo "<br>";
if ($result = ldap_mod_add($ds,$hostDN,$entrydhcp)){
- update_dhcpmtime();
+ update_dhcpmtime(array());
$mesg = "Rechner erfolgreich in DHCP <b>".$dhcpcn." [Abt.: ".$dhcpau."]</b> angemeldet<br><br>";
}else{
$mesg = "Fehler beim &auml;ndern des DHCP Dienstes zu <b>".$dhcpcn."</b>!<br><br>";
@@ -80,7 +94,7 @@ if ($dhcp != "none" && $dhcp != $olddhcp){
#}
echo "DHCP delete "; echo "<br>";
if ($result = ldap_mod_del($ds,$hostDN,$entrydhcp)){
- update_dhcpmtime();
+ update_dhcpmtime(array());
$mesg = "Rechner erfolgreich aus DHCP gel&ouml;scht<br><br>";
}else{
$mesg = "Fehler beim l&ouml;schen aus DHCP Dienst!<br><br>";
@@ -99,7 +113,7 @@ if ($fixedaddress != "none" && $fixedaddress != $oldfixedaddress){
if ($oldfixedaddress != ""){
echo "Fixed Address &auml;ndern"; echo "<br>";
if ($result = ldap_mod_replace($ds,$hostDN,$entryfixadd)){
- update_dhcpmtime();
+ update_dhcpmtime(array());
$mesg = "Option Fixed-Address erfolgreich auf <b>".$fixedaddress."</b> ge&auml;ndert<br><br>";
}else{
$mesg = "Fehler beim &auml;ndern der Option Fixed-Address auf <b>".$fixedaddress."</b>!<br><br>";
@@ -107,7 +121,7 @@ if ($fixedaddress != "none" && $fixedaddress != $oldfixedaddress){
}else{
echo "Fixed Address auf IP Adresse setzen"; echo "<br>";
if ($result = ldap_mod_add($ds,$hostDN,$entryfixadd)){
- update_dhcpmtime();
+ update_dhcpmtime(array());
$mesg = "Option Fixed-Address erfolgreich auf <b>".$fixedaddress."</b> gesetzt<br><br>";
}else{
$mesg = "Fehler beim setzen der Option Fixed-Address auf <b>".$fixedaddress."</b>!<br><br>";
@@ -117,7 +131,7 @@ if ($fixedaddress != "none" && $fixedaddress != $oldfixedaddress){
$entryfixadd ['dhcpoptfixed-address'] = array();
echo "No Fixed Address"; echo "<br>";
if ($result = ldap_mod_del($ds,$hostDN,$entryfixadd)){
- update_dhcpmtime();
+ update_dhcpmtime(array());
$mesg = "Option Fixed-Address erfolgreich gel&ouml;scht<br><br>";
}else{
$mesg = "Fehler beim l&ouml;schen der Option Fixed-Address!<br><br>";
@@ -125,6 +139,79 @@ if ($fixedaddress != "none" && $fixedaddress != $oldfixedaddress){
}
}
+#####################################
+# Restliche Attribute (u.a. Description)
+
+$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 "<br>";
+#print_r($entrymod); echo "<br>";
+#print_r($entrydel); echo "<br>";
+
+
+if (count($entryadd) != 0 ){
+ #print_r($entryadd); echo "<br>";
+ #echo "neu anlegen<br>";
+ foreach (array_keys($entryadd) as $key){
+ $addatts .= "<b>".$key."</b>,";
+ }
+ if(ldap_mod_add($ds,$hostDN,$entryadd)){
+ $mesg = "Attribute ".$addatts." erfolgreich eingetragen<br><br>";
+ update_dhcpmtime(array());
+ }else{
+ $mesg = "Fehler beim eintragen der Attribute ".$addatts."<br><br>";
+ }
+}
+
+if (count($entrymod) != 0 ){
+ #print_r($entrymod); echo "<br>";
+ #echo "&auml;ndern<br>";
+ foreach (array_keys($entrymod) as $key){
+ $modatts .= "<b>".$key."</b>,";
+ }
+ if(ldap_mod_replace($ds,$hostDN,$entrymod)){
+ $mesg = "Attribute ".$modatts." erfolgreich geaendert<br><br>";
+ update_dhcpmtime(array());
+ }else{
+ $mesg = "Fehler beim aendern der Attribute ".$modatts."<br><br>";
+ }
+}
+
+if (count($entrydel) != 0 ){
+ #print_r($entrydel); echo "<br>";
+ #echo "l&ouml;schen<br>";
+ foreach (array_keys($entrydel) as $key){
+ $delatts .= "<b>".$key."</b>,";
+ }
+ if(ldap_mod_del($ds,$hostDN,$entrydel)){
+ $mesg = "Attribute ".$delatts." erfolgreich geloescht<br><br>";
+ update_dhcpmtime(array());
+ }else{
+ $mesg = "Fehler beim loeschen der Attribute ".$delatts."<br><br>";
+ }
+}
+
#####################
diff --git a/ldap-site-mngmt/webinterface/computers/groupoverview.php b/ldap-site-mngmt/webinterface/computers/groupoverview.php
index b9f9ce05..15424fbd 100644
--- a/ldap-site-mngmt/webinterface/computers/groupoverview.php
+++ b/ldap-site-mngmt/webinterface/computers/groupoverview.php
@@ -37,6 +37,7 @@ $template->define_dynamic("Gruppen", "Webseite");
foreach ($group_array as $group){
+ $groupname = "<a href='group.php?dn=".$group['dn']."&sbmnr=".$i."' class='headerlink'>".$group['cn']."</a>";
$anzahlmember = count($group['member']);
if ( count($group['dhcphlpcont']) != 0 ){
@@ -46,7 +47,7 @@ foreach ($group_array as $group){
}else{$dhcpcont = "";}
$template->assign(array("DN" => $group['dn'],
- "GROUPCN" => $group['cn'],
+ "GROUPCN" => $groupname,
"GROUPDESC" => $group['description'],
"MEMBERS" => $anzahlmember,
# "MEMBER" => $group['member'],
diff --git a/ldap-site-mngmt/webinterface/computers/host.dwt b/ldap-site-mngmt/webinterface/computers/host.dwt
index 8eedca62..bd05e75b 100644
--- a/ldap-site-mngmt/webinterface/computers/host.dwt
+++ b/ldap-site-mngmt/webinterface/computers/host.dwt
@@ -109,6 +109,7 @@
<input type='hidden' name='dn' value='{HOSTDN}'>
<input type='hidden' name='name' value='{HOSTNAME}'>
+ <input type='hidden' name='dhcphlpcont' value='{DHCPCONT}'>
<input type='hidden' name='delurl' value='host_delete.php'>
<input type='hidden' name='backurl' value='host.php?dn={HOSTDN}&sbmnr={SBMNR}'>
diff --git a/ldap-site-mngmt/webinterface/computers/host_add.php b/ldap-site-mngmt/webinterface/computers/host_add.php
index bde6f26a..0f01fe75 100644
--- a/ldap-site-mngmt/webinterface/computers/host_add.php
+++ b/ldap-site-mngmt/webinterface/computers/host_add.php
@@ -5,7 +5,7 @@ $hostname = $_POST['hostname'];
$hostdesc = $_POST['hostdesc'];
$mac = $_POST['mac'];
$ip = $_POST['ip'];
-
+$dhcp = $_POST['dhcpcont'];
$hostname = htmlentities($hostname);
$hostdesc = htmlentities($hostdesc);
@@ -67,13 +67,15 @@ if ( $hostname != ""){
$hostDN = "HostName=".$hostname.",cn=computers,".$auDN;
# print_r($hostDN); echo "<br>";
- if (add_host($hostDN,$hostname,$hostdesc,$mac,$ip,$atts)){
+ if (add_host($hostDN,$hostname,$hostdesc,$mac,$ip,$atts,$dhcp)){
$mesg .= "<br>Neuer Rechner erfolgreich angelegt<br>";
}
else{
$mesg .= "<br>Fehler beim anlegen des Rechners!<br>";
}
+ # DHCP
+
$url = 'hostoverview.php';
}
}
diff --git a/ldap-site-mngmt/webinterface/computers/host_change.php b/ldap-site-mngmt/webinterface/computers/host_change.php
index a0e149b7..52df970f 100644
--- a/ldap-site-mngmt/webinterface/computers/host_change.php
+++ b/ldap-site-mngmt/webinterface/computers/host_change.php
@@ -57,7 +57,7 @@ echo "Host DN:"; print_r($hostDN); echo "<br>";
echo "submenuNR:"; print_r($submenu); echo "<br><br>";
*/
-$seconds = 200;
+$seconds = 2;
$url = 'host.php?dn='.$hostDN.'&sbmnr='.$sbmnr;
echo "
@@ -89,6 +89,7 @@ if ( $oldhostname != "" && $hostname != "" && $oldhostname != $hostname ){
$newhostDN = "hostname=".$hostname.",cn=computers,".$auDN;
# print_r($newhostDN); echo "<br><br>";
modify_host_dn($hostDN, $newhostDN);
+ $hostDN = $newhostDN;
# newsubmenu holen...hosts neu holen, sortieren, ->position
#$newhosts = get_hosts($auDN,array("dn"));
@@ -231,9 +232,9 @@ if ( $oldip == "" && $ip != "" ){
# print_r($newip); echo "<br><br>";
if (new_ip_host($newip,$hostDN,$auDN)){
$mesg = "IP erfolgreich eingetragen<br><br>";
- if ($dhcptype == "subnet"){
- adjust_hostip_dhcpsubnet($ip,$hostDN,$dhcphlpcont);
- }
+ #if ($dhcptype == "subnet"){
+ # adjust_hostip_dhcpsubnet($ip,$hostDN,$dhcphlpcont);
+ #}
}else{
$mesg = "Fehler beim eintragen der IP<br><br>";
}
@@ -389,8 +390,9 @@ if (count($entrydel) != 0 ){
}
*/
-
-update_dhcpmtime();
+if ( $dhcphlpcont != "" ){
+ update_dhcpmtime(array());
+}
$mesg .= "<br>Sie werden automatisch auf die vorherige Seite zur&uuml;ckgeleitet. <br>
Falls nicht, klicken Sie hier <a href=".$url." style='publink'>back</a>";
diff --git a/ldap-site-mngmt/webinterface/computers/host_delete.php b/ldap-site-mngmt/webinterface/computers/host_delete.php
index 0470ed91..4d7a935b 100644
--- a/ldap-site-mngmt/webinterface/computers/host_delete.php
+++ b/ldap-site-mngmt/webinterface/computers/host_delete.php
@@ -3,6 +3,7 @@ include('../standard_header.inc.php');
$hostDN = $_POST['dn'];
$hostname = $_POST['name'];
+$dhcphlpcont = $_POST['dhcphlpcont'];
$hostDN = htmlentities($hostDN);
$hostname = htmlentities($hostname);
@@ -28,7 +29,9 @@ echo "
if ( $hostDN != ""){
if ( delete_host($hostDN) ){
- update_dhcpmtime();
+ if ( $dhcphlpcont != "" ){
+ update_dhcpmtime(array());
+ }
$mesg = "Rechner <b>".$hostname."</b> erfolgreich gel&ouml;scht!<br><br>";
}
else{
diff --git a/ldap-site-mngmt/webinterface/computers/new_host.dwt b/ldap-site-mngmt/webinterface/computers/new_host.dwt
index b9bccec4..43625f57 100644
--- a/ldap-site-mngmt/webinterface/computers/new_host.dwt
+++ b/ldap-site-mngmt/webinterface/computers/new_host.dwt
@@ -76,6 +76,15 @@
<input type='Text' name='attribs[hw-monitor]' value='{MONITOR}' size='30' class='medium_form_field'>
</td>
</tr>
+ <tr>
+ <td style='border-color: black; border-style: solid; border-width: 0 0 1 0;'><b>DHCP: </b>&nbsp;</td>
+ <td style='border-color: black; border-style: solid; border-width: 0 0 1 0;'>
+ <select name='dhcpcont' size='2' class='medium_form_selectbox'>
+ <option selected value='none'>----------</option>
+ {DHCPSELECT}
+ </select>
+ </td>
+ </tr>
</table></td>
</tr>
diff --git a/ldap-site-mngmt/webinterface/computers/new_host.php b/ldap-site-mngmt/webinterface/computers/new_host.php
index 92184308..507fc0ac 100644
--- a/ldap-site-mngmt/webinterface/computers/new_host.php
+++ b/ldap-site-mngmt/webinterface/computers/new_host.php
@@ -32,11 +32,22 @@ $hostdesc = str_replace ( "_", " ", $_GET['hostdesc']);
$mac = str_replace ( "_", " ", $_GET['mac']);
$ip = str_replace ( "_", " ", $_GET['ip']);
+# DHCP Einbindung
+$objecttype = "nodhcp";
+$dhcp_selectbox = "";
+$altdhcp = alternative_dhcpobjects($objecttype,"","");
+if (count($altdhcp) != 0){
+ foreach ($altdhcp as $item){
+ $dhcp_selectbox .= "
+ <option value='".$item['dn']."'>".$item['cn']." ".$item['au']."</option>";
+ }
+}
$template->assign(array("HOSTNAME" => $hostname,
"HOSTDESC" => $hostdesc,
"MAC" => $mac,
"IP" => $ip,
+ "DHCPSELECT" => $dhcp_selectbox,
"MOUSE" => "",
"GRAPHIC" => "",
"MONITOR" => "",
diff --git a/ldap-site-mngmt/webinterface/computers/new_pxe.php b/ldap-site-mngmt/webinterface/computers/new_pxe.php
index 07890505..8eef2888 100644
--- a/ldap-site-mngmt/webinterface/computers/new_pxe.php
+++ b/ldap-site-mngmt/webinterface/computers/new_pxe.php
@@ -6,7 +6,7 @@ include('../standard_header.inc.php');
$titel = "Computers Management";
# 2. Nummer des zugehörigen Hauptmenus (Registerkarte) beginnend bei 0, siehe Dokumentation.doc.
$mainnr = 3;
-$mnr = 5;
+$mnr = 3;
$sbmnr = -1;
$mcnr = -1;
# 3. Dateiname und evtl. Pfad des Templates für die Webseite
diff --git a/ldap-site-mngmt/webinterface/computers/rbshost.php b/ldap-site-mngmt/webinterface/computers/rbshost.php
index 438009ed..3d53ba0a 100644
--- a/ldap-site-mngmt/webinterface/computers/rbshost.php
+++ b/ldap-site-mngmt/webinterface/computers/rbshost.php
@@ -108,8 +108,8 @@ if ($rbsDN == ""){
</tr>";
$rbs_dhcpopt = "";
-}
+}
$template->assign(array("HOSTDN" => $hostDN,
@@ -170,43 +170,46 @@ if (count($hostpxeconfigs) != 0){
}
}
-# Default PXEs des RBS
-$defaultpxeconfigs = get_pxeconfigs($rbsDN,array("dn","cn","description","timerange","filename"));
+# Default PXEs des RBS
$template->assign(array("DEFPXEDN" => "",
- "DEFPXECN" => "Keine PXE Config angelegt",
- "DEFPXEDESC" => "",
- "DEFPXETR" => "",));
+ "DEFPXECN" => "Keine PXE Config angelegt",
+ "DEFPXEDESC" => "",
+ "DEFPXETR" => "",));
$template->define_dynamic("Defpxes", "Webseite");
-if (count($defaultpxeconfigs) != 0){
- for ($i=0;$i<count($defaultpxeconfigs);$i++){
- if ($defaultpxeconfigs[$i]['filename'] == "default"){
- $defpxelink = "<a href='showpxe.php?dn=".$defaultpxeconfigs[$i]['dn']."&mnr=1&sbmnr=".$sbmnr."&mcnr=-1&hostdn=".$hostDN."' class='headerlink'>".$defaultpxeconfigs[$i]['cn']."</a>";
-
- $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&auml;glich";}
- # if ($exptime[1] == "X" && $exptime[2] == "X"){$exptime[1] = ""; $exptime[2]= "";}
- $deftrange .= $exptime[0].", von ".$exptime[1].":00 bis ".$exptime[2].":59 <br> ";
- }
- }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&auml;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");
- }
+if ($rbsDN != ""){
+ $defaultpxeconfigs = get_pxeconfigs($rbsDN,array("dn","cn","description","timerange","filename"));
+
+ if (count($defaultpxeconfigs) != 0){
+ for ($i=0;$i<count($defaultpxeconfigs);$i++){
+ if ($defaultpxeconfigs[$i]['filename'] == "default"){
+ $defpxelink = "<a href='showpxe.php?dn=".$defaultpxeconfigs[$i]['dn']."&mnr=1&sbmnr=".$sbmnr."&mcnr=-1&hostdn=".$hostDN."' class='headerlink'>".$defaultpxeconfigs[$i]['cn']."</a>";
+
+ $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&auml;glich";}
+ # if ($exptime[1] == "X" && $exptime[2] == "X"){$exptime[1] = ""; $exptime[2]= "";}
+ $deftrange .= $exptime[0].", von ".$exptime[1].":00 bis ".$exptime[2].":59 <br> ";
+ }
+ }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&auml;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");
+ }
+ }
}
}
diff --git a/ldap-site-mngmt/webinterface/computers/rbshost_change.php b/ldap-site-mngmt/webinterface/computers/rbshost_change.php
index edff80bc..179451ad 100644
--- a/ldap-site-mngmt/webinterface/computers/rbshost_change.php
+++ b/ldap-site-mngmt/webinterface/computers/rbshost_change.php
@@ -53,7 +53,7 @@ if ($rbs != "none" && $rbs != $oldrbs){
if ($oldrbs != ""){
echo "RBS replace "; print_r($oldrbs); echo " with "; print_r($entryrbs); echo "<br>";
if ($result = ldap_mod_replace($ds,$hostDN,$entryrbs)){
- update_dhcpmtime();
+ update_dhcpmtime(array());
rbs_adjust_host($hostDN, $rbs);
$mesg = "Remote Boot Service erfolgreich zu <b>".$rbscn." [Abt.: ".$rbsau."]</b> ge&auml;ndert<br><br>";
}else{
@@ -62,7 +62,7 @@ if ($rbs != "none" && $rbs != $oldrbs){
}else{
echo "RBS add "; print_r($entryrbs); echo "<br>";
if ($result = ldap_mod_add($ds,$hostDN,$entryrbs)){
- update_dhcpmtime();
+ update_dhcpmtime(array());
rbs_adjust_host($hostDN, $rbs);
$mesg = "Remote Boot Service erfolgreich zu <b>".$rbscn." [Abt.: ".$rbsau."]</b> ge&auml;ndert<br><br>";
}else{
@@ -75,7 +75,7 @@ if ($rbs != "none" && $rbs != $oldrbs){
$entryrbs ['dhcpoptfilename'] = array();
echo "RBS delete "; echo "<br>";
if ($result = ldap_mod_del($ds,$hostDN,$entryrbs)){
- update_dhcpmtime();
+ update_dhcpmtime(array());
$mesg = "Rechner erfolgreich aus RBS gel&ouml;scht<br><br>";
}else{
$mesg = "Fehler beim l&ouml;schen aus RBS!<br><br>";