<?php

    session_start();

    $salt="DFG#¤%23454FGHhgfhbv¤¤&";

    $user=stripslashes(htmlspecialchars($_POST['user']));
    $pass=stripslashes(htmlspecialchars($_POST['pass']));

    $users=array(
        array("twily","31471397aa65a533a849f85565a08e6ef76c434c"),
    );

    $fail=true;
    for($i=0;$i<count($users);$i++) {
        if($user==$users[$i][0]) {
            if(sha1($salt.":".$pass)==$users[$i][1]) {
                // enter
                $fail=false;
            }
        }
    }

    if($fail) {
        $_SESSION['login']=false;
        sleep(1);
        header("Location: ./");
    } else {
        $_SESSION['login']=true;
        header("Location: ./");
    }

    exit(0);
?>
