blob: 295416c0c1c661472aea2afe0f881476e1778284 [file] [log] [blame]
<?php
require_once("core.php");
if (!isset($_POST["username"]) || !isset($_POST["password"]) || empty($_POST["username"]) || empty($_POST["password"])) {
security::go("index.php?msg=empty");
}
switch (security::signIn($_POST["username"], $_POST["password"])) {
case security::SIGNIN_STATE_SIGNED_IN:
security::redirectAfterSignIn();
break;
case security::SIGNIN_STATE_NEEDS_SECOND_FACTOR:
security::go("signinsecondfactor.php");
break;
case security::SIGNIN_STATE_THROTTLED:
security::go("index.php?msg=signinthrottled");
break;
default:
security::go("index.php?msg=wrong");
}