blob: f86aa6800a0279a82a7c1f798ede6c0e1bfbc068 [file] [log] [blame]
<?php
require '../credentials.php';
require 'utils.php';
require_once("security.php");
$credentials = new Credentials();
$usersdb = $credentials->usersdb;
date_default_timezone_set("Europe/Madrid");
if (!isset($_POST["user"])) {
header("Location: /?wronguser=1");
exit();
}
$user = $_POST["user"];
$password = $_POST["password"] ?? "";
$ok = Security::signIn($user, $password);
// Redirect if wrong
if (!$ok) {
header("Location: /?wrongpassword=1");
exit();
}
// Success, proceed to main page
header("Location: /main.php");