feat!: allow registration of multiple users (#340)
feat: administration area feat: add reset password functionality
This commit is contained in:
+5
-4
@@ -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();
|
||||
?>
|
||||
Reference in New Issue
Block a user