Unnecesary direct access to user setting superseded by calls to user_* functions.
[fa-stable.git] / includes / db / connect_db_mysqli.inc
index cc53bcfa25a903af973086a32aa28c27225c99ab..79e299e4e6ad9dd6e302e1cd0cca5964b6a24e81 100644 (file)
@@ -20,7 +20,7 @@ function set_global_connection($company=-1)
 
        include ($path_to_root . "/config_db.php");
        if ($company == -1) 
-               $company = $_SESSION["wa_current_user"]->company;
+               $company = user_company();
 
        cancel_transaction(); // cancel all aborted transactions (if any)