Fixed non-default company selection bug on login.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 30 Oct 2009 13:23:44 +0000 (13:23 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 30 Oct 2009 13:23:44 +0000 (13:23 +0000)
CHANGELOG.txt
includes/session.inc

index 9e9e571d6455a483afeffa3092db2f40d7c1fb33..634cd0aa2708604150095584a0c674372b564aca 100644 (file)
@@ -19,6 +19,12 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+30-Oct-2009 Janusz Dobrowolski
+# Fixed non-default company selection bug on login.
+$ /includes/session.inc
+! Code cleanup.
+$ /includes/db/connect_db.inc
+
 30-Oct-2009 Joe Hunt
 ! Changed name on folder for global help url to fawiki.
 $ config.default.php
index f449407d9af302f698a555bb4d4810c8c86dec6d..8f780caa3220a1aba764784f0310d9101110af29 100644 (file)
@@ -206,8 +206,6 @@ set_error_handler('error_handler' /*, errtypes */);
 if (!isset($_SESSION["wa_current_user"]))
        $_SESSION["wa_current_user"] = new current_user();
 
-set_global_connection();
-
 // logout.php is the only page we should have always 
 // accessable regardless of access level and current login status.
 if (strstr($_SERVER['PHP_SELF'], 'logout.php') == false){
@@ -243,7 +241,8 @@ if (strstr($_SERVER['PHP_SELF'], 'logout.php') == false){
                        $lang = &$_SESSION['language'];
                        $lang->set_language($_SESSION['language']->code);
                }
-       }
+       } else
+               set_global_connection();
 
        if (!$_SESSION["wa_current_user"]->old_db)
                include_once($path_to_root . '/company/'.user_company().'/installed_extensions.php');
@@ -253,6 +252,8 @@ if (strstr($_SERVER['PHP_SELF'], 'logout.php') == false){
                $_SESSION["App"]->init();
        }
 }
+
+
 // POST vars cleanup needed for direct reuse.
 // We quote all values later with db_escape() before db update.
        $_POST = strip_quotes($_POST);