From 3a5cad0f5fb9461d06b81903763cf504988e8091 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 8 May 2025 01:23:48 +0500 Subject: feat: security section in /account --- public/account/index.php | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'public/account/index.php') diff --git a/public/account/index.php b/public/account/index.php index 80af380..7bb19f5 100644 --- a/public/account/index.php +++ b/public/account/index.php @@ -13,9 +13,9 @@ if (!isset($_SESSION["user_id"], $_SESSION["user_name"])) { exit; } -if ($_SERVER['REQUEST_METHOD'] == "POST") { - $db = new PDO(DB_URL, DB_USER, DB_PASS); +$db = new PDO(DB_URL, DB_USER, DB_PASS); +if ($_SERVER['REQUEST_METHOD'] == "POST") { $username = str_safe($_POST["username"] ?? "", ACCOUNT_USERNAME_LENGTH[1]); if (!empty($username) && $username != $_SESSION["user_name"]) { @@ -135,9 +135,30 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
-
-

Security

- + +

Security & Privacy

+
+ + + + +
+
+ prepare("SELECT hide_actions FROM user_preferences WHERE id = ?"); + $stmt->execute([$_SESSION["user_id"]]); + if (intval($stmt->fetch()[0]) == 1) { + echo 'checked'; + } + ?>> + +
+
+ + +
+ +
-- cgit v1.2.3