From a03c4c6f322627b10ac3d9f66978fd0fbf035378 Mon Sep 17 00:00:00 2001 From: Tarik Gasmi Date: Thu, 7 Jun 2007 17:50:06 +0000 Subject: Aktuelle Version LDAP-Site-Mngmt Webinterface git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1157 95ad53e4-c205-0410-b2fa-d234c58c8868 --- .../webinterface/lib/rbs_management_functions.php | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'ldap-site-mngmt/webinterface/lib/rbs_management_functions.php') diff --git a/ldap-site-mngmt/webinterface/lib/rbs_management_functions.php b/ldap-site-mngmt/webinterface/lib/rbs_management_functions.php index 6b1f42fd..cc73595e 100644 --- a/ldap-site-mngmt/webinterface/lib/rbs_management_functions.php +++ b/ldap-site-mngmt/webinterface/lib/rbs_management_functions.php @@ -194,6 +194,56 @@ function rbs_adjust_host($hostDN, $rbs){ } } +# Bei Änderung der TFTP Server IP eines RBS-Objekts entsprechend DHCP Option next-server +# in den Hostobjekten anpassen +function adjust_dhcpnextserver($tftpIP, $rbsDN){ + + global $ds, $suffix, $ldapError; + + if(!($result = uniLdapSearch($ds, "ou=RIPM,".$suffix, "(&(objectclass=Host)(hlprbservice=$rbsDN))", array("dn"), "dn", "sub", 0, 0))) { + # redirect(5, "", $ldapError, FALSE); + echo "no search"; + die; + } + $result = ldapArraySauber($result); + $modtftpentry ['dhcpoptnext-server'] = $tftpIP; + foreach ($result as $item){ + ldap_mod_replace($ds, $item['dn'], $modtftpentry); + } +} + +# Bei Änderung des PXE Init Boot File eines RBS-Objekts entsprechend DHCP Option Filename +# in den Hostobjekten anpassen +function adjust_dhcpfilename($initbootfile, $rbsDN, $type){ + + global $ds, $suffix, $ldapError; + + if(!($result = uniLdapSearch($ds, "ou=RIPM,".$suffix, "(&(objectclass=Host)(hlprbservice=$rbsDN))", array("dn"), "dn", "sub", 0, 0))) { + # redirect(5, "", $ldapError, FALSE); + echo "no search"; + die; + } + $result = ldapArraySauber($result); + if ($type == "add"){ + $modentry ['dhcpoptfilename'] = $initbootfile; + foreach ($result as $item){ + ldap_mod_add($ds, $item['dn'], $modentry); + } + } + elseif ($type == "delete"){ + $modentry ['dhcpoptfilename'] = array(); + foreach ($result as $item){ + ldap_mod_del($ds, $item['dn'], $modentry); + } + } + elseif ($type == "replace"){ + $modentry ['dhcpoptfilename'] = $initbootfile; + foreach ($result as $item){ + ldap_mod_replace($ds, $item['dn'], $modentry); + } + } +} + # # Sucht den Hostname zu einer IP im Rechnerteilbaum der AU -- cgit v1.2.3-55-g7522