diff --git a/acceptGJFriendRequest20.php b/acceptGJFriendRequest20.php
index 8dad437ae..e2a449fbf 100644
--- a/acceptGJFriendRequest20.php
+++ b/acceptGJFriendRequest20.php
@@ -1,3 +1,3 @@
\ No newline at end of file
diff --git a/accounts/accountManagement.php b/accounts/accountManagement.php
index 017fe4c01..a6aa16e7f 100644
--- a/accounts/accountManagement.php
+++ b/accounts/accountManagement.php
@@ -1,3 +1,3 @@
\ No newline at end of file
diff --git a/accounts/backupGJAccount.php b/accounts/backupGJAccount.php
index 536d8ace1..3b374a92a 100644
--- a/accounts/backupGJAccount.php
+++ b/accounts/backupGJAccount.php
@@ -1,9 +1,10 @@
",$saveData)[1];
- $orbs = explode("",$orbs)[0];
- $lvls = explode("",$lvls)[1];
- $lvls = explode("",$lvls)[0];
- $protected_key_encoded = "";
- //if($cloudSaveEncryption == 0){
- $saveData = str_replace("".$password."", "password", $saveData); //replacing pass
- //file_put_contents($userName, $saveData);
- $saveData = gzencode($saveData); //encoding back
- $saveData = base64_encode($saveData);
- $saveData = str_replace("+","-",$saveData);
- $saveData = str_replace("/","_",$saveData);
- $saveData = $saveData . ";" . $saveDataArr[1]; //merging ccgamemanager and cclocallevels
- /*}else if($cloudSaveEncryption == 1){
- $saveData = ExploitPatch::remove($_POST["saveData"]);
- $protected_key = KeyProtectedByPassword::createRandomPasswordProtectedKey($password);
- $protected_key_encoded = $protected_key->saveToAsciiSafeString();
- $user_key = $protected_key->unlockKey($password);
- $saveData = Crypto::encrypt($saveData, $user_key);
- }*/
- //$query = $db->prepare("UPDATE `accounts` SET `saveData` = :saveData WHERE userName = :userName");
- //$query->execute([':saveData' => $saveData, ':userName' => $userName]);
- $query = $db->prepare("SELECT accountID FROM accounts WHERE userName = :userName");
- $query->execute([':userName' => $userName]);
- $accountID = $query->fetchColumn();
- if(!is_numeric($accountID)){
- exit("-1");
- }
- file_put_contents("../data/accounts/$accountID",$saveData);
- file_put_contents("../data/accounts/keys/$accountID","");
- $query = $db->prepare("SELECT extID FROM users WHERE userName = :userName LIMIT 1");
- $query->execute([':userName' => $userName]);
- $result = $query->fetchAll();
- $result = $result[0];
- $extID = $result["extID"];
- $query = $db->prepare("UPDATE `users` SET `orbs` = :orbs, `completedLvls` = :lvls WHERE extID = :extID");
- $query->execute([':orbs' => $orbs, ':extID' => $extID, ':lvls' => $lvls]);
- echo "1";
+ $saveDataArr = explode(";", $saveData); //splitting ccgamemanager and cclocallevels
+ $saveData = str_replace("-", "+", $saveDataArr[0]); //decoding
+ $saveData = str_replace("_", "/", $saveData);
+ $saveData = base64_decode($saveData);
+ $saveData = gzdecode($saveData);
+ $orbs = explode("", $saveData)[1];
+ $orbs = explode("", $orbs)[0];
+ $lvls = explode("", $lvls)[1];
+ $lvls = explode("", $lvls)[0];
+ $protected_key_encoded = "";
+ //if($cloudSaveEncryption == 0){
+ $saveData = str_replace("".$password."", "password", $saveData); //replacing pass
+ //file_put_contents($userName, $saveData);
+ $saveData = gzencode($saveData); //encoding back
+ $saveData = base64_encode($saveData);
+ $saveData = str_replace("+", "-", $saveData);
+ $saveData = str_replace("/", "_", $saveData);
+ $saveData = $saveData . ";" . $saveDataArr[1]; //merging ccgamemanager and cclocallevels
+ /*}else if($cloudSaveEncryption == 1){
+ $saveData = ExploitPatch::remove($_POST["saveData"]);
+ $protected_key = KeyProtectedByPassword::createRandomPasswordProtectedKey($password);
+ $protected_key_encoded = $protected_key->saveToAsciiSafeString();
+ $user_key = $protected_key->unlockKey($password);
+ $saveData = Crypto::encrypt($saveData, $user_key);
+ }*/
+ //$query = $db->prepare("UPDATE `accounts` SET `saveData` = :saveData WHERE userName = :userName");
+ //$query->execute([':saveData' => $saveData, ':userName' => $userName]);
+ $query = $db->prepare("SELECT accountID FROM accounts WHERE userName = :userName");
+ $query->execute([':userName' => $userName]);
+ $accountID = $query->fetchColumn();
+ if (!is_numeric($accountID)) {
+ exit("-1");
+ }
+ file_put_contents("../data/accounts/$accountID", $saveData);
+ file_put_contents("../data/accounts/keys/$accountID", "");
+ $query = $db->prepare("SELECT extID FROM users WHERE userName = :userName LIMIT 1");
+ $query->execute([':userName' => $userName]);
+ $result = $query->fetchAll();
+ $result = $result[0];
+ $extID = $result["extID"];
+ $query = $db->prepare("UPDATE `users` SET `orbs` = :orbs, `completedLvls` = :lvls WHERE extID = :extID");
+ $query->execute([':orbs' => $orbs, ':extID' => $extID, ':lvls' => $lvls]);
+ echo "1";
+} else {
+ echo -1;
}
-else
-{
- echo -1;
-}
-?>
\ No newline at end of file
diff --git a/accounts/loginGJAccount.php b/accounts/loginGJAccount.php
index b8f57a552..a73f21054 100644
--- a/accounts/loginGJAccount.php
+++ b/accounts/loginGJAccount.php
@@ -1,4 +1,5 @@
prepare("SELECT accountID FROM accounts WHERE userName LIKE :userName");
$query->execute([':userName' => $userName]);
-if($query->rowCount() == 0){
- exit("-1");
+if ($query->rowCount() == 0) {
+ exit("-1");
}
$id = $query->fetchColumn();
//rate limiting
@@ -21,40 +22,39 @@
/*$query6 = $db->prepare("SELECT count(*) FROM actions WHERE type = '1' AND timestamp > :time AND value2 = :ip");
$query6->execute([':time' => $newtime, ':ip' => $ip]);
if($query6->fetchColumn() > 5){
- exit("-12");
+ exit("-12");
}*/
//authenticating
$pass = GeneratePass::isValidUsrname($userName, $password);
if ($pass == 1) { //success
- //userID
- $query2 = $db->prepare("SELECT userID FROM users WHERE extID = :id");
+ //userID
+ $query2 = $db->prepare("SELECT userID FROM users WHERE extID = :id");
- $query2->execute([':id' => $id]);
- if ($query2->rowCount() > 0) {
- $userID = $query2->fetchColumn();
- } else {
- $query = $db->prepare("INSERT INTO users (isRegistered, extID, userName)
+ $query2->execute([':id' => $id]);
+ if ($query2->rowCount() > 0) {
+ $userID = $query2->fetchColumn();
+ } else {
+ $query = $db->prepare("INSERT INTO users (isRegistered, extID, userName)
VALUES (1, :id, :userName)");
- $query->execute([':id' => $id, ':userName' => $userName]);
- $userID = $db->lastInsertId();
- }
- //logging
- $query6 = $db->prepare("INSERT INTO actions (type, value, timestamp, value2) VALUES
+ $query->execute([':id' => $id, ':userName' => $userName]);
+ $userID = $db->lastInsertId();
+ }
+ //logging
+ $query6 = $db->prepare("INSERT INTO actions (type, value, timestamp, value2) VALUES
('2',:username,:time,:ip)");
- $query6->execute([':username' => $userName, ':time' => time(), ':ip' => $ip]);
- //result
- echo $id.",".$userID;
- if(!is_numeric($udid)){
- $query2 = $db->prepare("SELECT userID FROM users WHERE extID = :udid");
- $query2->execute([':udid' => $udid]);
- $usrid2 = $query2->fetchColumn();
- $query2 = $db->prepare("UPDATE levels SET userID = :userID, extID = :extID WHERE userID = :usrid2");
- $query2->execute([':userID' => $userID, ':extID' => $id, ':usrid2' => $usrid2]);
- }
-}elseif ($pass == -1){ //failure
- echo -12;
-}else{
- echo -1;
+ $query6->execute([':username' => $userName, ':time' => time(), ':ip' => $ip]);
+ //result
+ echo $id.",".$userID;
+ if (!is_numeric($udid)) {
+ $query2 = $db->prepare("SELECT userID FROM users WHERE extID = :udid");
+ $query2->execute([':udid' => $udid]);
+ $usrid2 = $query2->fetchColumn();
+ $query2 = $db->prepare("UPDATE levels SET userID = :userID, extID = :extID WHERE userID = :usrid2");
+ $query2->execute([':userID' => $userID, ':extID' => $id, ':usrid2' => $usrid2]);
+ }
+} elseif ($pass == -1) { //failure
+ echo -12;
+} else {
+ echo -1;
}
-?>
\ No newline at end of file
diff --git a/accounts/registerGJAccount.php b/accounts/registerGJAccount.php
index 79d391d85..f322baa54 100644
--- a/accounts/registerGJAccount.php
+++ b/accounts/registerGJAccount.php
@@ -1,33 +1,34 @@
20)
- exit("-4");
- //checking if name is taken
- $query2 = $db->prepare("SELECT count(*) FROM accounts WHERE userName LIKE :userName");
- $query2->execute([':userName' => $userName]);
- $regusrs = $query2->fetchColumn();
- if ($regusrs > 0) {
- echo "-2";
- }else{
- $hashpass = password_hash($password, PASSWORD_DEFAULT);
- $query = $db->prepare("INSERT INTO accounts (userName, password, email, registerDate, isActive)
+if ($_POST["userName"] != "") {
+ //here im getting all the data
+ $userName = ExploitPatch::remove($_POST["userName"]);
+ $password = ExploitPatch::remove($_POST["password"]);
+ $email = ExploitPatch::remove($_POST["email"]);
+ $secret = "";
+ //checking if username is within the GD length limit
+ if (strlen($userName) > 20) {
+ exit("-4");
+ }
+ //checking if name is taken
+ $query2 = $db->prepare("SELECT count(*) FROM accounts WHERE userName LIKE :userName");
+ $query2->execute([':userName' => $userName]);
+ $regusrs = $query2->fetchColumn();
+ if ($regusrs > 0) {
+ echo "-2";
+ } else {
+ $hashpass = password_hash($password, PASSWORD_DEFAULT);
+ $query = $db->prepare("INSERT INTO accounts (userName, password, email, registerDate, isActive)
VALUES (:userName, :password, :email, :time, :isActive)");
- $query->execute([':userName' => $userName, ':password' => $hashpass, ':email' => $email, ':time' => time(), ':isActive' => $preactivateAccounts ? 1 : 0]);
- echo "1";
- }
+ $query->execute([':userName' => $userName, ':password' => $hashpass, ':email' => $email, ':time' => time(), ':isActive' => $preactivateAccounts ? 1 : 0]);
+ echo "1";
+ }
}
-?>
\ No newline at end of file
diff --git a/accounts/syncGJAccount.php b/accounts/syncGJAccount.php
index 3b46d01b9..724c4565c 100644
--- a/accounts/syncGJAccount.php
+++ b/accounts/syncGJAccount.php
@@ -1,3 +1,3 @@
\ No newline at end of file
diff --git a/accounts/syncGJAccount20.php b/accounts/syncGJAccount20.php
index 34aedc29c..b6b64d260 100644
--- a/accounts/syncGJAccount20.php
+++ b/accounts/syncGJAccount20.php
@@ -1,4 +1,5 @@
prepare("SELECT accountID FROM accounts WHERE userName = :userName");
- $query->execute([':userName' => $userName]);
- $accountID = $query->fetchColumn();
- if(!is_numeric($accountID) || !file_exists("../data/accounts/$accountID")){
- exit("-1");
- }else{
- $saveData = file_get_contents("../data/accounts/$accountID");
- if(file_exists("../data/accounts/keys/$accountID") && substr($saveData,0,3) != "H4s"){
- $protected_key_encoded = file_get_contents("../data/accounts/keys/$accountID");
- $protected_key = KeyProtectedByPassword::loadFromAsciiSafeString($protected_key_encoded);
- $user_key = $protected_key->unlockKey($password);
- try {
- $saveData = Crypto::decrypt($saveData, $user_key);
- file_put_contents("../data/accounts/$accountID",$saveData);
- file_put_contents("../data/accounts/keys/$accountID","");
- } catch (Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException $ex) {
- exit("-3");
- }
- }
- }
- echo $saveData.";21;30;a;a";
-}else{
- echo -2;
+ $query = $db->prepare("SELECT accountID FROM accounts WHERE userName = :userName");
+ $query->execute([':userName' => $userName]);
+ $accountID = $query->fetchColumn();
+ if (!is_numeric($accountID) || !file_exists("../data/accounts/$accountID")) {
+ exit("-1");
+ } else {
+ $saveData = file_get_contents("../data/accounts/$accountID");
+ if (file_exists("../data/accounts/keys/$accountID") && substr($saveData, 0, 3) != "H4s") {
+ $protected_key_encoded = file_get_contents("../data/accounts/keys/$accountID");
+ $protected_key = KeyProtectedByPassword::loadFromAsciiSafeString($protected_key_encoded);
+ $user_key = $protected_key->unlockKey($password);
+ try {
+ $saveData = Crypto::decrypt($saveData, $user_key);
+ file_put_contents("../data/accounts/$accountID", $saveData);
+ file_put_contents("../data/accounts/keys/$accountID", "");
+ } catch (Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException $ex) {
+ exit("-3");
+ }
+ }
+ }
+ echo $saveData.";21;30;a;a";
+} else {
+ echo -2;
}
-?>
\ No newline at end of file
diff --git a/blockGJUser20.php b/blockGJUser20.php
index 503ca626e..ec9f49c89 100644
--- a/blockGJUser20.php
+++ b/blockGJUser20.php
@@ -1,3 +1,3 @@
\ No newline at end of file
diff --git a/config/connection.php b/config/connection.php
index 54ddd0784..54c84240c 100644
--- a/config/connection.php
+++ b/config/connection.php
@@ -1,7 +1,7 @@
\ No newline at end of file
diff --git a/config/dailyChests.php b/config/dailyChests.php
index d696a50fd..8da8993d8 100644
--- a/config/dailyChests.php
+++ b/config/dailyChests.php
@@ -1,10 +1,10 @@
diff --git a/config/discord.php b/config/discord.php
index ba141f7cc..868824e4a 100644
--- a/config/discord.php
+++ b/config/discord.php
@@ -1,5 +1,5 @@
\ No newline at end of file
diff --git a/config/reuploadAcc.php b/config/reuploadAcc.php
index 9c81db1d4..09eba430d 100644
--- a/config/reuploadAcc.php
+++ b/config/reuploadAcc.php
@@ -1,12 +1,12 @@
diff --git a/config/security.php b/config/security.php
index c366af826..9fc520fca 100644
--- a/config/security.php
+++ b/config/security.php
@@ -1,12 +1,13 @@
diff --git a/dashboard/account/unlisted.php b/dashboard/account/unlisted.php
index f04e75d2d..d52897c8e 100644
--- a/dashboard/account/unlisted.php
+++ b/dashboard/account/unlisted.php
@@ -1,4 +1,5 @@
0){
- $page = ($_GET["page"] - 1) * 10;
- $actualpage = $_GET["page"];
-}else{
- $page = 0;
- $actualpage = 1;
+if (isset($_GET["page"]) and is_numeric($_GET["page"]) and $_GET["page"] > 0) {
+ $page = ($_GET["page"] - 1) * 10;
+ $actualpage = $_GET["page"];
+} else {
+ $page = 0;
+ $actualpage = 1;
}
$table = '
".$level["levelID"]." | ".$level["levelName"]." | ".$level["starStars"]." | @@ -41,7 +42,7 @@ } $table .= "