X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=html%2Fsetup.php;h=e98b41cfbf7810569d90ea8d37e42f1a9fcb785c;hb=6e8abbd4123cbceb3edfba6a3d2617227bafd8b1;hp=8e9220e6b7c49c05c051baf58bb6f7ffc1f10e27;hpb=63a0a9eb20483a216fd12569b8ec37b71c6fdd44;p=gosa.git
diff --git a/html/setup.php b/html/setup.php
index 8e9220e6b..e98b41cfb 100644
--- a/html/setup.php
+++ b/html/setup.php
@@ -24,7 +24,6 @@
/* Get standard functions */
require_once ("../include/php_setup.inc");
require_once ("functions.inc");
-require_once ("class_timezones.inc");
require_once("../setup/class_setup.inc");
require_once("../setup/class_setupStep.inc");
@@ -71,13 +70,14 @@ $_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/';
-}
-
+$smarty->compile_dir= '/var/spool/gosa/';
+/* Check for compile directory */
+if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))){
+ msg_dialog::display(_("Smarty"),sprintf(_("Directory '%s' specified as compile directory is not accessible!"),
+ $smarty->compile_dir),FATAL_ERROR_DIALOG);
+ exit();
+}
/* Get posted language */
if(!isset($_SESSION['lang'])){
@@ -92,7 +92,10 @@ if(isset($_POST['lang_selected'])){
}
$lang = $_SESSION['lang'];
-$lang.=".UTF-8";
+/* Append .UTF-8 to language string if necessary */
+if(!preg_match("/utf(-)8$/i",$lang)){
+ $lang .= ".UTF-8";
+}
putenv("LANGUAGE=");
putenv("LANG=$lang");
setlocale(LC_ALL, $lang);
@@ -114,22 +117,33 @@ print_red(NULL);
$smarty->assign("date", date("l, dS F Y H:i:s O"));
$header= "".$smarty->fetch(get_template_path('setup_headers.tpl'));
+
+
+
+/* Set focus to the error button if we've an error message */
+$focus= "";
+if (isset($_SESSION['errors']) && $_SESSION['errors'] != ""){
+ $focus= '';
+}
+
+$focus= '';
+
/* show web frontend */
$smarty->assign("contents" , $display);
$smarty->assign("navigation", $_SESSION['setup']->get_navigation_html());
$smarty->assign("header", $_SESSION['setup']->get_header_html());
-$smarty->assign("bottom", $_SESSION['setup']->get_bottom_html());
+$smarty->assign("bottom", $focus.$_SESSION['setup']->get_bottom_html());
+$smarty->assign("msg_dialogs", msg_dialog::get_dialogs());
if ($error_collector != ""){
$smarty->assign("php_errors", preg_replace("/%BUGBODY%/",$error_collector_mailto,$error_collector)."");
} else {
$smarty->assign("php_errors", "");
}
-if (isset($_SESSION['errors'])){
- $smarty->assign("errors", $_SESSION['errors']);
-}else{
- $smarty->assign("errors" , "");
-}
$smarty->assign("version",get_gosa_version());