Code

db861f868bc12e51995b1927f2d93571ca7e4e45
[gosa.git] / setup / class_setupStep3.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 setup_step_3 extends setup_step
24 {
25   var $license_found  = false;
26   var $License        = "";
28   function setup_step_3()
29   {
30     $this->update_strings();
31   }
33   
34   function load_license()
35   {
36     if(!file_exists("../setup/license.txt")){
37       $this->License = "<font color='red'>License not found. Setup stops here.</font>";
38       $this->license_found = false;
39     }else{
40       $fp = fopen("../setup/license.txt","r");
41       $this->License = "";
42       while (!feof($fp)){
43         $this->License .= fread($fp, 255);
44       }
45       $this->license_found = true;
46     }
47   }
50   function update_strings()
51   {
52     $this->s_title      = _("License");
53     $this->s_title_long = _("GNU / GPL-License");
54     $this->s_info       = _("GNU / GPL-License");
55   }
57  
58   function execute()
59   {
60     $this->load_license();
62     $smarty = get_smarty();
63     $smarty -> assign("License",nl2br($this->License));
64     $smarty -> assign("license_found",$this->license_found);
66     return($smarty -> fetch (get_template_path("../setup/setup_step3.tpl")));
67   }
69   
70   function save_object()
71   {
72     if($this->license_found){
73       $this->is_completed = true;
74     }else{
75       $this->is_completed = false;
76     }
77   }
78 }
80 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
81 ?>