diff options
author | Tarik Gasmi | 2007-09-18 17:18:38 +0200 |
---|---|---|
committer | Tarik Gasmi | 2007-09-18 17:18:38 +0200 |
commit | 12183ece8e4cb1bb81072a72f696572c8b3a07ee (patch) | |
tree | 1e7b274e6a4229d4d1819d4feaabe272b1037a62 /ldap-site-mngmt/webinterface/lib/host_management_functions.php | |
parent | Added theme.conf for openslx theme for pxe. Only labels should be added autom... (diff) | |
download | core-12183ece8e4cb1bb81072a72f696572c8b3a07ee.tar.gz core-12183ece8e4cb1bb81072a72f696572c8b3a07ee.tar.xz core-12183ece8e4cb1bb81072a72f696572c8b3a07ee.zip |
ldap-site-mngmt: actualized WebIF and DHCPConfig Generationscript
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1340 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'ldap-site-mngmt/webinterface/lib/host_management_functions.php')
-rw-r--r-- | ldap-site-mngmt/webinterface/lib/host_management_functions.php | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/ldap-site-mngmt/webinterface/lib/host_management_functions.php b/ldap-site-mngmt/webinterface/lib/host_management_functions.php index 31f358b8..8534371e 100644 --- a/ldap-site-mngmt/webinterface/lib/host_management_functions.php +++ b/ldap-site-mngmt/webinterface/lib/host_management_functions.php @@ -62,7 +62,7 @@ function modify_host_dn($hostDN, $newhostDN){ # Rechner neu anlegen -function add_host($hostDN,$hostname,$hostdesc,$mac,$ip,$atts){ +function add_host($hostDN,$hostname,$hostdesc,$mac,$ip,$atts,$dhcp){ global $ds, $suffix, $auDN, $assocdom, $ldapError; @@ -73,7 +73,12 @@ function add_host($hostDN,$hostname,$hostdesc,$mac,$ip,$atts){ $entryhost ["hostname"] = $hostname; $entryhost ["domainname"] = $assocdom; if ($hostdesc != ""){$entryhost ["description"] = $hostdesc;} - if ($mac != ""){$entryhost ["hwaddress"] = $mac;} + if ($mac != ""){ + $entryhost ["hwaddress"] = $mac; + if ($dhcp != "none" && $dhcp != ""){ + $entryhost ["dhcphlpcont"] = $dhcp; + } + } foreach (array_keys($atts) as $key){ if ($atts[$key] != ""){ $entryhost[$key] = $atts[$key]; @@ -91,14 +96,25 @@ function add_host($hostDN,$hostname,$hostdesc,$mac,$ip,$atts){ print_r($newip); echo "<br><br>"; if (new_ip_host($newip,$hostDN,$auDN)){ echo "IP erfolgreich eingetragen<br><br>"; + if ($mac != "" && $dhcp != "none" && $dhcp != ""){ + $entryfa ["dhcpoptfixed-address"] = "ip"; + if (ldap_mod_add($ds,$hostDN,$entryfa)){ + echo "DHCP Fixed-Address erfolgreich auf IP gesetzt<br><br>"; + }else{ + echo "Fehler beim Setzen der DHCP Fixed-Address<br><br>"; + } + } }else{ echo "Fehler beim eintragen der IP<br><br>"; } }else{ - echo "Falsche IP Syntax! IP nicht eingetragen"; + echo "Falsche IP Syntax! IP nicht eingetragen<br><br>"; } } - + echo "Rechner erfolgreich eingetragen"; + if ($mac != "" && $dhcp != "none" && $dhcp != ""){ + update_dhcpmtime(array()); + } return 1; } else{ |