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_Welcome extends setup_step
24 {
25 var $languages = array();
26 var $attributes = array('instanceUUID');
27 var $header_image = "images/setup/welcome.png";
29 var $instanceUUID = "";
31 function Step_Welcome()
32 {
33 $this->is_enabled = TRUE;
34 $this->is_active = TRUE;
35 $this->update_strings();
37 $this->instanceUUID = gen_uuid();
38 }
40 function update_strings()
41 {
42 $this->s_title = _("Welcome");
43 $this->s_info = _("The welcome message");
44 $this->s_title_long = _("Welcome to the GOsa setup assistent");
45 }
47 function execute()
48 {
49 $smarty = get_smarty();
50 $smarty->assign('auth_id', session_id());
52 $smarty->assign("path",'/tmp/gosa.auth');
53 return($smarty->fetch(get_template_path("setup_welcome.tpl",TRUE,dirname(__FILE__))));
54 }
56 function save_object()
57 {
58 $id = "";
60 /* Get auth ID from file */
61 $path = '/tmp/gosa.auth';
62 if (file_exists($path) && is_readable($path)){
63 $contents= file($path);
64 $id= chop($contents[0]);
65 }
67 /* Continue if we've the correct ID */
68 if ($id == session_id()){
69 $this->is_completed = true;
70 } else {
71 $this->is_completed = false;
72 }
74 }
75 }
77 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
78 ?>