Code

Added dummy step.
[gosa.git] / html / setup.php
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 */
24 /* Get standard functions */
25 require_once ("../include/php_setup.inc");
26 require_once ("functions.inc");
28 require_once("../setup/class_setup.inc");
29 require_once("../setup/class_setupStep.inc");
30 require_once("../setup/class_setupStep1.inc");
31 require_once("../setup/class_setupStep2.inc");
32 require_once("../setup/class_setupStep3.inc");
33 require_once("../setup/class_setupStep4.inc");
34 require_once("../setup/class_setupStep5.inc");
35 require_once("../setup/class_setupStep6.inc");
36 require_once("../setup/class_setupStep7.inc");
37 require_once("../setup/class_setupStep8.inc");
40 /* Set header */
41 header("Content-type: text/html; charset=UTF-8");
43 /* Set cookie lifetime to one day (The parameter is in seconds ) */
44 session_set_cookie_params(24*60*60);
45 session_cache_expire(60*24);  // default is 180
46 ini_set("session.gc_maxlifetime",24*60*60);
48 /* Start session */
49 session_start ();
50 $_SESSION['DEBUGLEVEL']= 1;
52 /* Check for js */
53 if (!isset($_GET['js']) && !isset($_SESSION['js'])){
54   echo '<script language="JavaScript" type="text/javascript">';
55   echo '  location = "setup.php?js=true";';
56   echo '</script>';
58   $_SESSION['js']= FALSE;
59 } elseif(isset($_GET['js'])) {
60   $_SESSION['js']= TRUE;
61 }
63 /* Attribute initialization, reset errors */
64 $_SESSION['errors']             = "";
65 $_SESSION['errorsAlreadyPosted']= array();
66 $_SESSION['LastError']          = "";
68 /* Set template compile directory */
69 if (isset ($config->data['MAIN']['COMPILE'])){
70   $smarty->compile_dir= $config->data['MAIN']['COMPILE'];
71 } else {
72   $smarty->compile_dir= '/var/spool/gosa/';
73 }
77 /* Get posted language */
78 if(!isset($_SESSION['lang'])){
79   $_SESSION['lang'] = get_browser_language();
80 }
81 if(isset($_POST['lang'])){
82   $_SESSION['lang'] = $_POST['lang'];
83 }
85 $lang = $_SESSION['lang'];
86 $lang.=".UTF-8";
87 putenv("LANGUAGE=");
88 putenv("LANG=$lang");
89 setlocale(LC_ALL, $lang);
90 $GLOBALS['t_language']= $lang;
91 $GLOBALS['t_gettext_message_dir'] = $BASE_DIR.'/locale/';
93 /* Set the text domain as 'messages' */
94 $domain = 'messages';
95 bindtextdomain($domain, "$BASE_DIR/locale");
96 textdomain($domain);
99 /* Call setup */
100 $display = "";
101 require_once("../setup/main.inc");
103 /* Print_out last ErrorMessage repeated string. */
104 print_red(NULL);
106 $smarty->assign("date", date("l, dS F Y H:i:s O"));
107 $header= "<!-- headers.tpl-->".$smarty->fetch(get_template_path('setup_headers.tpl'));
108 /* show web frontend */
109 $smarty->assign("contents"  , $display);
110 $smarty->assign("navigation", $_SESSION['setup']->get_navigation_html());
111 $smarty->assign("header", $_SESSION['setup']->get_header_html());
113 if ($error_collector != ""){
114   $smarty->assign("php_errors", $error_collector."</div>");
115 } else {
116   $smarty->assign("php_errors", "");
118 if (isset($_SESSION['errors'])){
119   $smarty->assign("errors", $_SESSION['errors']);
120 }else{
121   $smarty->assign("errors"    , "");
124 echo $header.$smarty->fetch("../setup/setup_frame.tpl");
125 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
126 ?>