mirror of
https://github.com/ellite/Wallos.git
synced 2026-02-22 06:19:24 -06:00
feat: support automatic dark mode
refactor: run linter and cleanup php files fix: not every payment cycle was shown on the calendar feat: also show previous payments on the calendar for the current month
This commit is contained in:
36
logout.php
36
logout.php
@@ -1,20 +1,20 @@
|
||||
<?php
|
||||
require_once 'includes/connect.php';
|
||||
session_start();
|
||||
// get token from cookie to remove from DB
|
||||
if (isset($_SESSION['token'])) {
|
||||
$token = $_SESSION['token'];
|
||||
$sql = "DELETE FROM login_tokens WHERE token = :token AND user_id = :userId";
|
||||
$stmt = $db->prepare($sql);
|
||||
$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);
|
||||
$db->close();
|
||||
header("Location: .");
|
||||
exit();
|
||||
require_once 'includes/connect.php';
|
||||
session_start();
|
||||
// get token from cookie to remove from DB
|
||||
if (isset($_SESSION['token'])) {
|
||||
$token = $_SESSION['token'];
|
||||
$sql = "DELETE FROM login_tokens WHERE token = :token AND user_id = :userId";
|
||||
$stmt = $db->prepare($sql);
|
||||
$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);
|
||||
$db->close();
|
||||
header("Location: .");
|
||||
exit();
|
||||
?>
|
||||
Reference in New Issue
Block a user