2 require_once(dirname(__FILE__).'/config.php');
3 require_once(dirname(__FILE__).'/fields.php');
4 require_once(dirname(__FILE__).'/lang/en.php');
5 require_once(dirname(__FILE__).'/lang/'.$conf['lang'].'.php');
6 require_once(dirname(__FILE__).'/functions.php');
7 require_once(dirname(__FILE__).'/template.php');
8 require_once(dirname(__FILE__).'/smarty/Smarty.class.php');
13 @ini_set('arg_separator.output', '&');
14 session_name("ldapab");
18 if (get_magic_quotes_gpc()) {
19 if (!empty($_GET)) remove_magic_quotes($_GET);
20 if (!empty($_POST)) remove_magic_quotes($_POST);
21 if (!empty($_COOKIE)) remove_magic_quotes($_COOKIE);
22 if (!empty($_REQUEST)) remove_magic_quotes($_REQUEST);
23 if (!empty($_SESSION)) remove_magic_quotes($_SESSION);
24 ini_set('magic_quotes_gpc', 0);
26 set_magic_quotes_runtime(0);
28 function remove_magic_quotes(&$array) {
29 foreach (array_keys($array) as $key) {
30 if (is_array($array[$key])) {
31 remove_magic_quotes($array[$key]);
33 $array[$key] = stripslashes($array[$key]);
38 //prepare SMARTY object
40 $smarty->compile_dir = dirname(__FILE__).'/../cache';
41 $smarty->use_sub_dirs = 0;
42 $smarty->template_dir = dirname(__FILE__).'/../templates';
43 $smarty->force_compile = $conf['smartycompile'];
45 // select the correct google api key
46 $conf['gmapkey'] = $conf['gmaps'][$_SERVER['HTTP_HOST']];