feat!: allow registration of multiple users (#340)

feat: administration area
feat: add reset password functionality
This commit is contained in:
Miguel Ribeiro
2024-05-26 23:30:51 +02:00
committed by GitHub
parent 57b5c3deec
commit e1006e5823
90 changed files with 3131 additions and 867 deletions
+5 -4
View File
@@ -4,16 +4,17 @@
// get token from cookie to remove from DB
if (isset($_SESSION['token'])) {
$token = $_SESSION['token'];
$sql = "DELETE FROM login_tokens WHERE token = ?";
$sql = "DELETE FROM login_tokens WHERE token = :token AND user_id = :userId";
$stmt = $db->prepare($sql);
$stmt->bindValue(1, $token, SQLITE3_TEXT);
$stmt->bindParam(':token', $token, SQLITE3_TEXT);
$stmt->bindParam(':userId', $userId, SQLITE3_INTEGER);
$stmt->execute();
}
$_SESSION = array();
session_destroy();
$cookieExpire = time() - 3600;
setcookie('wallos_login', '', $cookieExpire);
setcookie('wallos_login', '', $cookieExpire);
$db->close();
header("Location: .");
header("Location: .");
exit();
?>