From b18ee612d63aa7263cf7434dc4c14f1f2db27a94 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 4 May 2007 12:22:17 +0000 Subject: [PATCH] Added append base to admin dn git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6263 594d385d-05f5-0310-b6e9-bd551577e9d8 --- setup/class_setupStep_Ldap.inc | 20 +++++++++++++++++++- setup/setup_ldap.tpl | 13 +++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/setup/class_setupStep_Ldap.inc b/setup/class_setupStep_Ldap.inc index 29e75bee5..53ffb364b 100644 --- a/setup/class_setupStep_Ldap.inc +++ b/setup/class_setupStep_Ldap.inc @@ -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; + } } } diff --git a/setup/setup_ldap.tpl b/setup/setup_ldap.tpl index a279bbde2..05d705226 100644 --- a/setup/setup_ldap.tpl +++ b/setup/setup_ldap.tpl @@ -60,7 +60,7 @@ {html_options values=$namingContexts output=$namingContexts selected=$base} {else} - + {/if} @@ -73,11 +73,20 @@ {t}Admin DN{/t}
- +
+
+
+
+
+   + {t}Append base to admin dn{/t} +
+
+
-- 2.30.2