diff --git a/html/autocomplete.php b/html/autocomplete.php
index 63c2d2a7216ac15a50f75c678528f83a50dd134a..09a407cda7e9f6c170c93f3d4d82982a6a38b0b1 100644
--- a/html/autocomplete.php
+++ b/html/autocomplete.php
@@ -23,6 +23,7 @@
 /* Basic setup, remove eventually registered sessions */
 @require_once ("../include/php_setup.inc");
 @require_once ("functions.inc");
+@require_once ("variables.inc");
 
 session_cache_limiter("private");
 session::start();
diff --git a/html/getFAIstatus.php b/html/getFAIstatus.php
index 825b73aa411ae518151dc5b74ce456ed4f379a82..afba8320406b1d075123cd8595bc80687d54724e 100644
--- a/html/getFAIstatus.php
+++ b/html/getFAIstatus.php
@@ -23,6 +23,8 @@
 /* Basic setup, remove eventually registered sessions */
 @require_once ("../include/php_setup.inc");
 @require_once ("functions.inc");
+@require_once ("variables.inc");
+
 
 session_cache_limiter("private");
 session::start();
diff --git a/html/getbin.php b/html/getbin.php
index d6613d3490ad37276fc101ef751a39dc6bbfdda1..e78bdabb09a6f3defbe52b90d167dc86c8307c76 100644
--- a/html/getbin.php
+++ b/html/getbin.php
@@ -23,6 +23,8 @@
 /* Basic setup, remove eventually registered sessions */
 @require_once ("../include/php_setup.inc");
 @require_once ("functions.inc");
+@require_once ("variables.inc");
+
 error_reporting (0);
 session_cache_limiter("private");
 session::start();
diff --git a/html/index.php b/html/index.php
index 8f6a0f01418e025c8957e6fc5e54216fb6918b97..ebe035918de96128290e101acaf23a8c44d1c53e 100644
--- a/html/index.php
+++ b/html/index.php
@@ -23,6 +23,7 @@
 /* Load required includes */
 require_once ("../include/php_setup.inc");
 require_once ("functions.inc");
+require_once ("variables.inc");
 require_once ("class_log.inc");
 header("Content-type: text/html; charset=UTF-8");
 
diff --git a/html/logout.php b/html/logout.php
index 630267c0f6bd60932e1526f9c5777539027687cd..631ef7cb2ef6aa4349b4aff0897da66443ca84c5 100644
--- a/html/logout.php
+++ b/html/logout.php
@@ -23,6 +23,8 @@
 /* Basic setup, remove eventually registered sessions */
 require_once ("../include/php_setup.inc");
 require_once ("functions.inc");
+require_once ("variables.inc");
+
 header("Content-type: text/html; charset=UTF-8");
 
 /* try to start session, so we can remove userlocks, 
diff --git a/html/main.php b/html/main.php
index b880ea40ea38dada11c688c59ee79dd06ea2a66d..81bde05f692729088d4a2fcf5e659a1669336abb 100644
--- a/html/main.php
+++ b/html/main.php
@@ -26,6 +26,7 @@ $start = microtime();
 /* Basic setup, remove eventually registered sessions */
 require_once ("../include/php_setup.inc");
 require_once ("functions.inc");
+require_once ("variables.inc");
 
 /* Set header */
 header("Content-type: text/html; charset=UTF-8");
diff --git a/html/password.php b/html/password.php
index 8e6f39ec73f6ce5efaf34f7057e4175a2fd18e7e..85a6d40ec2bf798b0dfec98e913191f70451e16a 100644
--- a/html/password.php
+++ b/html/password.php
@@ -31,6 +31,8 @@ function displayPWchanger()
 /* Load required includes */
 require_once ("../include/php_setup.inc");
 require_once ("functions.inc");
