Code

Disable steps after ldap connection setup, if connection setup is modified
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 8 May 2007 09:01:05 +0000 (09:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 8 May 2007 09:01:05 +0000 (09:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6293 594d385d-05f5-0310-b6e9-bd551577e9d8

setup/class_setup.inc
setup/class_setupStep_Ldap.inc

index 2f65cd775989511068ca9c2138954f9d813cfaa6..d93dada1d685fb25ec465d7441cd5b968b056e03 100644 (file)
@@ -300,6 +300,17 @@ class setup
     }
     return(false);
   }
+
+  function step_name_to_id($name)
+  {
+    foreach($this->o_steps as $id => $class){
+      if(get_class($class) == $name){
+        return($id);
+      }
+    }
+    return(0);
+  }
+  
 }
 
 
index 79238f2ce50513a127911b34eaafd18defa961a2..c982eec68a4db0de8366ba778339970fc7ff40a9 100644 (file)
@@ -132,6 +132,10 @@ class Step_Ldap extends setup_step
   {
     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)));
+        }
         $this->$attr = get_post($attr);
       }
     }