Code

Fixed reload in ldap connection settings
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 May 2007 09:59:01 +0000 (09:59 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 May 2007 09:59:01 +0000 (09:59 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6342 594d385d-05f5-0310-b6e9-bd551577e9d8

setup/class_setupStep_Ldap.inc

index c5365ff59b20dd3ea9e71019d761f45309fd112d..6b6053469c867a32bbb6daf87a539151c890bd3b 100644 (file)
@@ -130,16 +130,26 @@ class Step_Ldap extends setup_step
 
   function save_object()
   {
+    $reset = FALSE;
     foreach($this->attributes as $attr){
       if(isset($_POST[$attr])){
-
         if(in_array($attr,array("base","connection")) && $this->$attr != get_post($attr)){
-          $this->parent->disable_steps_from(($this->parent->step_name_to_id(get_class($this))) +1);
+          $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(!in_array(get_post("base"),$attr)){
+        if(isset($attr[0])){
+          $this->base = $attr[0];
+        }
+      }
+    }
+
     if(isset($_POST['resolve_user_x'])){
       $this->resolve_user = !$this->resolve_user;
     }