From: hickert Date: Tue, 8 May 2007 09:01:05 +0000 (+0000) Subject: Disable steps after ldap connection setup, if connection setup is modified X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=69907df243514ee2e9ee3dce90a2b4fda09176ec;p=gosa.git Disable steps after ldap connection setup, if connection setup is modified git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6293 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/setup/class_setup.inc b/setup/class_setup.inc index 2f65cd775..d93dada1d 100644 --- a/setup/class_setup.inc +++ b/setup/class_setup.inc @@ -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); + } + } diff --git a/setup/class_setupStep_Ldap.inc b/setup/class_setupStep_Ldap.inc index 79238f2ce..c982eec68 100644 --- a/setup/class_setupStep_Ldap.inc +++ b/setup/class_setupStep_Ldap.inc @@ -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); } }