From e0e7d48e246d711f6deb80897502ba6d72daf29e Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 29 Jan 2007 08:33:15 +0000 Subject: [PATCH] Added new setup.php git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5641 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/setup.php | 122 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 html/setup.php diff --git a/html/setup.php b/html/setup.php new file mode 100644 index 000000000..c414bb491 --- /dev/null +++ b/html/setup.php @@ -0,0 +1,122 @@ +'; + echo ' location = "setup.php?js=true";'; + echo ''; + + $_SESSION['js']= FALSE; +} elseif(isset($_GET['js'])) { + $_SESSION['js']= TRUE; +} + +/* Attribute initialization, reset errors */ +$_SESSION['errors'] = ""; +$_SESSION['errorsAlreadyPosted']= array(); +$_SESSION['LastError'] = ""; + +/* Set template compile directory */ +if (isset ($config->data['MAIN']['COMPILE'])){ + $smarty->compile_dir= $config->data['MAIN']['COMPILE']; +} else { + $smarty->compile_dir= '/var/spool/gosa/'; +} + + + +/* Get posted language */ +if(!isset($_SESSION['lang'])){ + $_SESSION['lang'] = get_browser_language(); +} +if(isset($_POST['lang'])){ + $_SESSION['lang'] = $_POST['lang']; +} + +$lang = $_SESSION['lang']; +$lang.=".UTF-8"; +putenv("LANGUAGE="); +putenv("LANG=$lang"); +setlocale(LC_ALL, $lang); +$GLOBALS['t_language']= $lang; +$GLOBALS['t_gettext_message_dir'] = $BASE_DIR.'/locale/'; + +/* Set the text domain as 'messages' */ +$domain = 'messages'; +bindtextdomain($domain, "$BASE_DIR/locale"); +textdomain($domain); + + +/* Call setup */ +$display = ""; +require_once("../setup/main.inc"); + +/* Print_out last ErrorMessage repeated string. */ +print_red(NULL); + +$header= "".$smarty->fetch(get_template_path('headers.tpl')); + +$smarty->assign("contents" , $display); +$smarty->assign("navigation", $_SESSION['setup']->get_navigation_html()); +$smarty->assign("header", $_SESSION['setup']->get_header_html()); + +if ($error_collector != ""){ + $smarty->assign("php_errors", $error_collector.""); +} else { + $smarty->assign("php_errors", ""); +} +if (isset($_SESSION['errors'])){ + $smarty->assign("errors", $_SESSION['errors']); +}else{ + $smarty->assign("errors" , ""); +} + +echo $header.$smarty->fetch("../setup/setup_frame.tpl"); +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> -- 2.30.2