blob: 295416c0c1c661472aea2afe0f881476e1778284 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once("core.php");
3
4if (!isset($_POST["username"]) || !isset($_POST["password"]) || empty($_POST["username"]) || empty($_POST["password"])) {
5 security::go("index.php?msg=empty");
6}
7
8switch (security::signIn($_POST["username"], $_POST["password"])) {
9 case security::SIGNIN_STATE_SIGNED_IN:
10 security::redirectAfterSignIn();
11 break;
12
13 case security::SIGNIN_STATE_NEEDS_SECOND_FACTOR:
14 security::go("signinsecondfactor.php");
15 break;
16
17 case security::SIGNIN_STATE_THROTTLED:
18 security::go("index.php?msg=signinthrottled");
19 break;
20
21 default:
22 security::go("index.php?msg=wrong");
23}