+require_once ("variables.inc");
+
 
 if(!class_exists("log")){
   require_once("class_log.inc");
diff --git a/html/setup.php b/html/setup.php
index 5917aa18103fc89b86d95778d3a58beb8b756b8a..8f3be2d0c27c881cfdbe9e4dd411d7edc975b913 100644
--- a/html/setup.php
+++ b/html/setup.php
@@ -23,6 +23,7 @@
 /* Get standard functions */
 require_once ("../include/php_setup.inc");
 require_once ("functions.inc");
+require_once ("variables.inc");
 
 require_once("../setup/class_setup.inc");
 require_once("../setup/class_setupStep.inc");
diff --git a/include/functions.inc b/include/functions.inc
index 5a6ba7ed224cec1ad691c0764c23f04124d93a3f..bcceda39f769e4694c000a5bb08ec06c8380a1ec 100644
--- a/include/functions.inc
+++ b/include/functions.inc
@@ -40,33 +40,12 @@ if(!isset($_SERVER['CONFIG_FILE'])){
 }
 
 /* Define common locations and variables */
+require_once ("variables.inc");
 
-/* Smarty compile dir */
-define ("SPOOL_DIR","/var/spool/fusiondirectory");
-
-/* Global cache dir */
-define ("CACHE_DIR","/var/cache/fusiondirectory");
-
-/* Global locale cache dir */
-define ("LOCALE_DIR", "/var/cache/fusiondirectory/locale");
-
-/* Global tmp dir */
-define ("TEMP_DIR","/var/cache/fusiondirectory/tmp");
-
-/* Directory containing the configuration template */
-define ("CONFIG_TEMPLATE_DIR", "/var/cache/fusiondirectory/template/");
-
-/* Directory containing the fai logs */
-define ("FAI_LOG_DIR", "/var/cache/fusiondirectory/fai/");
-
-/* fpdf library path */ 
-define("FPDF","/usr/share/php/fpdf/fpdf.php");
-
-/* Global FPDF FONT define */
-define("FPDF_FONTPATH", "/usr/share/php/fpdf/font/");
-
-/* name of the class.cache file */
-define("CLASS_CACHE", "class.cache");
+/* Include required files */
+require_once (CACHE_DIR."/".CLASS_CACHE);
+require_once ("functions_debug.inc");
+require_once ("accept-to-gettext.inc");
 
 /* Define get_list flags */
 define("GL_NONE",         0);
@@ -93,11 +72,6 @@ define('DES_CBC_MD5',3);
 define('DES3_CBC_MD5',5);
 define('DES3_CBC_SHA1',16);
 
-/* Include required files */
-require_once (CACHE_DIR."/".CLASS_CACHE);
-require_once ("functions_debug.inc");
-require_once ("accept-to-gettext.inc");
-
 /* Define constants for debugging */
 define ("DEBUG_TRACE",   1); /*! Debug level for tracing of common actions (save, check, etc.) */
 define ("DEBUG_LDAP",    2); /*! Debug level for LDAP queries */
diff --git a/include/php_setup.inc b/include/php_setup.inc
index c5651162296fbb81e9aa49cd7b30a0e7e11fb13e..12dccf42b5a29b05f894fe522c8526dc94e63b24 100644
--- a/include/php_setup.inc
+++ b/include/php_setup.inc
@@ -20,7 +20,7 @@
   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 */
 
-define("SMARTY_PATH", "smarty/Smarty.class.php");
+require_once ("variables.inc");
 
 function gosaRaiseError($errno, $errstr, $errfile, $errline)
 {
@@ -288,7 +288,14 @@ ini_set("report_memleaks",1);
 ini_set("include_path",".:$BASE_DIR/include:$BASE_DIR/include/utils/excel:/usr/share/php");
 
 /* Do smarty setup */
-require(SMARTY_PATH);
+
+if (file_exists(SMARTY)) {
+ require(SMARTY);
+} else {
+ require(SMARTY3);
+}
+
+/*require(SMARTY_PATH);*/
 $smarty = new Smarty;
 $smarty->template_dir = $BASE_DIR.'/ihtml/';
 $smarty->caching= false;
diff --git a/include/variables.inc b/include/variables.inc
new file mode 100644
index 0000000000000000000000000000000000000000..2a10e61ed774d9b74c704281d2b94c76097801af
--- /dev/null
+++ b/include/variables.inc
@@ -0,0 +1,56 @@
+<?php
+
+/*
+  This code is part of FusionDirectory (http://www.fusiondirectory.org/)
+  Copyright (C) 2003-2010  Cajus Pollmeier
+  Copyright (C) 2011  FusionDirectory
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+/* Define common locations and variables */
+
+/* Smarty compile dir */
+define ("SPOOL_DIR","/var/spool/fusiondirectory");
+
+/* Global cache dir */
+define ("CACHE_DIR","/var/cache/fusiondirectory");
+
+/* Global locale cache dir */
+define ("LOCALE_DIR", "/var/cache/fusiondirectory/locale");
+
+/* Global tmp dir */
+define ("TEMP_DIR","/var/cache/fusiondirectory/tmp");
+
+/* Directory containing the configuration template */
+define ("CONFIG_TEMPLATE_DIR", "/var/cache/fusiondirectory/template/");
+
+/* Directory containing the fai logs */
+define ("FAI_LOG_DIR", "/var/cache/fusiondirectory/fai/");
+
+/* fpdf library path */ 
+define("FPDF","/usr/share/php/fpdf/fpdf.php");
+
+/* Global FPDF FONT define */
+define("FPDF_FONTPATH", "/usr/share/php/fpdf/font/");
+
+/* path for smarty libraries */
+define("SMARTY", "/usr/share/php/smarty/libs/Smarty.class.php");
+define("SMARTY3", "/usr/share/php/smarty3/Smarty.class.php");
+
+/* name of the class.cache file */
+define("CLASS_CACHE", "class.cache");
+
+?>
\ No newline at end of file