get("no access permission", false); } /* Authenticate user */ $userpass_ok = false; $multiauth = false; if (Login::checkLoginServer()) { if (empty($VARS['progress'])) { // Easy way to remove "undefined" warnings. } else if ($VARS['progress'] == "1") { if (!CAPTCHA_ENABLED || (CAPTCHA_ENABLED && Login::verifyCaptcha($VARS['captcheck_session_code'], $VARS['captcheck_selected_answer'], CAPTCHA_SERVER . "/api.php"))) { $autherror = ""; $user = User::byUsername($VARS['username']); if ($user->exists()) { $status = $user->getStatus()->getString(); switch ($status) { case "LOCKED_OR_DISABLED": $alert = $Strings->get("account locked", false); break; case "TERMINATED": $alert = $Strings->get("account terminated", false); break; case "CHANGE_PASSWORD": $alert = $Strings->get("password expired", false); break; case "NORMAL": $username_ok = true; break; case "ALERT_ON_ACCESS": $mail_resp = $user->sendAlertEmail(); if (DEBUG) { var_dump($mail_resp); } $username_ok = true; break; default: if (!is_empty($error)) { $alert = $error; } else { $alert = $Strings->get("login error", false); } break; } if ($username_ok) { if ($user->checkPassword($VARS['password'])) { $_SESSION['passok'] = true; // stop logins using only username and authcode if ($user->has2fa()) { $multiauth = true; } else { Session::start($user); header('Location: app.php'); die("Logged in, go to app.php"); } } else { $alert = $Strings->get("login incorrect", false); } } } else { // User does not exist anywhere $alert = $Strings->get("login incorrect", false); } } else { $alert = $Strings->get("captcha error", false); } } else if ($VARS['progress'] == "2") { $user = User::byUsername($VARS['username']); if ($_SESSION['passok'] !== true) { // stop logins using only username and authcode sendError("Password integrity check failed!"); } if ($user->check2fa($VARS['authcode'])) { Session::start($user); header('Location: app.php'); die("Logged in, go to app.php"); } else { $alert = $Strings->get("2fa incorrect", false); } } } else { $alert = $Strings->get("login server unavailable", false); } header("Link: ; rel=preload; as=style", false); header("Link: ; rel=preload; as=style", false); header("Link: ; rel=preload; as=style", false); header("Link: ; rel=preload; as=style", false); header("Link: ; rel=preload; as=script", false); header("Link: ; rel=preload; as=script", false); ?> <?php echo SITE_TITLE; ?>
get("sign in"); ?>
" required="required" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" autofocus />
" required="required" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />

get("2fa prompt"); ?>
" required="required" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" autofocus />