Code

Updated stats handling.
[gosa.git] / gosa-core / html / setup.php
index 9fa8eebec415261e593f4cec23c9418349714088..4b692e02639a45e2ea2bda33de2afc8496408e68 100644 (file)
@@ -60,14 +60,19 @@ session::set('errors',"");
 session::set('errorsAlreadyPosted',array());
 session::set('LastError',"");
 
-/* Set template compile directory */
-$smarty->compile_dir= '/var/spool/gosa/';
+$smarty->compile_dir= "/var/spool/gosa/";
+if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))){
+
+    if(isset($_SERVER['SCRIPT_FILENAME'])){
+        $smarty->compile_dir= preg_replace("#/html/.*$#","",$_SERVER['SCRIPT_FILENAME']);
+    }
+}
 
 /* Check for compile directory */
 if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))){
-  msg_dialog::display(_("Smarty"),sprintf( _("Compile directory %s is not accessible!"),
-    bold($smarty->compile_dir)),FATAL_ERROR_DIALOG);
-  exit();
+    msg_dialog::display(_("Smarty"),sprintf( _("Compile directory %s is not accessible!"),
+                bold('/var/spool/gosa/')),FATAL_ERROR_DIALOG);
+    exit();
 }
 
 /* Get posted language */