From be2912e26bdf1843c3a91fc0717b301f168d4962 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Fri, 9 May 2025 18:15:54 +0500 Subject: feat: option to log user actions --- public/emotes/upload.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'public/emotes/upload.php') diff --git a/public/emotes/upload.php b/public/emotes/upload.php index 42e58c6..96544fd 100644 --- a/public/emotes/upload.php +++ b/public/emotes/upload.php @@ -389,19 +389,21 @@ if ($is_manual) { } } -$db->prepare("INSERT INTO actions(user_id, action_type, action_payload) VALUES (?, ?, ?)") - ->execute([ - $uploaded_by, - "EMOTE_CREATE", - json_encode([ - "emote" => [ - "id" => $id, - "code" => $code, - "visibility" => $visibility, - "uploaded_by" => $uploaded_by, - ] - ]) - ]); +if (ACCOUNT_LOG_ACTIONS) { + $db->prepare("INSERT INTO actions(user_id, action_type, action_payload) VALUES (?, ?, ?)") + ->execute([ + $uploaded_by, + "EMOTE_CREATE", + json_encode([ + "emote" => [ + "id" => $id, + "code" => $code, + "visibility" => $visibility, + "uploaded_by" => $uploaded_by, + ] + ]) + ]); +} $db = null; -- cgit v1.2.3