diff options
| author | ilotterytea <iltsu@alright.party> | 2025-12-08 21:53:36 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-12-08 21:53:36 +0500 |
| commit | 57472eab3c7b035392c6a5aa240593ecaa7d1ccf (patch) | |
| tree | 9da30829290f225be2dab3d383549cbfda82ed19 /public/account/delete.php | |
| parent | 6541d0f3888862ab049055fd418b700f73eed367 (diff) | |
upd: moved all /public/ files to the root folder
Diffstat (limited to 'public/account/delete.php')
| -rw-r--r-- | public/account/delete.php | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/public/account/delete.php b/public/account/delete.php deleted file mode 100644 index ec8c040..0000000 --- a/public/account/delete.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php -include "../../src/utils.php"; -include_once "../../src/config.php"; - -session_start(); - -if (!isset($_SESSION["user_id"])) { - header("Location: /account"); - exit; -} - -$db = new PDO(DB_URL, DB_USER, DB_PASS); - -$id = $_SESSION["user_id"]; - -$profile = ($_GET["profile"] ?? "false") == "true"; -$pfp = ($_GET["pfp"] ?? "false") == "true"; -$banner = ($_GET["banner"] ?? "false") == "true"; -$badge = ($_GET["badge"] ?? "false") == "true"; - -if ($pfp || $profile) { - $path = "../static/userdata/avatars/$id"; - if (is_dir($path)) { - array_map("unlink", glob("$path/*.*")); - rmdir($path); - } -} - -if ($banner || $profile) { - $path = "../static/userdata/banners/$id"; - if (is_dir($path)) { - array_map("unlink", glob("$path/*.*")); - rmdir($path); - } -} - -if ($badge || $profile) { - $db->prepare("DELETE FROM user_badges WHERE user_id = ?")->execute([$id]); -} - -if ($profile) { - $db->prepare("DELETE FROM users WHERE id = ?")->execute([$id]); - - session_unset(); - session_destroy(); - - setcookie("secret_key", "", time() - 1000); -} - -header("Location: /account");
\ No newline at end of file |
