From 6ddfe7a27bc3cad94294642716ef58c158cad3e5 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 10 May 2025 21:27:08 +0500 Subject: feat: private profiles --- public/account/index.php | 21 +++++++++++---------- public/account/security.php | 7 ++++--- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'public/account') diff --git a/public/account/index.php b/public/account/index.php index e5a609b..2b3e820 100644 --- a/public/account/index.php +++ b/public/account/index.php @@ -202,16 +202,17 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
- - prepare("SELECT hide_actions FROM user_preferences WHERE id = ?"); - $stmt->execute([$_SESSION["user_id"]]); - if (intval($stmt->fetch()[0]) == 1) { - echo 'checked'; - } - ?>> - - + prepare("SELECT private_profile FROM user_preferences WHERE id = ?"); + $stmt->execute([$_SESSION["user_id"]]); + if (intval($stmt->fetch()[0]) == 1) { + echo 'checked'; + } + ?>> + +

Enabling this feature will hide your authorship of uploaded emotes and + actions.

+
diff --git a/public/account/security.php b/public/account/security.php index 5110f71..5545b60 100644 --- a/public/account/security.php +++ b/public/account/security.php @@ -3,6 +3,7 @@ include_once "../../src/accounts.php"; include_once "../../src/alert.php"; include_once "../../src/config.php"; +include_once "../../src/utils.php"; if ($_SERVER["REQUEST_METHOD"] != "POST" || !authorize_user(true)) { header("Location: /account"); @@ -33,10 +34,10 @@ if (!empty($_POST["password-new"])) { ->execute([password_hash($password, PASSWORD_DEFAULT), $user["id"]]); } -$hide_actions = (int) (intval($_POST["hide-actions"] ?? "0") == 1); +$private_profile = (int) (intval($_POST["make-private"] ?? "0") == 1); -$db->prepare("UPDATE user_preferences SET hide_actions = ? WHERE id = ?") - ->execute([$hide_actions, $user["id"]]); +$db->prepare("UPDATE user_preferences SET private_profile = ? WHERE id = ?") + ->execute([$private_profile, $user["id"]]); if (intval($_POST["signout-everywhere"] ?? "0") == 1) { $db->prepare("UPDATE users SET secret_key = ? WHERE id = ?") -- cgit v1.2.3