diff --git a/html/setup.php b/html/setup.php
index 177b38216d6c6c21ea12a724c0c58e5ff9b9c497..61a18045f83b75de8eeea190b49872f440dceed9 100644 (file)
--- a/html/setup.php
+++ b/html/setup.php
session_start ();
$_SESSION['DEBUGLEVEL']= 1;
-/* Check for js */
-if (!isset($_GET['js']) && !isset($_SESSION['js'])){
- echo '<script language="JavaScript" type="text/javascript">';
- echo ' location = "setup.php?js=true";';
- echo '</script>';
-
- $_SESSION['js']= FALSE;
-} elseif(isset($_GET['js'])) {
- $_SESSION['js']= TRUE;
-}
-
/* Attribute initialization, reset errors */
$_SESSION['errors'] = "";
$_SESSION['errorsAlreadyPosted']= array();
/* Set template compile directory */
$smarty->compile_dir= '/var/spool/gosa/';
+/* Check for compile directory */
+if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))){
+ echo sprintf(_("Directory '%s' specified as compile directory is not accessible!"),
+ $smarty->compile_dir);
+ exit();
+}
/* Get posted language */
if(!isset($_SESSION['lang'])){
$_SESSION['lang'] = get_browser_language();
}
}
+/* Check for js */
+if (!isset($_GET['js']) && !isset($_SESSION['js'])){
+ echo '<script language="JavaScript" type="text/javascript">';
+ echo ' location = "setup.php?js=true";';
+ echo '</script>';
+
+ $_SESSION['js']= FALSE;
+} elseif(isset($_GET['js'])) {
+ $_SESSION['js']= TRUE;
+}
+
$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);