Code

Added license agreement field
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jul 2007 09:43:51 +0000 (09:43 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jul 2007 09:43:51 +0000 (09:43 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6873 594d385d-05f5-0310-b6e9-bd551577e9d8

setup/class_setupStep_License.inc
setup/setup_license.tpl

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 c0c1896363c9fbb0421ffa99d0fd121d292ddaa5..47e7937cc1de2d36d7f7206c5943be9d44b6716f 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">{t}I have read the license and accept it{/t}
        </div>
 </div>
+<input type='hidden' name='step_license' value='1'>