Fix login bug

This commit is contained in:
HotPizzaYT 2022-05-13 16:06:48 -05:00
commit c2152ddb46
2 changed files with 3 additions and 2 deletions

View file

@ -22,14 +22,14 @@ body, html {
<?php
if(isset($_POST["username"]) && $_POST["username"] !== "" && isset($_POST["password"]) && $_POST["password"] !== "" && isset($_POST["email"]) && $_POST["email"] !== ""){
if(!file_exists("data/" . $_POST["username"] . ".json") && !preg_match_all('/([<>\[\]\(\).,\/\\&?$=!%^#* ])/', $_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 "<p>SUCCESS: Account created successfully!</p>";
} else if (!(count($_POST["username"]) >= 3)){
} else if ((strlen($_POST["username"]) <= 3)){
echo "<p>ERROR: Username cannot be shorter than 3 characters!";
} else {
echo "<p>ERROR: That account already exists or contains symbols! (<>[]().,/\\&?$=!%^#*)</p>";

1
3ds/chat/rclaim.php Normal file
View file

@ -0,0 +1 @@
<?php file_put_contents("data/claim.global", "0"); ?>