Code

Added append base to admin dn
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 May 2007 12:22:17 +0000 (12:22 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 May 2007 12:22:17 +0000 (12:22 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6263 594d385d-05f5-0310-b6e9-bd551577e9d8

setup/class_setupStep_Ldap.inc
setup/setup_ldap.tpl

index 29e75bee57dd166dd227a4a35abfc2387337ae93..53ffb364b470eccffb7c3bc97b08ecf8fd68e576 100644 (file)
@@ -27,6 +27,8 @@ class Step_Ldap extends setup_step
   var $admin      = "";
   var $password   = "";
   var $base       = "";
+  var $append_base_to_admin_dn = FALSE;
+  var $admin_given = "";
 
   var $connect_id = FALSE;
   var $bind_id    = FALSE;
@@ -36,7 +38,7 @@ class Step_Ldap extends setup_step
   var $tls            = FALSE;
 
   var $rfc2307bis             = FALSE;
-  var $attributes = array("connection","location","admin","password","base","tls","rfc2307bis");
+  var $attributes = array("connection","location","admin","password","base","admin_given","append_base_to_admin_dn","tls","rfc2307bis");
 
   var $header_image= "images/proxy.png";
 
@@ -162,6 +164,22 @@ class Step_Ldap extends setup_step
     }else{
       $this->is_completed =FALSE;
     }
+
+    if(isset($_POST['append_base_to_admin_dn'])){
+      $this->append_base_to_admin_dn = TRUE;
+    }else{
+      $this->append_base_to_admin_dn = FALSE;
+    }
+    if($this->append_base_to_admin_dn){
+      $base = $this->base;      
+      if(!preg_match("/,$/",$this->admin_given)){
+        $base = ",".$base;
+      }
+      $this->admin = $this->admin_given.$base;
+    }else{
+      $this->admin = $this->admin_given;
+    }
   }
 }
 
index a279bbde29c600435fa510d81d99137f3b67df35..05d705226567b57b6bddc96b2b51219e818d9d5b 100644 (file)
@@ -60,7 +60,7 @@
                                        {html_options values=$namingContexts output=$namingContexts selected=$base}
                                </select>
                        {else}
-                               <input type='text' name='base' maxlength='80' size='40' value='{$base}'>
+                               <input type='text' name='base_given' maxlength='80' size='40' value='{$base_given}'>
                        {/if}
                        <input type='image' class='center' src='images/list_reload.png' title='{t}Reload{/t}' name='reload' alt='{t}Reload{/t}'>
                </div>
                        {t}Admin DN{/t}
                </div>
                <div class='step4_value'>
-                       <input type='text' name='admin' maxlength='160' size='40' value='{$admin}'>
+                       <input type='text' name='admin_given' maxlength='160' size='40' value='{$admin_given}'>
                        <input type='image' class='center' src='images/folder.png' title='{t}Select user{/t}' name='resolve_user' alt='{t}Select user{/t}'>
                </div>
        </div>
 
+       <div class='step4_container'>
+               <div class='step4_name'> 
+               </div>
+               <div class='step4_value'>
+                       <input {if $append_base_to_admin_dn} checked {/if} type='checkbox' name='append_base_to_admin_dn' value='1'>&nbsp;
+                       {t}Append base to admin dn{/t}
+               </div>
+       </div>
+
 
        <div class='step4_container'>
                <div class='step4_name'>