From e879fc3015cba6dcb8959e425a5cd8aaad8f64af Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 2 Apr 2007 12:04:41 +0000 Subject: [PATCH] Fixed step validation git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5952 594d385d-05f5-0310-b6e9-bd551577e9d8 --- setup/class_setup.inc | 39 +++++++++++++++++++------------------- setup/class_setupStep4.inc | 1 + setup/class_setupStep7.inc | 2 +- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/setup/class_setup.inc b/setup/class_setup.inc index 297f95695..af70d9b8d 100644 --- a/setup/class_setup.inc +++ b/setup/class_setup.inc @@ -22,12 +22,10 @@ require_once("class_setupStep.inc"); class setup { - var $i_steps = 8; // Number of setup steps var $i_current= 1; // Current step var $i_last = 1; // Last setup step; var $o_steps = array(); - var $captured_values = array(); function setup() @@ -45,22 +43,9 @@ class setup foreach($this->o_steps as $key => $step){ $this->o_steps[$key]->parent = $this; } - -/* - for($i = 1 ; $i <= $this->i_steps; $ii ++ ){ - $class= "setup_step_".$i; - - if(class_exists($class)){ - $this->o_steps[$i] = new $class(); - }else{ - $this->o_steps[$i] = new setup_step(); - trigger_error("Try to create class '".$class."' but it is not available, possibly you have forgotten to add the include in setup.php"); - } - $this->o_steps[$i]->parent = $this; - } -*/ } + function execute() { $smarty = get_smarty(); @@ -107,10 +92,9 @@ class setup if($this->o_steps[$i]->is_completed()){ if(isset($this->o_steps[($i+1)])){ $this->o_steps[($i+1)]->set_enabled(); - }else{ - $this->o_steps[($i+1)]->set_enabled(false); - } + }else{ + $this->disable_steps_from($i+1); } } @@ -130,6 +114,23 @@ class setup } + function disable_steps_from($start) + { + $found = false; + foreach($this->o_steps as $key => $step){ + if($key == $start){ + $found = true; + } + + if($found){ + echo $key." "; + $this->o_steps[$key]->set_enabled(false); + $this->o_steps[$key]->set_completed(false); + } + } + } + + /* Create navigation menu */ function get_navigation_html() { diff --git a/setup/class_setupStep4.inc b/setup/class_setupStep4.inc index 45603e528..a67944be0 100644 --- a/setup/class_setupStep4.inc +++ b/setup/class_setupStep4.inc @@ -140,6 +140,7 @@ class setup_step_4 extends setup_step } } + $this->get_connection_status(); if($this->bind_id){ $this->is_completed =TRUE; }else{ diff --git a/setup/class_setupStep7.inc b/setup/class_setupStep7.inc index 0c962e7b6..71bd17eff 100644 --- a/setup/class_setupStep7.inc +++ b/setup/class_setupStep7.inc @@ -113,7 +113,7 @@ class setup_step_7 extends setup_step /* The gosa base schema */ $checks['gosaObject'] = $def_check; - $checks['gosaObject']['REQUIRED_VERSION'] = "22.4"; + $checks['gosaObject']['REQUIRED_VERSION'] = "2.4"; $checks['gosaObject']['SCHEMA_FILES'] = array("gosa+samba3.schema","gosa.schema"); $checks['gosaObject']['CLASSES_REQUIRED'] = array("gosaObject"); $checks['gosaObject']['IS_MUST_HAVE'] = TRUE; -- 2.30.2