summaryrefslogtreecommitdiff
path: root/public/account
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-05-10 21:27:08 +0500
committerilotterytea <iltsu@alright.party>2025-05-10 21:27:08 +0500
commit6ddfe7a27bc3cad94294642716ef58c158cad3e5 (patch)
tree0fcd7b57024580d44456cba76bd40a4fd06d9ef7 /public/account
parentfb2fd0644c4f74e09a9fe6b8cc1af931c77b04df (diff)
feat: private profiles
Diffstat (limited to 'public/account')
-rw-r--r--public/account/index.php21
-rw-r--r--public/account/security.php7
2 files changed, 15 insertions, 13 deletions
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") {
<input type="password" name="password-new" id="form-password-new">
</div>
<div>
- <?php if (ACCOUNT_LOG_ACTIONS): ?>
- <input type="checkbox" name="hide-actions" value="1" id="form-hide-actions" <?php
- $stmt = $db->prepare("SELECT hide_actions FROM user_preferences WHERE id = ?");
- $stmt->execute([$_SESSION["user_id"]]);
- if (intval($stmt->fetch()[0]) == 1) {
- echo 'checked';
- }
- ?>>
- <label for="hide-actions" class="inline">Hide actions</label>
- <?php endif; ?>
+ <input type="checkbox" name="make-private" value="1" id="form-make-private" <?php
+ $stmt = $db->prepare("SELECT private_profile FROM user_preferences WHERE id = ?");
+ $stmt->execute([$_SESSION["user_id"]]);
+ if (intval($stmt->fetch()[0]) == 1) {
+ echo 'checked';
+ }
+ ?>>
+ <label for="make-private" class="inline">Make profile private</label>
+ <p class="font-small">Enabling this feature will hide your authorship of uploaded emotes and
+ actions.</p>
+
</div>
<div>
<input type="checkbox" name="signout-everywhere" value="1" id="form-signout-everywhere">
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 = ?")