X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=setup%2Fclass_setupStep_Ldap.inc;h=9b5f670eafdfbaf412ef674874fdbb70b750eff5;hb=a26e30f68ebeebd69d33547806568a2efb38b84b;hp=53ffb364b470eccffb7c3bc97b08ecf8fd68e576;hpb=b18ee612d63aa7263cf7434dc4c14f1f2db27a94;p=gosa.git diff --git a/setup/class_setupStep_Ldap.inc b/setup/class_setupStep_Ldap.inc index 53ffb364b..9b5f670ea 100644 --- a/setup/class_setupStep_Ldap.inc +++ b/setup/class_setupStep_Ldap.inc @@ -81,6 +81,12 @@ class Step_Ldap extends setup_step $smarty->assign("resolved_users_count",count($tmp)); $smarty->assign("resolve_filter",$this->resolve_filter); } + + $base_to_append = $this->base; + if(strlen($base_to_append) > 20){ + $base_to_append = substr($base_to_append,0,17)."..."; + } + $smarty->assign("base_to_append",$base_to_append); return($smarty -> fetch (get_template_path("../setup/setup_ldap.tpl"))); } @@ -130,9 +136,23 @@ class Step_Ldap extends setup_step function save_object() { + $reset = FALSE; foreach($this->attributes as $attr){ if(isset($_POST[$attr])){ - $this->$attr = $_POST[$attr]; + if(in_array($attr,array("base","connection")) && $this->$attr != get_post($attr)){ + $reset = TRUE; + } + $this->$attr = get_post($attr); + } + } + + if($reset){ + $this->parent->disable_steps_from(($this->parent->step_name_to_id(get_class($this))) +1); + $attr = @LDAP::get_naming_contexts($this->connection); + if(is_array($attr) && !in_array(get_post("base"),$attr)){ + if(isset($attr[0])){ + $this->base = $attr[0]; + } } } @@ -147,24 +167,17 @@ class Step_Ldap extends setup_step $this->dialog = $this->resolve_user; if(isset($_POST['resolve_filter'])){ - $this->resolve_filter = $_POST['resolve_filter']; + $this->resolve_filter = get_post('resolve_filter'); } if(isset($_POST['use_selected_user'])){ if(isset($_POST['admin_to_use'])){ - $this->admin = base64_decode($_POST['admin_to_use']); + $this->admin = base64_decode(get_post('admin_to_use')); $this->resolve_user = false; } } - $this->get_connection_status(); - if($this->bind_id && !empty($this->admin) && !empty($this->base)){ - $this->is_completed =TRUE; - }else{ - $this->is_completed =FALSE; - } - if(isset($_POST['append_base_to_admin_dn'])){ $this->append_base_to_admin_dn = TRUE; }else{ @@ -180,6 +193,14 @@ class Step_Ldap extends setup_step }else{ $this->admin = $this->admin_given; } + + $this->get_connection_status(); + if($this->bind_id && !empty($this->admin) && !empty($this->base)){ + $this->is_completed =TRUE; + }else{ + $this->is_completed =FALSE; + } + } }