<![endif]-->
  </head>

  <body>

    <div class="container">
      <form class="form-signin" method="post" action="login.php?page=log">
        <h2 class="form-signin-heading">Bitte melde dich an</h2>
        <label for="eingabefeldEmail" class="sr-only">Email-Adresse</label>
			<?php 
function wrong()
{
    echo "<center><font color='red' aliqn='center'>Benutzername oder Passwort inkorrekt.</font></center>";
}
if ($verhalten == 2) {
    wrong();
}
?>
        <input type="text" id="eingabefeldEmail" name="user" class="form-control" placeholder="Benutzername">
        <label for="eingabefeldPasswort" class="sr-only">Passwort</label>
        <input type="password" id="eingabefeldPasswort" name="passwort" class="form-control" placeholder="Passwort" required>
        <div class="checkbox">
          <label>
            <input type="checkbox" value="remember-me"> Anmeldung speichern
          </label>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="submit">Anmelden</button>
      </form>

    </div> <!-- /container -->
    <!-- IE10-Anzeigefenster-Hack für Fehler auf Surface und Desktop-Windows-8 -->
Example #2
0
 $perms_list = $results[6];
 // value of perms for users group db
 $_SESSION['perms'] = array();
 $perms_list_items = array();
 $perms_list_items = explode(",", $perms_list);
 foreach ($perms as $perm) {
     $id = $perm['id'];
     $name = $perm['name'];
     $_SESSION['perms'][$name] = false;
     if (in_array($id, $perms_list_items)) {
         $_SESSION['perms'][$name] = true;
     }
 }
 if (!$_SESSION['perms']['login']) {
     // if the perm login is not granted the account has been deactivated
     wrong(1);
     sendBack('Your account has beeen de-activated, please contact your site admin.');
     exit;
 }
 $_SESSION['user_id'] = $results[0];
 // set user id
 $_SESSION['last_ip'] = $results[1];
 // set last known ip
 $_SESSION['last_seen'] = $results[2];
 // set last time seen.
 $_SESSION['username'] = $username;
 // set username equal to the username that was used to login
 $_SESSION['name'] = $results[3];
 // get the users display name
 $_SESSION['email'] = $results[4];
 // users email address
Example #3
0
function learn(&$user, $filter)
{
    $card = next_card($user, $filter);
    if ($card == NULL) {
        return false;
    }
    $user_card = sql_single_query("select * from user_cards where user_id = {$user['id']} and card_id = {$card['id']}");
    $mylang = $user['language'];
    // pick out the second language from a (for example: /en-ro/) tag (which should be the first tag)
    // note this only works for language cards, this needs work WORK !!!
    $learning = substr($card['tags'], 4, 2);
    $language = get_translated_language($mylang, $learning);
    $prompt = array("en" => "What is the {$language} for ", "nl" => "Wat is het {$language} voor", "de" => "Wie sagt man auf {$language}", "ro" => "Cum se zice in {$language}")[$mylang];
    $goodanswer = array("en" => "the right answer was", "nl" => "het goede antwoord was", "de" => "die richtige antword war", "ro" => "bun resuns e");
    $front = json_decode($card['front'], 1);
    $back = json_decode($card['back'], 1);
    $exposure_start = microtime(true);
    // prompt the user and wait for the answer
    if (abs($user_card['first'] - time(0)) < 5) {
        $fresh = red("*");
    } else {
        $fresh = " ";
    }
    $answer = termline("{$fresh} {$prompt}: " . color_string($front['sp'], "yellow") . " ");
    $exposure_took = intval(1000 * (microtime(true) - $exposure_start));
    if ($answer === NULL) {
        return false;
    }
    if (process_answer($user, $card, $answer, $exposure_took)) {
        echo correct($mylang);
        $user['ngood']++;
    } else {
        $user['nfalse']++;
        echo $goodanswer[$mylang] . ": " . color_string($back['sp'], "yellow") . "\n";
        echo wrong($mylang);
    }
    $ratio = intval(100 * ($user['ngood'] / ($user['ngood'] + $user['nfalse'])));
    $interval = sql_simple_query("select `interval` from user_cards where id={$user_card['id']}");
    echo "! took {$exposure_took} ms, right this session: {$ratio}% total score {$user['score']} next in {$interval} seconds\n";
    echo "\n";
    echo "\n";
    return true;
}