diff --git a/src/user/profile.php b/src/user/profile.php index e0794d5..8e5efd0 100644 --- a/src/user/profile.php +++ b/src/user/profile.php @@ -39,7 +39,7 @@ header("location: profile.php"); } // if post request -if (Util::securevar($_SERVER["REQUEST_METHOD"]) === "POST" && !isset($_FILES["file_up"]["tmp_name"]) && !isset($_POST["activateSub"]) && !isset($_POST["updatePassword"]) && !isset($_POST["change_display_name"]) && $System->relinkdiscord == 1) { +if (Util::securevar($_SERVER["REQUEST_METHOD"]) === "POST" && !isset($_POST["activateSub"]) && !isset($_POST["updatePassword"]) && !isset($_POST["change_display_name"]) && $System->relinkdiscord == 1) { header("Location: https://discord.com/api/oauth2/authorize?client_id=" . client_id . "&redirect_uri=" . SITE_URL . SUB_DIR . "/user/profile.php&response_type=code&scope=identify"); exit(); } @@ -104,52 +104,10 @@

Avatar

-
-
-
- - -
-
-
-
- https://www.plus2net.com/php_tutorial/php_file_upload.php - if (isset($_FILES["file_up"]["tmp_name"])) { - $file_upload_flag = "true"; - $file_up_size = $_FILES["file_up"]["size"]; - if ($_FILES["file_up"]["size"] > 3000000) { - echo ''; - $file_upload_flag = "false"; - } - if (!($_FILES["file_up"]["type"] == "image/jpeg" or $_FILES["file_up"]["type"] == "image/gif" or $_FILES["file_up"]["type"] == "image/png")) { - echo ''; - $file_upload_flag = "false"; - } - $ext = pathinfo($_FILES["file_up"]["name"], PATHINFO_EXTENSION); - $file_name = $_FILES["file_up"]["name"]; - $path = IMG_DIR . $uid; - if ($file_upload_flag == "true") { - if (@getimagesize($path . ".png")) { - unlink($path . ".png"); - } elseif (@getimagesize($path . ".jpg")) { - unlink($path . ".jpg"); - } elseif (@getimagesize($path . ".gif")) { - unlink($path . ".gif"); - } - if (move_uploaded_file($_FILES["file_up"]["tmp_name"], $path . "." . $ext)) { - chmod($path . "." . $ext, 775); - echo ''; - } else { - echo ''; - } - } else { - echo ''; - } - } ?> getSystemData()->discordlinking == 1 || $System->relinkdiscord == 1 || ($System->relinkdiscord == 0 && !$user->isDiscordLinked())) : ?>
- +