Пример #1
0
  <head>
    <title>Log In With Two Step Verification</title>
  </head>
  <body>
    <div class="content">
      <h2>Two Step Log In</h2>
      <p>This demo shows how logSys can be used to implement two step verification.</p>
      <?php 
$two_step_login_active = false;
if (\Fr\LS::twoStepLogin() === false && isset($_POST['action_login'])) {
    $identification = $_POST['login'];
    $password = $_POST['password'];
    if ($identification == "" || $password == "") {
        $msg = array("Error", "Username / Password Wrong !");
    } else {
        $login = \Fr\LS::twoStepLogin($identification, $password, isset($_POST['remember_me']));
        if ($login === false) {
            echo "<h2>Error</h2><p>Username / Password Wrong !</p>";
        } else {
            if (is_array($login) && $login['status'] == "blocked") {
                echo "<h2>Error</h2><p>Too many login attempts. You can attempt login after " . $login['minutes'] . " minutes (" . $login['seconds'] . " seconds)</p>";
            } else {
                $two_step_login_active = true;
            }
        }
    }
}
if (!$two_step_login_active) {
    ?>
        <form action="login.php" method="POST" style="margin:0px auto;display:table;">
          <label>