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/rbshost_change.php | 95 ++++++++++++++++++++++
1 file changed, 95 insertions(+)
create mode 100644 ldap-site-mngmt/webinterface/computers/rbshost_change.php
(limited to 'ldap-site-mngmt/webinterface/computers/rbshost_change.php')
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 "
+
+
| ";
+
+
+##########################################
+# 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 " |