Unnecesary direct access to user setting superseded by calls to user_* functions.
[fa-stable.git] / includes / db / connect_db_mysql.inc
index b25f0b239a71fadb7c9d2e1340582503ed278ab6..2f30aef0fa75ec24a3891b70fcb70477231cc553 100644 (file)
@@ -18,7 +18,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