From: hickert Date: Mon, 12 Feb 2007 09:51:27 +0000 (+0000) Subject: Updated setup X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=07e10f94b3d3d7cdfb4a800dcc50ad0d5d1aad8a;p=gosa.git Updated setup git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5718 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/setup/class_setup.inc b/setup/class_setup.inc index 8bd1e7bf1..f59d5f68b 100644 --- a/setup/class_setup.inc +++ b/setup/class_setup.inc @@ -20,7 +20,7 @@ require_once("class_setupStep.inc"); -class setup extends plugin +class setup { var $i_steps = 7; // Number of setup steps @@ -41,6 +41,7 @@ class setup extends plugin $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; } } @@ -66,6 +67,11 @@ class setup extends plugin $this->captured_values[$name] = $value; } + /* Set parent */ + foreach($this->o_steps as $key => $value){ + $this->o_steps[$key]->parent = $this; + } + /* Check if image button requests next page */ foreach($_POST as $name => $value){ if(preg_match("/^next_(x|y)/",$name)){ diff --git a/setup/class_setupStep.inc b/setup/class_setupStep.inc index f69abdfa5..6cfe60ce2 100644 --- a/setup/class_setupStep.inc +++ b/setup/class_setupStep.inc @@ -30,10 +30,11 @@ class setup_step var $is_completed = false; var $attributes = array(); + var $parent = NULL; function setup_step() { - } + } function save_object() { diff --git a/setup/class_setupStep1.inc b/setup/class_setupStep1.inc index 780c36c7b..d3525860a 100644 --- a/setup/class_setupStep1.inc +++ b/setup/class_setupStep1.inc @@ -22,9 +22,9 @@ class setup_step_1 extends setup_step { - var $attributes = array("lang"); var $lang = "en_EN"; var $languages = array(); + var $attributes = array("lang"); function setup_step_1() { diff --git a/setup/class_setupStep5.inc b/setup/class_setupStep5.inc index b31c9d33b..98fe7e694 100644 --- a/setup/class_setupStep5.inc +++ b/setup/class_setupStep5.inc @@ -185,6 +185,17 @@ class setup_step_5 extends setup_step $this->is_completed = FALSE; } }// if tempalte posted + + + /* Attributes that are interesting for configuration generation */ + function get_attributes() + { + $tmp = setup_step::get_attributes(); + foreach(array("pwd_rules","mail_settings") as $attr){ + $tmp[$attr]= $this->$attr; + } + return($tmp); + } }// CLass // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/setup/class_setupStep6.inc b/setup/class_setupStep6.inc index bd8db9ff1..eedb588da 100644 --- a/setup/class_setupStep6.inc +++ b/setup/class_setupStep6.inc @@ -35,10 +35,10 @@ class setup_step_6 extends setup_step "wws_ou" => "ou=winstations", "wws_ou_active" => FALSE, "snapshot_active"=> FALSE, - "snapshot_base" => "ou=snapshots,dc=server,dc=de", - "snapshot_user" => "cn=ldapadmin,dc=server,dc=de", + "snapshot_base" => "ou=snapshots,%base%", + "snapshot_user" => "cn=ldapadmin,%base%", "snapshot_password" => "", - "snapshot_server" => "ldap://localhost:386"); + "snapshot_server" => "%connection%"); var $samba_settings = array( "samba_sid" => "0-815-4711", "samba_sid_active" => FALSE, @@ -56,6 +56,17 @@ class setup_step_6 extends setup_step function execute() { + /* Update snapshot values, with already collected values */ + foreach($this->generic_settings as $key => $value){ + foreach(array("snapshot_base","snapshot_user","snapshot_server") as $attr){ + foreach($this->parent->captured_values as $replace_name => $replace_value){ + if(is_string($replace_value)) { + $this->generic_settings[$attr] = preg_replace("/%".$replace_name."%/",$replace_value,$this->generic_settings[$attr]); + } + } + } + } + $smarty = get_smarty(); $smarty->assign("generic_settings",$this->generic_settings); $smarty->assign("samba_settings",$this->samba_settings); @@ -124,6 +135,17 @@ class setup_step_6 extends setup_step } } + + /* Attributes that are interesting for configuration generation */ + function get_attributes() + { + $tmp = setup_step::get_attributes(); + foreach(array("samba_settings","generic_settings") as $attr){ + $tmp[$attr]= $this->$attr; + } + return($tmp); + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/setup/setup_step6.tpl b/setup/setup_step6.tpl index 92928ecbc..da7c051c4 100644 --- a/setup/setup_step6.tpl +++ b/setup/setup_step6.tpl @@ -60,7 +60,7 @@

- {t}Additional GOsa setttings{/t} + {t}Additional GOsa settings{/t}