Code

Don't gray out ldap connection step
[gosa.git] / setup / class_setupStep_License.inc
1 <?php
3 /*
4    This code is part of GOsa (https://gosa.gonicus.de)
5    Copyright (C) 2007 Fabian Hickert
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20 */
23 class Step_License extends setup_step
24 {
25   var $license_found  = false;
26   var $License        = "";
27   var $header_image   = "images/ldif.png";
29   function Step_License()
30   {
31     $this->update_strings();
32   }
34   
35   function load_license()
36   {
37     if(!file_exists("../setup/license.txt")){
38       $this->License = "<font color='red'>License not found. Setup stops here.</font>";
39       $this->license_found = false;
40     }else{
41       $fp = fopen("../setup/license.txt","r");
42       $this->License = "";
43       while (!feof($fp)){
44         $this->License .= fread($fp, 255);
45       }
46       $this->license_found = true;
47     }
48   }
51   function update_strings()
52   {
53     $this->s_title      = _("License");
54     $this->s_title_long = _("License");
55     $this->s_info       = _("Terms and conditions for usage");
56   }
58  
59   function execute()
60   {
61     $this->load_license();
63     $smarty = get_smarty();
64     $smarty -> assign("License",nl2br($this->License));
65     $smarty -> assign("license_found",$this->license_found);
67     return($smarty -> fetch (get_template_path("../setup/setup_license.tpl")));
68   }
70   
71   function save_object()
72   {
73     if($this->license_found){
74       $this->is_completed = true;
75     }else{
76       $this->is_completed = false;
77     }
78   }
79 }
81 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
82 ?>