Initial commit

This commit is contained in:
simon
2017-11-22 19:13:00 -05:00
commit e3ab67e95c
133 changed files with 202341 additions and 0 deletions

24
auth.re.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
include_once "include/UserManager.php";
include_once "include/MessageCookie.php";
include_once "include/SessionManager.php";
$username = filter_var($_POST['username'], FILTER_SANITIZE_STRING);
$password = filter_var($_POST['password'], FILTER_SANITIZE_STRING);
$user = UserManager::auth($username, $password);
if ($user != NULL) {
SessionManager::generate($user);
header("Location: index.php"); //todo user page
} else {
(new MessageCookie("Username or password incorrect", "login"))->setCookie();
header("Location: login.php#login");
}