summaryrefslogtreecommitdiffstats
path: root/ldap-site-mngmt
diff options
context:
space:
mode:
authorTarik Gasmi2007-06-07 19:50:06 +0200
committerTarik Gasmi2007-06-07 19:50:06 +0200
commita03c4c6f322627b10ac3d9f66978fd0fbf035378 (patch)
tree4398409cf4886b2040139ae8df08b463713141aa /ldap-site-mngmt
parentAktuelle Version LDAP-Site-Mngmt Webinterface (diff)
downloadcore-a03c4c6f322627b10ac3d9f66978fd0fbf035378.tar.gz
core-a03c4c6f322627b10ac3d9f66978fd0fbf035378.tar.xz
core-a03c4c6f322627b10ac3d9f66978fd0fbf035378.zip
Aktuelle Version LDAP-Site-Mngmt Webinterface
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1157 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'ldap-site-mngmt')
-rw-r--r--ldap-site-mngmt/webinterface/lib/ldap.inc.php10
-rw-r--r--ldap-site-mngmt/webinterface/lib/rbs_management_functions.php50
-rw-r--r--ldap-site-mngmt/webinterface/rbs/gbm.php5
-rw-r--r--ldap-site-mngmt/webinterface/rbs/pxe.dwt2
-rw-r--r--ldap-site-mngmt/webinterface/rbs/pxe.php1
-rw-r--r--ldap-site-mngmt/webinterface/rbs/rbservice.dwt4
-rw-r--r--ldap-site-mngmt/webinterface/rbs/rbservice.php2
-rw-r--r--ldap-site-mngmt/webinterface/rbs/rbservice_change.php47
8 files changed, 109 insertions, 12 deletions
diff --git a/ldap-site-mngmt/webinterface/lib/ldap.inc.php b/ldap-site-mngmt/webinterface/lib/ldap.inc.php
index 793a54a4..60a83e0d 100644
--- a/ldap-site-mngmt/webinterface/lib/ldap.inc.php
+++ b/ldap-site-mngmt/webinterface/lib/ldap.inc.php
@@ -34,7 +34,7 @@ function uniLdapConnect($userRdn = "", $userPwd = "") {
# Connect zum LDAP-Server OK
if(ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {
# Optionen gesetzt
- if (ldap_start_tls($ds)){
+ #if (ldap_start_tls($ds)){
if($userRdn != "" && $userPwd != "") {
# Anmeldung als User.
if($result = @ldap_bind($ds, "uid=".$userRdn.",ou=people,".$suffix, $userPwd)) {
@@ -61,10 +61,10 @@ function uniLdapConnect($userRdn = "", $userPwd = "") {
return false;
}
}
- } else {
- # TLS starten fehlgeschlagen
- $ldapError .= "TLS starten fehlgeschlagen: ".ldap_error($ds)."<br>\n";
- }
+ #} else {
+ # # TLS starten fehlgeschlagen
+ # $ldapError .= "TLS starten fehlgeschlagen: ".ldap_error($ds)."<br>\n";
+ #}
} else {
# Optionen setzen fehlgeschlagen
$ldapError .= "Protokollversion setzen fehlgeschlagen: ".ldap_error($ds)."<br>\n";
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
diff --git a/ldap-site-mngmt/webinterface/rbs/gbm.php b/ldap-site-mngmt/webinterface/rbs/gbm.php
index 59aefc5a..0efe7922 100644
--- a/ldap-site-mngmt/webinterface/rbs/gbm.php
+++ b/ldap-site-mngmt/webinterface/rbs/gbm.php
@@ -80,14 +80,15 @@ if ($gbm['rootfstype'] == 'dnbd'){
</select>
<input type='hidden' name='oldrootfstype' value='".$gbm['rootfstype']."'>";
}
-if ($gbm['rootfstype'] != 'nfs' && $gbm['rootfstype'] != 'nbd' && $gbm['rootfstype'] != 'dnbd'){
+#if ($gbm['rootfstype'] != 'nfs' && $gbm['rootfstype'] != 'nbd' && $gbm['rootfstype'] != 'dnbd'){
+if ($gbm['rootfstype'] == 'none' ){
$options = "<select name='rootfstype' size='4' class='rootfs_form_selectbox'>
<option value='' selected>---------------------------------</option>
<option value='nfs'><b>nfs://".$rbs_data['nfsserverip'].":/".$rbs_data['exportpath']."</b></option>
<option value='nbd'>nbd://".$rbs_data['nbdserverip'].":</option>
<option value='dnbd'>dnbd://".$rbs_data['nbdserverip'].":</option>
</select>
- <input type='hidden' name='oldrootfstype' value=''>";
+ <input type='hidden' name='oldrootfstype' value='".$gbm['rootfstype']."'>";
}
diff --git a/ldap-site-mngmt/webinterface/rbs/pxe.dwt b/ldap-site-mngmt/webinterface/rbs/pxe.dwt
index 4ce35565..4b881338 100644
--- a/ldap-site-mngmt/webinterface/rbs/pxe.dwt
+++ b/ldap-site-mngmt/webinterface/rbs/pxe.dwt
@@ -24,7 +24,7 @@
<!-- BEGIN DYNAMIC BLOCK: Bootmenu -->
<form action='delete_confirm.php' method='post'>
<tr>
- <td style='border-color: black; border-style: solid; border-width: 0 0 1 0;{BGCDEF}'>{POSITION}&nbsp;</td>
+ <td style='border-color: black; border-style: solid; border-width: 0 0 1 0;{BGCDEF}'>{BACKLINK}{POSITION}</a></td>
<td style='border-color: black; border-style: solid; border-width: 0 0 1 0;{BGCDEF}'>{MEDEF} {MEPWD} {MEHIDE}&nbsp;</td>
<td style='border-color: black; border-style: solid; border-width: 0 0 1 0;{BGCDEF}'><font size='+1'>{ANZEIGE}&nbsp;</font></td>
<td style='border-color: black; border-style: solid; border-width: 0 0 1 0;{BGCDEF}'>
diff --git a/ldap-site-mngmt/webinterface/rbs/pxe.php b/ldap-site-mngmt/webinterface/rbs/pxe.php
index 85df99ac..f9671d22 100644
--- a/ldap-site-mngmt/webinterface/rbs/pxe.php
+++ b/ldap-site-mngmt/webinterface/rbs/pxe.php
@@ -168,6 +168,7 @@ foreach ($menuentries as $me){
if ($me['menupasswd'] != ""){$mepwd = "<b>P</b>";}
if ($me['menuhide'] == 1){$mehide = "<b>H</b>"; $bgcdef = "background-color:#A0A0A0;";}
$template->assign(array("MENDN" => $me['dn'],
+ "BACKLINK" => "<a href='menuentry.php?dn=".$me['dn']."&mnr=".$mnr."&sbmnr=".$sbmnr."&mcnr=".$mcnr."' class='headerlink'>",
"ANZEIGE" => "<a href='menuentry.php?dn=".$me['dn']."&mnr=".$mnr."&sbmnr=".$sbmnr."&mcnr=".$mcnr."' class='headerlink'>".$anzeige."</a>",
"ANZEIGENAME" => $anzeige,
"POSITION" => $me['menuposition'],
diff --git a/ldap-site-mngmt/webinterface/rbs/rbservice.dwt b/ldap-site-mngmt/webinterface/rbs/rbservice.dwt
index c2af43fb..93e70898 100644
--- a/ldap-site-mngmt/webinterface/rbs/rbservice.dwt
+++ b/ldap-site-mngmt/webinterface/rbs/rbservice.dwt
@@ -71,8 +71,8 @@
<input type='hidden' name='oldtftpserverip' value='{TFTPIP}'></td>
<td width='15%' style='border-color: black; border-style: solid; border-width: 0 0 0 0;'>Init Boot File</td>
<td width='35%' style='border-color: black; border-style: solid; border-width: 0 0 0 0;'>
- <input type='Text' name='attribs[initbootfile]' value='{INITBOOTFILE}' size='25' class='medium_form_field'>
- <input type='hidden' name='oldattribs[initbootfile]' value='{INITBOOTFILE}'></td>
+ <input type='Text' name='initbootfile' value='{INITBOOTFILE}' size='25' class='medium_form_field'>
+ <input type='hidden' name='oldinitbootfile' value='{INITBOOTFILE}'></td>
</tr>
<tr valign='top'>
<td style='border-color: black; border-style: solid; border-width: 0 0 0 0;'><font size='+1'>{TFTP}</font></td>
diff --git a/ldap-site-mngmt/webinterface/rbs/rbservice.php b/ldap-site-mngmt/webinterface/rbs/rbservice.php
index 73dde633..896acbf8 100644
--- a/ldap-site-mngmt/webinterface/rbs/rbservice.php
+++ b/ldap-site-mngmt/webinterface/rbs/rbservice.php
@@ -129,7 +129,7 @@ foreach ($hosts_array as $item){
################################################
# PXE Generator Skript Config
-$pxegen_ldap = "ldap://".LDAP_HOST;
+$pxegen_ldap = LDAP_HOST;
$pxegen_base = "ou=RIPM,".$suffix;
$pxegen_udn = $userDN;
$pxegen_pw = $userPassword;
diff --git a/ldap-site-mngmt/webinterface/rbs/rbservice_change.php b/ldap-site-mngmt/webinterface/rbs/rbservice_change.php
index e5419c36..a9bc065f 100644
--- a/ldap-site-mngmt/webinterface/rbs/rbservice_change.php
+++ b/ldap-site-mngmt/webinterface/rbs/rbservice_change.php
@@ -20,6 +20,9 @@ $oldtftpserverdn = $_POST['oldtftpserverdn'];
$oldnfsserverdn = $_POST['oldnfsserverdn'];
$oldnbdserverdn = $_POST['oldnbdserverdn'];
+$initbootfile = $_POST['initbootfile'];
+$oldinitbootfile = $_POST['oldinitbootfile'];
+
$host_array = get_hosts($auDN,array("dn","hostname","ipaddress"));
$rbsDN = $_POST['rbsdn'];
@@ -141,6 +144,7 @@ if ( $tftpserverip != "" && $tftpserverip != $oldtftpserverip ){
if ($tftpserverip == $hostip){
$entrytftp ['tftpserverip'] = $tftpserverip;
if (ldap_mod_replace($ds,$rbsDN,$entrytftp)){
+ adjust_dhcpnextserver($tftpserverip, $rbsDN);
$mesg .= "Treffer: Rechner ".$host['hostname']."<br>TFTP Server erfolgreich ge&auml;ndert<br>";
}else{
$mesg .= "Fehler beim &auml;ndern des TFTP Servers!<br>";
@@ -220,6 +224,7 @@ if ($tftpserver != "none" && $tftpserver != $oldtftpserverdn){
$hostip = $hostipexp[0];
$entrytftp ['tftpserverip'] = $hostip;
if (ldap_mod_replace($ds,$rbsDN,$entrytftp)){
+ adjust_dhcpnextserver($tftpserverip, $rbsDN);
$mesg .= "TFTP Server erfolgreich ge&auml;ndert<br>";
}else{
$mesg .= "Fehler beim &auml;ndern des TFTP Servers!<br>";
@@ -253,7 +258,47 @@ if ($nbdserver != "none" && $nbdserver != $oldnbdserverdn){
$mesg .= "Fehler beim &auml;ndern des NBD Servers!<br>";
}
-}
+}
+
+#####################################
+# Init Boot File
+
+if ( $initbootfile == $oldinitbootfile ){
+ # $mesg = "keine Aenderung<br>";
+}
+
+if ( $initbootfile != "" && $oldinitbootfile == "" ){
+ $entrydelibf ['initbootfile'] = $initbootfile;
+ if(ldap_mod_add($ds,$rbsDN,$entrydelibf)){
+ adjust_dhcpfilename($initbootfile, $rbsDN, "add");
+ $mesg = "Initial Boot File erfolgreich eingetragen<br><br>";
+ }
+ else{
+ $mesg = "Fehler beim eintragen von Initial Boot File!<br><br>";
+ }
+}
+
+if ( $initbootfile == "" && $oldinitbootfile != "" ){
+ $entrydelibf ['initbootfile'] = array();
+ if(ldap_mod_del($ds,$rbsDN,$entrydelibf)){
+ adjust_dhcpfilename($initbootfile, $rbsDN, "delete");
+ $mesg = "Initial Boot File erfolgreich gel&ouml;scht<br><br>";
+ }
+ else{
+ $mesg = "Fehler beim l&ouml;schen von Initial Boot File!<br><br>";
+ }
+}
+
+if ( $initbootfile != "" && $initbootfile != $oldinitbootfile ){
+ $entryibf ['initbootfile'] = $initbootfile;
+ if(ldap_mod_replace($ds,$rbsDN,$entryibf)){
+ adjust_dhcpfilename($initbootfile, $rbsDN, "replace");
+ $mesg = "Initial Boot File erfolgreich ge&auml;ndert<br><br>";
+ }
+ else{
+ $mesg = "Fehler beim &auml;ndern des Initial Boot Files!<br><br>";
+ }
+}
#####################################
# Restliche Attribute