Exchange rate bug when searching a non existing customer
[fa-stable.git] / includes / session.inc
index 8f780caa3220a1aba764784f0310d9101110af29..8929ff2e4341e83a777b7e75ebd4fb7d76e8789c 100644 (file)
@@ -162,19 +162,23 @@ session_start();
 // this is to fix the "back-do-you-want-to-refresh" issue - thanx PHPFreaks
 header("Cache-control: private");
 
+
 get_text_init();
 
 // Page Initialisation
 if (!isset($_SESSION['language'])) 
 {
-       load_languages(); // sets also default $_SESSION['language']
+       $l = array_search_value($dflt_lang, $installed_languages,  'code');
+       $_SESSION['language'] = new language($l['name'], $l['code'], $l['encoding'],
+        isset($l['rtl']) ? 'rtl' : 'ltr');
 }
 
 $_SESSION['language']->set_language($_SESSION['language']->code);
 
 // include $Hooks object if locale file exists
-if(@include_once($path_to_root . "/lang/".$_SESSION['language']->code."/locale.inc")) 
+if (file_exists($path_to_root . "/lang/".$_SESSION['language']->code."/locale.inc"))
 {
+       include_once($path_to_root . "/lang/".$_SESSION['language']->code."/locale.inc");
        $Hooks = new Hooks();
 }
 
@@ -183,7 +187,7 @@ include_once($path_to_root . "/config.php");
 include_once($path_to_root . "/includes/main.inc");
 
 // Ajax communication object
-$Ajax =& new Ajax();
+$Ajax = new Ajax();
 
 // js/php validation rules container
 $Validate = array();