From c2152ddb465c1fd0b996782e78acb49598c2c19f Mon Sep 17 00:00:00 2001 From: HotPizzaYT <57576298+HotPizzaYT@users.noreply.github.com> Date: Fri, 13 May 2022 16:06:48 -0500 Subject: [PATCH] Fix login bug --- 3ds/acc/register.php | 4 ++-- 3ds/chat/rclaim.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 3ds/chat/rclaim.php diff --git a/3ds/acc/register.php b/3ds/acc/register.php index bdeb479..b79b3e5 100644 --- a/3ds/acc/register.php +++ b/3ds/acc/register.php @@ -22,14 +22,14 @@ body, html { \[\]\(\).,\/\\&?$=!%^#* ])/', $_POST["username"]) && count($_POST["username"]) >= 3){ +if(!file_exists("data/" . $_POST["username"] . ".json") && !preg_match_all('/([<>\[\]\(\).,\/\\&?$=!%^#* ])/', $_POST["username"]) && strlen($_POST["username"]) >= 3){ $passHash = password_hash($_POST["password"], PASSWORD_ARGON2ID); $date = date('Y/m/d H:i:s'); $details = array("username" => $_POST["username"], "password" => $passHash, "email" => $_POST["email"], "timezone" => "UTC", "created"=>$date,"createdmt"=>microtime(),"profile"=>"I have not filled this in yet","profilecomments"=>array(),"apps"=>array(),"hasPublishedCB"=>false,"comicbooks"=>array(0),"ownedComics"=>array(),"points"=>30,"cmsg"=>0,"forumPosts"=>array(),"reputation"=>1500,"banned"=>0,"admin"=>0,"ownedApps"=>array(),"drawings"=>array(),"pms"=>array()); $detailsEncoded = json_encode($details, true); file_put_contents("data/" . $_POST["username"] . ".json", $detailsEncoded); echo "
SUCCESS: Account created successfully!
"; - } else if (!(count($_POST["username"]) >= 3)){ + } else if ((strlen($_POST["username"]) <= 3)){ echo "ERROR: Username cannot be shorter than 3 characters!"; } else { echo "
ERROR: That account already exists or contains symbols! (<>[]().,/\\&?$=!%^#*)
"; diff --git a/3ds/chat/rclaim.php b/3ds/chat/rclaim.php new file mode 100644 index 0000000..1f237d8 --- /dev/null +++ b/3ds/chat/rclaim.php @@ -0,0 +1 @@ + \ No newline at end of file