diff --git a/3ds/acc/register.php b/3ds/acc/register.php index b79b3e5..1e99dca 100755 --- a/3ds/acc/register.php +++ b/3ds/acc/register.php @@ -25,7 +25,7 @@ if(isset($_POST["username"]) && $_POST["username"] !== "" && isset($_POST["passw 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()); + $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"=>1,"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!

"; @@ -35,4 +35,4 @@ if(!file_exists("data/" . $_POST["username"] . ".json") && !preg_match_all('/([< echo "

ERROR: That account already exists or contains symbols! (<>[]().,/\\&?$=!%^#*)

"; } } -?> \ No newline at end of file +?> diff --git a/3ds/chat/.innerch.php.swo b/3ds/chat/.innerch.php.swo new file mode 100644 index 0000000..fc4acef Binary files /dev/null and b/3ds/chat/.innerch.php.swo differ diff --git a/3ds/chat/.innerch.php.swp b/3ds/chat/.innerch.php.swp new file mode 100644 index 0000000..6242f43 Binary files /dev/null and b/3ds/chat/.innerch.php.swp differ diff --git a/3ds/chat/dsi.php b/3ds/chat/dsi.php index 89f468f..9eee834 100755 --- a/3ds/chat/dsi.php +++ b/3ds/chat/dsi.php @@ -1,4 +1,10 @@
- Back
+
- + - You have to be logged in! Login here
@@ -234,4 +240,4 @@ if(isset($_GET["room"])){ } ?> - \ No newline at end of file + diff --git a/3ds/chat/innerch.php b/3ds/chat/innerch.php index 89a4a62..766f0d9 100755 --- a/3ds/chat/innerch.php +++ b/3ds/chat/innerch.php @@ -1,5 +1,6 @@ [\/code]","time":0,"com":[]},{"title":"test","from":"HxOr1337","cont":"test! testity test test test...\r\n\r\n\r\nballs","time":1651021123,"com":[]},{"title":"Post :D","from":"HxOr1337","cont":"Posting post post post 123","time":1651713046,"com":[]},{"title":"Posted from DSi","from":"DSi","cont":"This has been posted from DSi, :D","time":1651978343,"com":[]},{"title":"We hit the min-width!","from":"DSi","cont":"Let's see what happens R:","time":1652213864,"com":[]},{"title":"3DSTownSquare.com","from":"HxOr1337","cont":"I'm proud to announce that 3DSTownsquare has been LAUNCHED! Thank you for waiting almost a month for this. It's been 31 days since 3DSTownSquare's release.","time":1653576810,"com":[]}]} \ No newline at end of file +{"name":"General Beta","description":"General topic for all users to use (beta)","allowGuest":false,"posts":[{"title":"You can now post to the forums","from":"HxOr1337","cont":"Great news everyone, you can now post to the forms!\r\n\r\nThis is a test, unfortunately. :troll:","time":1651021306,"com":[]},{"title":"Why did it roll back","from":"HxOr1337","cont":"Why?","time":1653599865,"com":[]},{"title":"asdsad","from":"HxOr1337","cont":"asdadas","time":1653599876,"com":[]}]} \ No newline at end of file diff --git a/3ds/forums/pa.php b/3ds/forums/pa.php index 22e412c..4095a13 100755 --- a/3ds/forums/pa.php +++ b/3ds/forums/pa.php @@ -5,10 +5,22 @@ body, html { = time()){ + // unset($_COOKIE["cd"]); + setCookie("cd", "", -1); + $iscd = true; +} else if(isset($_COOKIE["cd"])){ + $iscd = false; +} else { + $iscd = true; +} session_start(); - if(isset($_SESSION["ts_user"]) && $_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["topic"]) && isset($_POST["title"]) && isset($_POST["cont"])){ + if(isset($_SESSION["ts_user"]) && $_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["topic"]) && isset($_POST["title"]) && isset($_POST["cont"]) && isset($_COOKIE["cd"])){ if($_POST["title"] != "" && $_POST["cont"] != "" && strlen($_POST["title"]) <= 32 && strlen($_POST["cont"]) <= 5000){ - if(file_exists("data/topic/".$_POST["topic"].".json")){ + if(file_exists("data/topic/".$_POST["topic"].".json") && json_decode(file_get_contents("../acc/data/".$_SESSION["ts_user"].".json"),true)["banned"] <= 0 && $iscd){ + setCookie("cd", time()+30000, time()+30000); $jsonF = file_get_contents("data/topic/".$_POST["topic"].".json"); $jsonD = json_decode($jsonF, true); $posts = $jsonD["posts"]; @@ -20,6 +32,8 @@ body, html { echo "Your post has been submittedhere."; + } else { + echo "You're banned, probably."; } }else{ echo "forums.error.unknown"; @@ -27,4 +41,4 @@ body, html { } else { echo "Something went wrong.
"; echo "Debug info: ".var_dump($_SERVER["REQUEST_METHOD"]); - } \ No newline at end of file + } diff --git a/3ds/forums/~ b/3ds/forums/~ new file mode 100644 index 0000000..3177038 --- /dev/null +++ b/3ds/forums/~ @@ -0,0 +1,32 @@ + + +$_POST["title"],"from"=>$_SESSION["ts_user"],"cont"=>$_POST["cont"],"time"=>time(),"com"=>array()); + array_push($jsonD["posts"], $newPost); + $newj = json_encode($jsonD); + file_put_contents("data/topic/".$_POST["topic"].".json", $newj); + $id = count($jsonD["posts"]) - 1; + echo "Your post has been submittedhere."; + + + } + }else{ + echo "forums.error.unknown"; + } + } else { + echo "Something went wrong.
"; + echo "Debug info: ".var_dump($_SERVER["REQUEST_METHOD"]); + }