- if (isset($_SESSION['wa_current_user']->company))
- $coy = $_SESSION['wa_current_user']->company;
- else
- $coy = $def_coy;
- if (!@$SysPrefs->text_company_selection) {
- echo "<tr><td>"._("Company")."</td><td><select name='company_login_name'>\n";
- for ($i = 0; $i < count($db_connections); $i++)
- echo "<option value=$i ".($i==$coy ? 'selected':'') .">" . $db_connections[$i]["name"] . "</option>";
- echo "</select>\n";
- echo "</td></tr>";
- } else {
-// $coy = $def_coy;
- text_row(_("Company"), "company_login_nickname", "", 20, 50);
- }
- start_row();
- label_cell("Please enter your e-mail", "colspan=2 align='center' id='log_msg'");
- end_row();
+ $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";
+ for ($i = 0; $i < count($db_connections); $i++)
+ echo "<option value=$i ".($i==$coy ? 'selected':'') .">" . $db_connections[$i]["name"] . "</option>";
+ echo "</select>\n";
+ echo "</td></tr>";
+ } else {
+ text_row(_("Company"), "company_login_nickname", "", 20, 50);
+ }
+ start_row();
+ label_cell("Please enter your e-mail", "colspan=2 align='center' id='log_msg'");
+ end_row();