X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fsession.inc;h=6de875b93bc78f3a81febbf9a816ef7b1a6be44b;hb=c3d277136992c82db575d5e38f0906625b07da2c;hp=4a67da7aa964d5e5f68e941dff95a9ee355eaded;hpb=e3b48984f41047ad16201ff1e757af02d228d79e;p=fa-stable.git diff --git a/includes/session.inc b/includes/session.inc index 4a67da7a..6de875b9 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -103,6 +103,7 @@ include_once($path_to_root . "/includes/current_user.inc"); include_once($path_to_root . "/includes/lang/language.php"); include_once($path_to_root . "/config_db.php"); include_once($path_to_root . "/includes/ajax.inc"); +include_once($path_to_root . "/includes/ui/ui_msgs.inc"); /* Make sure this directory exists and is writable! @@ -114,31 +115,20 @@ 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['languages'])) { - language::load_languages(); + language::load_languages(); // sets also default $_SESSION['language'] } -$lang = $_SESSION['language']; - -// get_text support -get_text::init(); -get_text::set_language($lang->code, $lang->encoding); -//get_text::add_domain("wa", $path_to_root . "/lang"); -get_text::add_domain($lang->code, $path_to_root . "/lang"); - -// Necessary for ajax calls. Due to bug in php 4.3.10 for this -// version set globally in php.ini -ini_set('default_charset', $_SESSION['language']->encoding); +language::set_language($_SESSION['language']->code); include_once($path_to_root . "/config.php"); - -$Ajax =& new Ajax(); - include_once($path_to_root . "/includes/main.inc"); -include_once($path_to_root . "/includes/ui/ui_msgs.inc"); +$Ajax =& new Ajax(); // intercept all output to destroy it in case of ajax call register_shutdown_function('ob_end_flush'); @@ -149,6 +139,7 @@ set_error_handler('error_handler' /*, errtypes */); if (!isset($_SESSION["wa_current_user"])) $_SESSION["wa_current_user"] = new current_user(); +set_global_connection(); if (!$_SESSION["wa_current_user"]->logged_in()) { @@ -170,10 +161,14 @@ if (!$_SESSION["wa_current_user"]->logged_in()) login_fail(); } $lang = $_SESSION['language']; - get_text::set_language($lang->code, $lang->encoding); + language::set_language($_SESSION['language']->code); } } +if (!isset($_SESSION["App"])) { + $_SESSION["App"] = new front_accounting(); + $_SESSION["App"]->init(); +} // Run with debugging messages for the system administrator(s) but not anyone else /*if (in_array(15, $security_groups[$_SESSION["AccessLevel"]])) {