- hidden('company_login_name', $_SESSION["wa_current_user"]->company);
- } else {
- if (isset($_SESSION['wa_current_user']->company))
- $coy = $_SESSION['wa_current_user']->company;
- else
- $coy = $def_coy;
- 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";
- start_row();
- label_cell($demo_text, "colspan=2 align='center'");
- end_row();
- };
+ hidden('company_login_name', 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";
+ 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);
+ }
+ }
+ }
+ else {
+ $demo_text = '<span class="redfg">'._("HTTP access is not allowed on this site. This is unsecure. If you really want to access this unsecure site then set the SECURE_ONLY to false in /includes/session.inc file.").'</span>';
+ }
+ start_row();
+ label_cell($demo_text, "colspan=2 align='center' id='log_msg'");
+ end_row();