close(); header("Location: ."); exit(); } $theme = "light"; if (isset($_COOKIE['theme'])) { $theme = $_COOKIE['theme']; } $colorTheme = "blue"; if (isset($_COOKIE['colorTheme'])) { $colorTheme = $_COOKIE['colorTheme']; } $validated = false; if (isset($_GET['email']) && isset($_GET['token'])) { $email = $_GET['email']; $token = $_GET['token']; $query = "SELECT * FROM email_verification WHERE email = :email AND token = :token"; $stmt = $db->prepare($query); $stmt->bindValue(':email', $email, SQLITE3_TEXT); $stmt->bindValue(':token', $token, SQLITE3_TEXT); $result = $stmt->execute(); $row = $result->fetchArray(SQLITE3_ASSOC); if ($row) { $query = "DELETE FROM email_verification WHERE email = :email AND token = :token"; $stmt = $db->prepare($query); $stmt->bindValue(':email', $email, SQLITE3_TEXT); $stmt->bindValue(':token', $token, SQLITE3_TEXT); $stmt->execute(); $validated = true; header("Location: login.php?validated=true"); exit; } else { $query = "SELECT require_email_verification FROM admin"; $stmt = $db->prepare($query); $result = $stmt->execute(); $settings = $result->fetchArray(SQLITE3_ASSOC); if ($settings['require_email_verification'] != 1) { header("Location: ."); exit; } } } ?>
"/>