+ $value = $login_timeout ? $_SESSION['wa_current_user']->loginname : ($SysPrefs->allow_demo_mode ? "demouser":"");
+
+ $allow = SECURE_ONLY !== true ? true : (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_NAME'] === "localhost";
+
+ if ($allow) {
+
+ text_row(_("User name"), "user_name_entry_field", $value, 20, 30);
+
+ $password = $SysPrefs->allow_demo_mode ? "password":"";
+
+ password_row(_("Password:"), 'password', $password);
+
+ if ($login_timeout) {
+ 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();
+ end_table(1);
+ echo "<input type='hidden' id=ui_mode name='ui_mode' value='".!fallback_mode()."' >\n";
+ if ($allow) {
+ echo "<center><input type='submit' value=' "._("Login -->")." ' name='SubmitUser'"
+ ." onclick='".(in_ajax() ? 'retry();': 'set_fullmode();')."'".(isset($blocked) ? " disabled" : '')." ></center>\n";
+ }