Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | <?php |
| 2 | require_once("core.php"); |
| 3 | |
| 4 | if (!isset($_POST["username"]) || !isset($_POST["password"]) || empty($_POST["username"]) || empty($_POST["password"])) { |
| 5 | security::go("index.php?msg=empty"); |
| 6 | } |
| 7 | |
| 8 | switch (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 | } |