Restructuring repo

This commit is contained in:
Lauren Toivanen 2024-12-11 11:50:28 +02:00
parent 1a8e913f28
commit 436fd4d2cd
Signed by: jt
GPG key ID: 9151B109B73ECAD5
85 changed files with 8 additions and 2 deletions

View file

@ -1,16 +0,0 @@
<?php
if (empty($_POST) || !isset($_POST['submit'])) {
die("Login canceled: no post / no submit");
}
require_once('inc/database.php');
$db = new DataBase();
$user = $db->getUserByHandle($_POST['name']);
if ($db->passwordVerify($user['user.id'], $_POST['pass'])) {
$token = $db->tokenAdd($user['user.id']);
$token64 = base64_encode($token);
$expires = time() + 2592000; // 30 days
setcookie('token', $token64, $expires);
}
header("Location: /");
?>