Code

Updated setup
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Feb 2007 09:51:27 +0000 (09:51 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Feb 2007 09:51:27 +0000 (09:51 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5718 594d385d-05f5-0310-b6e9-bd551577e9d8

setup/class_setup.inc
setup/class_setupStep.inc
setup/class_setupStep1.inc
setup/class_setupStep5.inc
setup/class_setupStep6.inc
setup/setup_step6.tpl

index 8bd1e7bf1ec9c9bb3838229091e51a5793ba04e2..f59d5f68bd0f93cdc040017aed37f9b79a63d285 100644 (file)
@@ -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)){
index f69abdfa5242f5b85c9fbd313c14b0b5553c5572..6cfe60ce2f0d5257960170528e063c0f3cfd5ad0 100644 (file)
@@ -30,10 +30,11 @@ class setup_step
   var $is_completed = false;
 
   var $attributes   = array();
+  var $parent       = NULL;
 
   function setup_step()
   {
-   }
+  }
 
   function save_object()
   {
index 780c36c7bf227988cafb9cab4163465c8235db37..d3525860a3dd75469799776a9e19fcf0b5d2492f 100644 (file)
@@ -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()
   {
index b31c9d33bab09af27217652e79bd65bcc030fd0c..98fe7e694b11cf3b80c9e9db53da86731558a31f 100644 (file)
@@ -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:
index bd8db9ff118ffa23be8c9a3035e8d35ed72593a3..eedb588da6d6f497679c00cae572effc74a8db6c 100644 (file)
@@ -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:
index 92928ecbcc0b04e8c3ab21a16197b2f46a6e476f..da7c051c41b5b618f178c014dd9319d5706c6288 100644 (file)
@@ -60,7 +60,7 @@
     </div>
     <div style='float:left; width:600px;'>
                <br>
-               <b>{t}Additional GOsa setttings{/t}</b>
+               <b>{t}Additional GOsa settings{/t}</b>
        </div>
        
     <div class='step4_container'>