Code

Updated setup.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 Jul 2007 06:35:33 +0000 (06:35 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 Jul 2007 06:35:33 +0000 (06:35 +0000)
Added "Accept license" checkbox.
Added selectbox to choose timezone for samba settings.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6885 594d385d-05f5-0310-b6e9-bd551577e9d8

html/setup.php
setup/class_setupStep_Config2.inc
setup/class_setupStep_License.inc
setup/setup_config2.tpl
setup/setup_license.tpl

index 06164aa001de834fed06b04d9f97f7b4463ab10a..8e9220e6b7c49c05c051baf58bb6f7ffc1f10e27 100644 (file)
@@ -24,6 +24,7 @@
 /* Get standard functions */
 require_once ("../include/php_setup.inc");
 require_once ("functions.inc");
+require_once ("class_timezones.inc");
 
 require_once("../setup/class_setup.inc");
 require_once("../setup/class_setupStep.inc");
index 27efe10cee542aee6c8537c4a36b097d0a457774..18cebe586e8669c2a32787044c603b4eb3d3305c 100644 (file)
@@ -46,7 +46,10 @@ class Step_Config2 extends setup_step
   var $use_netatalk         = FALSE;
   var $enableFAI_management = FALSE;
 
-  var $attributes = array("governmentmode","sambaidmapping","cyrusunixstyle","mail","use_netatalk","enableFAI_management");
+  var $timezone       = "Europe/Berlin";
+  var $timezones      = array();
+
+  var $attributes = array("governmentmode","sambaidmapping","cyrusunixstyle","mail","use_netatalk","enableFAI_management","timezone");
   var $called = FALSE;
 
   function Step_Config2()
@@ -66,6 +69,7 @@ class Step_Config2 extends setup_step
       $pwdhash= 'perl -MCrypt::SmbHash -e "print join(q[:], ntlmgen \$ARGV[0]), $/;"';
     }
 
+    $this->timezones = _get_tz_zones();
     $this->samba_settings['smbhash'] = $pwdhash;
   }
 
@@ -126,6 +130,8 @@ class Step_Config2 extends setup_step
         foreach($this->attributes as $attr){
       $smarty->assign($attr,$this->$attr);
     }
+    $smarty->assign("timezone"     ,$this->timezone);
+    $smarty->assign("timezones"    ,$this->timezones);
     return($smarty -> fetch (get_template_path("../setup/setup_config2.tpl")));
   }
 
@@ -133,6 +139,10 @@ class Step_Config2 extends setup_step
   {
     if(isset($_POST['step6_posted'])){
 
+      if(isset($_POST['timezone']) && isset($this->timezones['TIMEZONES'][$_POST['timezone']])){
+        $this->timezone = $_POST['timezone'];
+      }
+
       /* Get attributes */
       foreach($this->attributes as $attr){
         if(isset($_POST[$attr])){
index 0ed29d92aeff2a70c5ca3da37b5746aa1c4fd7b0..d46768ca6895321808c6a1f2cdc66cafbadfbb91 100644 (file)
@@ -25,6 +25,9 @@ class Step_License extends setup_step
   var $license_found  = false;
   var $License        = "";
   var $header_image   = "images/ldif.png";
+  var $accepted       = FALSE;
+  var $attributes     = array("accepted");
+  
 
   function Step_License()
   {
@@ -63,6 +66,7 @@ class Step_License extends setup_step
     $smarty = get_smarty();
     $smarty -> assign("License",nl2br($this->License));
     $smarty -> assign("license_found",$this->license_found);
+    $smarty -> assign("accepted",$this->accepted);
 
     return($smarty -> fetch (get_template_path("../setup/setup_license.tpl")));
   }
@@ -70,7 +74,15 @@ class Step_License extends setup_step
   
   function save_object()
   {
-    if($this->license_found){
+    if(isset($_POST['step_license'])){
+      if(isset($_POST['accepted'])){
+        $this->accepted = TRUE;
+      }else{
+        $this->accepted = FALSE;
+      }
+    } 
+  
+    if($this->license_found && $this->accepted){
       $this->is_completed = true;
     }else{
       $this->is_completed = false;
index d85d5126a50d22b654b897d5004f13bc0a9e4958..fdbaff13cdc2d1db3ca01244d242a0c8dbd616b2 100644 (file)
             </select>
         </div>
     </div>
+       <div class='step4_container'>
+        <div class='step4_name'>
+            {t}Timezone{/t}
+        </div>
+        <div class='step4_value'>
+            <select name='timezone' title='{t}Please your preferred timezone here{/t}' style="width:100%">
+        {foreach from=$timezones.TIMEZONES item=val key=key}
+            {if $key == $timezone}
+                               {if isset($timezones.DST_ZONES.$key)}
+                       <option selected value="{$key}">{$key}</option>
+                               {else}
+                       <option selected value="{$key}">{$key}</option>
+                               {/if}
+            {else}
+                               {if isset($timezones.DST_ZONES.$key)}
+                       <option value="{$key}">{$key} (DST)</option>
+                               {else}
+                       <option value="{$key}">{$key} (GMT)</option>
+                               {/if}
+            {/if}
+        {/foreach}
+            </select>
+        </div>
+    </div>
+
 
     <p><b>{t}Additional GOsa settings{/t}</b></p>
 
index c0c1896363c9fbb0421ffa99d0fd121d292ddaa5..5388c6af221480e9738d177a337848948777d548 100644 (file)
@@ -3,5 +3,9 @@
                <div style='height:450px;padding:5px;overflow:auto; '>
                        {$License}
                </div>
+       </div>  
+       <div style='width:95%; text-align: right'>
+               <input {if $accepted} checked {/if} type='checkbox' name='accepted' class="center"><b>{t}I have read the license and accept it{/t}</b>
        </div>
 </div>
+<input type='hidden' name='step_license' value='1'>