From 57472eab3c7b035392c6a5aa240593ecaa7d1ccf Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Mon, 8 Dec 2025 21:53:36 +0500 Subject: upd: moved all /public/ files to the root folder --- public/emotes/delete.php | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 public/emotes/delete.php (limited to 'public/emotes/delete.php') diff --git a/public/emotes/delete.php b/public/emotes/delete.php deleted file mode 100644 index 6252e45..0000000 --- a/public/emotes/delete.php +++ /dev/null @@ -1,47 +0,0 @@ -prepare("SELECT uploaded_by, code FROM emotes WHERE id = ?"); -$stmt->execute([$emote_id]); - -if ($row = $stmt->fetch()) { - if ($row["uploaded_by"] === $user_id) { - $unlink = intval($_POST["unlink"] ?? "0") == 1; - - if ($unlink) { - $stmt = $db->prepare("UPDATE emotes SET uploaded_by = NULL WHERE id = ? AND uploaded_by = ?"); - $stmt->execute([$emote_id, $user_id]); - generate_alert("/emotes/?id=$emote_id", 'Your authorship has been removed for the emote "' . $row["code"] . '"', 200); - } else { - $stmt = $db->prepare("DELETE FROM emotes WHERE id = ? AND uploaded_by = ?"); - $stmt->execute([$emote_id, $user_id]); - - $path = $_SERVER["DOCUMENT_ROOT"] . "/static/userdata/emotes/$emote_id"; - array_map("unlink", glob("$path/*.*")); - rmdir($path); - - generate_alert("/emotes", 'Emote "' . $row["code"] . '" has been removed from the servers', 200); - } - } else { - generate_alert("/emotes", "You don't own the emote \"" . $row["code"] . "\"", 403); - } -} else { - generate_alert("/emotes", "Emote ID $emote_id not found", 404); -} \ No newline at end of file -- cgit v1.2.3