From: Janusz Dobrowolski Date: Sat, 10 Jan 2015 19:44:20 +0000 (+0100) Subject: Unnecesary direct access to user setting superseded by calls to user_* functions. X-Git-Tag: v2.4.2~19^2~271 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=bd8f517d30d1edd3261e26e582ddd9e11c555616;p=fa-stable.git Unnecesary direct access to user setting superseded by calls to user_* functions. --- diff --git a/access/login.php b/access/login.php index 9c58933d..dbf90ab9 100644 --- a/access/login.php +++ b/access/login.php @@ -17,7 +17,7 @@ $js = ""; add_js_file('login.js'); @@ -86,7 +86,7 @@ function defaultCompany() echo "\n"; end_row(); - echo "\n"; + echo "\n"; if (!$login_timeout) table_section_title(_("Version")." $version Build ".$SysPrefs->build_version." - "._("Login")); $value = $login_timeout ? $_SESSION['wa_current_user']->loginname : ($SysPrefs->allow_demo_mode ? "demouser":""); @@ -98,11 +98,10 @@ function defaultCompany() password_row(_("Password:"), 'password', $password); if ($login_timeout) { - hidden('company_login_name', $_SESSION["wa_current_user"]->company); + hidden('company_login_name', user_company()); } else { - if (isset($_SESSION['wa_current_user']->company)) - $coy = $_SESSION['wa_current_user']->company; - else + $coy = user_company(); + if (!isset($coy)) $coy = $def_coy; if (!@$SysPrefs->text_company_selection) { echo ""._("Company")."\n"; + echo "\n"; table_section_title(_("Version")." $version Build ".$SysPrefs->build_version." - "._("Password reset")); text_row(_("Email"), "email_entry_field", "", 20, 30); - if (isset($_SESSION['wa_current_user']->company)) - $coy = $_SESSION['wa_current_user']->company; - else + $coy = user_company(); + if (!isset($coy)) $coy = $def_coy; if (!@$SysPrefs->text_company_selection) { echo ""._("Company")."