Unnecesary direct access to user setting superseded by calls to user_* functions.
[fa-stable.git] / access / password_reset.php
index afa2a1ec01305209d87fa12396c0115ed28c3cf4..a20a2180c30b9bc59c5f87a6d584b13ea615171b 100644 (file)
@@ -17,7 +17,7 @@
        $js = "<script language='JavaScript' type='text/javascript'>
 function defaultCompany()
 {
-       document.forms[0].company_login_name.options[".$_SESSION["wa_current_user"]->company."].selected = true;
+       document.forms[0].company_login_name.options[".user_company()."].selected = true;
 }
 </script>";
        add_js_file('login.js');
@@ -57,14 +57,13 @@ function defaultCompany()
        echo "</td>\n";
        end_row();
 
-       echo "<input type='hidden' id=ui_mode name='ui_mode' value='".$_SESSION["wa_current_user"]->ui_mode."' />\n";
+       echo "<input type='hidden' id=ui_mode name='ui_mode' value='".fallback_mode()."' />\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 "<tr><td>"._("Company")."</td><td><select name='company_login_name'>\n";