├── README.md ├── acceptGJFriendRequest20.php ├── accounts ├── accountManagement.php ├── backupGJAccount.php ├── loginGJAccount.php ├── lostpassword.php ├── lostusername.php ├── mail │ ├── PHPMailerAutoload.php │ ├── class.phpmailer.php │ ├── class.phpmaileroauth.php │ ├── class.phpmaileroauthgoogle.php │ ├── class.pop3.php │ ├── class.smtp.php │ ├── get_oauth_token.php │ └── travis.phpunit.xml.dist ├── registerGJAccount.php ├── syncGJAccount.php └── syncGJAccount20.php ├── api ├── getDailyLevel.php ├── getLevelInfo.php ├── getUserInfo.php └── getWeeklyLevel.php ├── blockGJUser20.php ├── config ├── connection.php ├── mail.php └── name.php ├── data ├── accounts │ └── keys.txt └── levels │ └── deleted │ └── filter.txt ├── database.sql ├── database └── accounts │ ├── backupGJAccountNew.php │ └── syncGJAccountNew.php ├── deleteGJAccComment20.php ├── deleteGJComment20.php ├── deleteGJFriendRequests20.php ├── deleteGJLevelUser20.php ├── deleteGJMessages20.php ├── downloadGJLevel.php ├── downloadGJLevel19.php ├── downloadGJLevel20.php ├── downloadGJLevel21.php ├── downloadGJLevel22.php ├── downloadGJMessage20.php ├── getAccountURL.php ├── getGJAccountComments20.php ├── getGJChallenges.php ├── getGJCommentHistory.php ├── getGJComments.php ├── getGJComments19.php ├── getGJComments20.php ├── getGJComments21.php ├── getGJCreators.php ├── getGJCreators19.php ├── getGJDailyLevel.php ├── getGJFriendRequests20.php ├── getGJGauntlets.php ├── getGJGauntlets21.php ├── getGJLevelScores.php ├── getGJLevelScores211.php ├── getGJLevels.php ├── getGJLevels19.php ├── getGJLevels20.php ├── getGJLevels21.php ├── getGJMapPacks.php ├── getGJMapPacks20.php ├── getGJMapPacks21.php ├── getGJMessages20.php ├── getGJRewards.php ├── getGJScores.php ├── getGJScores19.php ├── getGJScores20.php ├── getGJSongInfo.php ├── getGJTopArtists.php ├── getGJUserInfo20.php ├── getGJUserList20.php ├── getGJUsers20.php ├── include ├── comments │ ├── deleteGJAccComment.php │ ├── deleteGJComment.php │ ├── getGJAccountComments.php │ ├── getGJComments.php │ ├── uploadGJAccComment.php │ └── uploadGJComment.php ├── components │ ├── css │ │ └── styles.css │ ├── images │ │ └── tools_favicon.png │ └── jscolor │ │ ├── jscolor.js │ │ └── jscolor.min.js ├── levelpacks │ ├── getGJGauntlets.php │ └── getGJMapPacks.php ├── levels │ ├── cp.php │ ├── deleteGJLevelUser.php │ ├── downloadGJLevel.php │ ├── getGJDailyLevel.php │ ├── getGJLevels.php │ ├── rateGJDemon.php │ ├── rateGJStars.php │ ├── reportGJLevel.php │ ├── suggestGJStars.php │ ├── updateGJDesc.php │ └── uploadGJLevel.php ├── lib │ ├── GJPCheck.php │ ├── XORCipher.php │ ├── connection.php │ ├── defuse-crypto.phar │ ├── exploitPatch.php │ ├── generateHash.php │ ├── generatePass.php │ ├── ip_in_range.php │ ├── mail.php │ ├── mainLib.php │ └── songReup.php ├── messages │ ├── deleteGJMessages.php │ ├── downloadGJMessage.php │ ├── getGJMessages.php │ └── uploadGJMessage.php ├── misc │ ├── commands.php │ ├── cp.php │ ├── getAccountURL.php │ ├── getGJSongInfo.php │ ├── getTopArtists.php │ └── likeGJItem.php ├── mods │ └── requestUserAccess.php ├── profiles │ ├── getGJUserInfo.php │ ├── getGJUsers.php │ └── updateGJAccSettings.php ├── relationships │ ├── acceptGJFriendRequest.php │ ├── blockGJUser.php │ ├── deleteGJFriendRequests.php │ ├── getGJFriendRequests.php │ ├── getGJUserList.php │ ├── readGJFriendRequest.php │ ├── removeGJFriend.php │ ├── unblockGJUser.php │ └── uploadFriendRequest.php ├── rewards │ ├── getGJChallenges.php │ └── getGJRewards.php └── scores │ ├── autoban.php │ ├── getGDPSUserBan.php │ ├── getGJCreators.php │ ├── getGJLevelScores.php │ ├── getGJScores.php │ ├── updateGDPSUserBan.php │ └── updateGJUserScore.php ├── likeGJItem.php ├── likeGJItem19.php ├── likeGJItem20.php ├── likeGJItem21.php ├── likeGJItem211.php ├── rateGJDemon21.php ├── rateGJStars20.php ├── rateGJStars211.php ├── readGJFriendRequest20.php ├── removeGJFriend20.php ├── reportGJLevel.php ├── requestUserAccess.php ├── settings ├── dailyChests.php ├── name.php ├── reuploadAcc.php ├── security.php ├── songAdd.php └── topArtists.php ├── suggestGJStars20.php ├── tools ├── account │ ├── activate.php │ ├── changePassword.php │ ├── changePasswordNoSave.php │ ├── changeUsername.php │ └── reset.php ├── cron │ ├── autoban.php │ ├── cron.php │ ├── fixcps.php │ ├── fixlevels.php │ ├── fixnames.php │ ├── friendsLeaderboard.php │ ├── index.php │ ├── removeBlankLevels.php │ └── songsCount.php ├── index.php ├── levelReupload.php ├── levelToGD.php ├── linkAccount.php ├── logs │ ├── cplog.txt │ ├── cronlastrun.txt │ ├── fixcpslog.txt │ ├── fixfrndlog.txt │ ├── fixnameslog.txt │ ├── frndlog.txt │ └── snglog.txt ├── mod │ ├── addQuests.php │ ├── index.php │ ├── leaderboardsBan.php │ ├── leaderboardsUnban.php │ ├── packCreate.php │ ├── panel.php │ ├── revertLikes.php │ ├── suggestionList.php │ └── ui.css ├── saveDecode.php ├── songAdd.php ├── songs │ ├── index.php │ └── song │ │ └── filler.txt └── stats │ ├── dailyTable.php │ ├── index.php │ ├── modActions.php │ ├── modsList.php │ ├── noLogIn.php │ ├── packTable.php │ ├── reportList.php │ ├── songList.php │ ├── stats.php │ ├── suggestList.php │ ├── top24h.php │ ├── unlisted.php │ └── vipList.php ├── unblockGJUser20.php ├── updateGJAccSettings20.php ├── updateGJDesc20.php ├── updateGJUserScore.php ├── updateGJUserScore19.php ├── updateGJUserScore20.php ├── updateGJUserScore21.php ├── updateGJUserScore22.php ├── uploadFriendRequest20.php ├── uploadGJAccComment20.php ├── uploadGJComment.php ├── uploadGJComment19.php ├── uploadGJComment20.php ├── uploadGJComment21.php ├── uploadGJLevel.php ├── uploadGJLevel19.php ├── uploadGJLevel20.php ├── uploadGJLevel21.php └── uploadGJMessage20.php /README.md: -------------------------------------------------------------------------------- 1 |
2 |

3 | 4 |

5 |

IoCore GDPS

6 | 7 | [Author](https://woidzero.xyz/) | 8 | [Discord](https://discord.gg/RSsCkch3CM) 9 | 10 |
11 | 12 | > Based on CvoltonGDPS & BetterGDPS
13 | > Supported Geometry Dash versions: 1.9 - 2.11
14 | > Required PHP version: 5.4+
15 | 16 | ### Whats new? 17 | 1) Renamed folders. 18 | 2) Song upload better. 19 | 3) Optimization. 20 | 4) API (utils/api) 21 | 5) Better tools page 22 | 23 | ### Setup 24 | 1) Upload the files on a webserver 25 | 2) Import database.sql into a MySQL/MariaDB database 26 | 3) Edit the links in GeometryDash.exe (base64 encoded since 2.1+) 27 | 4) Write GDPS name into `/settings/name.php` 28 | 5) Edit `/config/connection.php` and `/config/mail.php` 29 | 30 | ### Support: 31 | https://discord.gg/hH6GA4kmu8 32 | 33 | ### Credits 34 | Originals: https://github.com/Cvolton/GMDprivateServer & https://github.com/foxodever/BetterCvoltonGDPS 35 | 36 | XOR encryption - https://github.com/sathoro/php-xor-cipher - (include/lib/XORCipher.php)
37 | Cloud save encryption - https://github.com/defuse/php-encryption - (include/lib/defuse-crypto.phar)
38 | Jscolor - http://jscolor.com/
39 | 40 | And pavlukivan, Italian APK Downloader. 41 | 42 | 43 | Created by WoidZero 44 | -------------------------------------------------------------------------------- /acceptGJFriendRequest20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /accounts/accountManagement.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /accounts/backupGJAccount.php: -------------------------------------------------------------------------------- 1 | remove($_POST["userName"]); 21 | $password = $_POST["password"]; 22 | $saveData = $ep->remove($_POST["saveData"]); 23 | $generatePass = new generatePass(); 24 | $pass = $generatePass->isValidUsrname($userName, $password); 25 | if ($pass == 1) { 26 | $saveDataArr = explode(";",$saveData); //splitting ccgamemanager and cclocallevels 27 | $saveData = str_replace("-","+",$saveDataArr[0]); //decoding 28 | $saveData = str_replace("_","/",$saveData); 29 | $saveData = base64_decode($saveData); 30 | $saveData = gzdecode($saveData); 31 | $orbs = explode("14",$saveData)[1]; 32 | $orbs = explode("",$orbs)[0]; 33 | $lvls = explode("GS_value",$saveData)[1]; 34 | $lvls = explode("4",$lvls)[1]; 35 | $lvls = explode("",$lvls)[0]; 36 | $protected_key_encoded = ""; 37 | if($cloudSaveEncryption == 0){ 38 | $saveData = str_replace("GJA_002".$password."", "GJA_002not the actual password", $saveData); //replacing pass 39 | //file_put_contents($userName, $saveData); 40 | $saveData = gzencode($saveData); //encoding back 41 | $saveData = base64_encode($saveData); 42 | $saveData = str_replace("+","-",$saveData); 43 | $saveData = str_replace("/","_",$saveData); 44 | $saveData = $saveData . ";" . $saveDataArr[1]; //merging ccgamemanager and cclocallevels 45 | }else if($cloudSaveEncryption == 1){ 46 | $saveData = $ep->remove($_POST["saveData"]); 47 | $protected_key = KeyProtectedByPassword::createRandomPasswordProtectedKey($password); 48 | $protected_key_encoded = $protected_key->saveToAsciiSafeString(); 49 | $user_key = $protected_key->unlockKey($password); 50 | $saveData = Crypto::encrypt($saveData, $user_key); 51 | } 52 | //$query = $db->prepare("UPDATE `accounts` SET `saveData` = :saveData WHERE userName = :userName"); 53 | //$query->execute([':saveData' => $saveData, ':userName' => $userName]); 54 | $query = $db->prepare("SELECT accountID FROM accounts WHERE userName = :userName"); 55 | $query->execute([':userName' => $userName]); 56 | $accountID = $query->fetchColumn(); 57 | if(!is_numeric($accountID)){ 58 | exit("-1"); 59 | } 60 | file_put_contents("../data/accounts/$accountID",$saveData); 61 | file_put_contents("../data/accounts/keys/$accountID",$protected_key_encoded); 62 | $query = $db->prepare("SELECT extID FROM users WHERE userName = :userName LIMIT 1"); 63 | $query->execute([':userName' => $userName]); 64 | $result = $query->fetchAll(); 65 | $result = $result[0]; 66 | $extID = $result["extID"]; 67 | $query = $db->prepare("UPDATE `users` SET `orbs` = :orbs, `completedLvls` = :lvls WHERE extID = :extID"); 68 | $query->execute([':orbs' => $orbs, ':extID' => $extID, ':lvls' => $lvls]); 69 | echo 1; 70 | } else { 71 | echo -1; 72 | } 73 | ?> -------------------------------------------------------------------------------- /accounts/loginGJAccount.php: -------------------------------------------------------------------------------- 1 | getIP(); 11 | $udid = $ep->remove($_POST["udid"]); 12 | $userName = $ep->remove($_POST["userName"]); 13 | $password = $ep->remove($_POST["password"]); 14 | //registering 15 | $query = $db->prepare("SELECT accountID FROM accounts WHERE userName LIKE :userName"); 16 | $query->execute([':userName' => $userName]); 17 | if($query->rowCount() == 0){ 18 | exit("-1"); 19 | } 20 | $id = $query->fetchColumn(); 21 | //rate limiting 22 | $newtime = time() - 3600; 23 | /*$query6 = $db->prepare("SELECT count(*) FROM actions WHERE type = '1' AND timestamp > :time AND value2 = :ip"); 24 | $query6->execute([':time' => $newtime, ':ip' => $ip]); 25 | if($query6->fetchColumn() > 5){ 26 | exit("-12"); 27 | }*/ 28 | //authenticating 29 | $pass = $generatePass->isValidUsrname($userName, $password); 30 | if ($pass == 1) { //success 31 | //userID 32 | $query2 = $db->prepare("SELECT userID FROM users WHERE extID = :id"); 33 | 34 | $query2->execute([':id' => $id]); 35 | if ($query2->rowCount() > 0) { 36 | $userID = $query2->fetchColumn(); 37 | } else { 38 | $query = $db->prepare("INSERT INTO users (isRegistered, extID, userName) 39 | VALUES (1, :id, :userName)"); 40 | 41 | $query->execute([':id' => $id, ':userName' => $userName]); 42 | $userID = $db->lastInsertId(); 43 | } 44 | //logging 45 | $query6 = $db->prepare("INSERT INTO actions (type, value, timestamp, value2) VALUES 46 | ('2',:username,:time,:ip)"); 47 | $query6->execute([':username' => $userName, ':time' => time(), ':ip' => $ip]); 48 | //result 49 | echo $id.",".$userID; 50 | if(!is_numeric($udid)){ 51 | $query2 = $db->prepare("SELECT userID FROM users WHERE extID = :udid"); 52 | $query2->execute([':udid' => $udid]); 53 | $usrid2 = $query2->fetchColumn(); 54 | $query2 = $db->prepare("UPDATE levels SET userID = :userID, extID = :extID WHERE userID = :usrid2"); 55 | $query2->execute([':userID' => $userID, ':extID' => $id, ':usrid2' => $usrid2]); 56 | } 57 | }elseif ($pass == -1){ //failure 58 | echo -12; 59 | }else{ 60 | echo -1; 61 | } 62 | ?> -------------------------------------------------------------------------------- /accounts/lostpassword.php: -------------------------------------------------------------------------------- 1 | Enter your account email
Email:
2 | prepare("SELECT * FROM accounts WHERE email = :email"); 8 | $query->execute([':email' => $email]); 9 | if ($query->rowCount() > 0) { 10 | $query = $db->prepare("SELECT accountID FROM accounts WHERE email = :email"); 11 | $query->execute([':email' => $email]); 12 | $accountID = $query->fetchColumn(); 13 | function generate($how_long) { 14 | $length = $how_long; 15 | $chars = 'abdefhiknrstyzABDEFGHKNQRSTYZ23456789'; 16 | $numChars = strlen($chars); 17 | $string = ''; 18 | for ($i = 0; $i < $length; $i++) { 19 | $string .= substr($chars, rand(1, $numChars) - 1, 1); 20 | } 21 | return $string; 22 | } 23 | $pass1 = generate(8); 24 | $token = generate(8); 25 | $pass = password_hash($pass1, PASSWORD_DEFAULT); 26 | $query = $db->prepare("INSERT INTO reset (acc, password, token) 27 | VALUES (:acc, :password, :token)"); 28 | $query->execute([':acc' => $accountID, ':password' => $pass, ':token' => $token]); 29 | require("mail/PHPMailerAutoload.php"); 30 | $mail = new PHPMailer; 31 | $mail->CharSet = 'utf-8'; 32 | 33 | $mail->isSMTP(); 34 | $mail->Host = $smtp; 35 | $mail->SMTPAuth = true; 36 | $mail->Username = $mail_server; 37 | $mail->Password = $mail_server_password; 38 | $mail->SMTPSecure = $mail_type; 39 | $mail->Port = $smtp_port; 40 | 41 | $mail->setFrom($mail_server); 42 | $mail->addAddress("$email"); 43 | $mail->isHTML(true); 44 | $mail->Subject = 'GDPS password reseting'; 45 | $mail->Body = "

Hello $userName

Update your GDPS account password to $pass1 by going to link down:

46 |

Update your account password

47 |

Can not open link? $url_reset?token=$token

"; 48 | $mail->AltBody = ''; 49 | if($mail->send()) { 50 | echo "1"; 51 | } else { 52 | echo "-1"; 53 | } 54 | } else { 55 | echo "Email not found"; 56 | } 57 | } else { 58 | if(empty($_POST["email"])) { 59 | 60 | } else { 61 | echo "Email invalid"; 62 | } 63 | } 64 | 65 | ?> 66 | -------------------------------------------------------------------------------- /accounts/lostusername.php: -------------------------------------------------------------------------------- 1 | Enter your account email
Email:
2 | prepare("SELECT * FROM accounts WHERE email = :email"); 8 | $query->execute([':email' => $email]); 9 | if ($query->rowCount() > 0) { 10 | $query = $db->prepare("SELECT userName FROM accounts WHERE email = :email"); 11 | $query->execute([':email' => $email]); 12 | $userName = $query->fetchColumn(); 13 | require("mail/PHPMailerAutoload.php"); 14 | $mail = new PHPMailer; 15 | $mail->CharSet = 'utf-8'; 16 | 17 | $mail->isSMTP(); 18 | $mail->Host = $smtp; 19 | $mail->SMTPAuth = true; 20 | $mail->Username = $mail_server; 21 | $mail->Password = $mail_server_password; 22 | $mail->SMTPSecure = $mail_type; 23 | $mail->Port = $smtp_port; 24 | 25 | $mail->setFrom($mail_server); 26 | $mail->addAddress("$email"); 27 | $mail->isHTML(true); 28 | $mail->Subject = 'Your username'; 29 | $mail->Body = "

Hello

Your username is: $userName

"; 30 | $mail->AltBody = ''; 31 | if($mail->send()) { 32 | echo "Email sent"; 33 | } else { 34 | echo "-1"; 35 | } 36 | } else { 37 | echo "Email not found"; 38 | } 39 | } else { 40 | if(empty($_POST["email"])) { 41 | 42 | } else { 43 | echo "Email invalid"; 44 | } 45 | } 46 | 47 | ?> 48 | -------------------------------------------------------------------------------- /accounts/mail/PHPMailerAutoload.php: -------------------------------------------------------------------------------- 1 | 8 | * @author Jim Jagielski (jimjag) 9 | * @author Andy Prevost (codeworxtech) 10 | * @author Brent R. Matzelle (original founder) 11 | * @copyright 2012 - 2014 Marcus Bointon 12 | * @copyright 2010 - 2012 Jim Jagielski 13 | * @copyright 2004 - 2009 Andy Prevost 14 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 15 | * @note This program is distributed in the hope that it will be useful - WITHOUT 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | * FITNESS FOR A PARTICULAR PURPOSE. 18 | */ 19 | 20 | /** 21 | * PHPMailer SPL autoloader. 22 | * @param string $classname The name of the class to load 23 | */ 24 | function PHPMailerAutoload($classname) 25 | { 26 | //Can't use __DIR__ as it's only in PHP 5.3+ 27 | $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php'; 28 | if (is_readable($filename)) { 29 | require $filename; 30 | } 31 | } 32 | 33 | if (version_compare(PHP_VERSION, '5.1.2', '>=')) { 34 | //SPL autoloading was introduced in PHP 5.1.2 35 | if (version_compare(PHP_VERSION, '5.3.0', '>=')) { 36 | spl_autoload_register('PHPMailerAutoload', true, true); 37 | } else { 38 | spl_autoload_register('PHPMailerAutoload'); 39 | } 40 | } else { 41 | /** 42 | * Fall back to traditional autoload for old PHP versions 43 | * @param string $classname The name of the class to load 44 | */ 45 | function spl_autoload_register($classname) 46 | { 47 | PHPMailerAutoload($classname); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /accounts/mail/class.phpmaileroauthgoogle.php: -------------------------------------------------------------------------------- 1 | 8 | * @author Jim Jagielski (jimjag) 9 | * @author Andy Prevost (codeworxtech) 10 | * @author Brent R. Matzelle (original founder) 11 | * @copyright 2012 - 2014 Marcus Bointon 12 | * @copyright 2010 - 2012 Jim Jagielski 13 | * @copyright 2004 - 2009 Andy Prevost 14 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 15 | * @note This program is distributed in the hope that it will be useful - WITHOUT 16 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 17 | * FITNESS FOR A PARTICULAR PURPOSE. 18 | */ 19 | 20 | /** 21 | * PHPMailerOAuthGoogle - Wrapper for League OAuth2 Google provider. 22 | * @package PHPMailer 23 | * @author @sherryl4george 24 | * @author Marcus Bointon (@Synchro) 25 | * @link https://github.com/thephpleague/oauth2-client 26 | */ 27 | class PHPMailerOAuthGoogle 28 | { 29 | private $oauthUserEmail = ''; 30 | private $oauthRefreshToken = ''; 31 | private $oauthClientId = ''; 32 | private $oauthClientSecret = ''; 33 | 34 | /** 35 | * @param string $UserEmail 36 | * @param string $ClientSecret 37 | * @param string $ClientId 38 | * @param string $RefreshToken 39 | */ 40 | public function __construct( 41 | $UserEmail, 42 | $ClientSecret, 43 | $ClientId, 44 | $RefreshToken 45 | ) { 46 | $this->oauthClientId = $ClientId; 47 | $this->oauthClientSecret = $ClientSecret; 48 | $this->oauthRefreshToken = $RefreshToken; 49 | $this->oauthUserEmail = $UserEmail; 50 | } 51 | 52 | private function getProvider() 53 | { 54 | return new League\OAuth2\Client\Provider\Google([ 55 | 'clientId' => $this->oauthClientId, 56 | 'clientSecret' => $this->oauthClientSecret 57 | ]); 58 | } 59 | 60 | private function getGrant() 61 | { 62 | return new \League\OAuth2\Client\Grant\RefreshToken(); 63 | } 64 | 65 | private function getToken() 66 | { 67 | $provider = $this->getProvider(); 68 | $grant = $this->getGrant(); 69 | return $provider->getAccessToken($grant, ['refresh_token' => $this->oauthRefreshToken]); 70 | } 71 | 72 | public function getOauth64() 73 | { 74 | $token = $this->getToken(); 75 | return base64_encode("user=" . $this->oauthUserEmail . "\001auth=Bearer " . $token . "\001\001"); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /accounts/mail/travis.phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 16 | ./test/ 17 | 18 | 19 | 20 | 21 | ./extras 22 | 23 | 24 | 25 | 26 | languages 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /accounts/registerGJAccount.php: -------------------------------------------------------------------------------- 1 | remove($_POST["userName"]); 10 | $password = $ep->remove($_POST["password"]); 11 | $email = $ep->remove($_POST["email"]); 12 | $domain = explode('@', $email)[1]; 13 | $secret = ""; 14 | 15 | $query2 = $db->prepare("SELECT count(*) FROM accounts WHERE userName LIKE :userName"); 16 | $query2->execute([':userName' => $userName]); 17 | $regusrs = $query2->fetchColumn(); 18 | if ($regusrs > 0) { 19 | echo "-2"; 20 | }else{ 21 | $query2 = $db->prepare("SELECT count(*) FROM register WHERE userName LIKE :userName"); 22 | $query2->execute([':userName' => $userName]); 23 | $regusrs = $query2->fetchColumn(); 24 | if ($regusrs > 0) { 25 | echo "-2"; 26 | }else{ 27 | //checking if email is taken 28 | $query2 = $db->prepare("SELECT count(*) FROM accounts WHERE email LIKE :email"); 29 | $query2->execute([':email' => $email]); 30 | $regusrs = $query2->fetchColumn(); 31 | if ($regusrs > 0) { 32 | exit("-3"); 33 | }else{ 34 | $query2 = $db->prepare("SELECT count(*) FROM register WHERE email LIKE :email"); 35 | $query2->execute([':email' => $email]); 36 | $regusrs = $query2->fetchColumn(); 37 | if ($regusrs > 0) { 38 | exit("-3"); 39 | }else{ 40 | function generate($how_long) { 41 | $length = $how_long; 42 | $chars = 'abdefhiknrstyzABDEFGHKNQRSTYZ23456789'; 43 | $numChars = strlen($chars); 44 | $string = ''; 45 | for ($i = 0; $i < $length; $i++) { 46 | $string .= substr($chars, rand(1, $numChars) - 1, 1); 47 | } 48 | return $string; 49 | } 50 | $hashpass = password_hash($password, PASSWORD_DEFAULT); 51 | $token = generate(10); 52 | $query = $db->prepare("INSERT INTO register (userName, password, email, secret, saveData, registerDate, saveKey, token) 53 | VALUES (:userName, :password, :email, :secret, '', :time, '', :token)"); 54 | $query->execute([':userName' => $userName, ':password' => $hashpass, ':email' => $email, ':secret' => $secret, ':token' => $token, ':time' => time()]); 55 | require("mail/PHPMailerAutoload.php"); 56 | $mail = new PHPMailer; 57 | $mail->CharSet = 'utf-8'; 58 | 59 | $mail->isSMTP(); 60 | $mail->Host = $smtp; 61 | $mail->SMTPAuth = true; 62 | $mail->Username = $mail_server; 63 | $mail->Password = $mail_server_password; 64 | $mail->SMTPSecure = $mail_type; 65 | $mail->Port = $smtp_port; 66 | 67 | $mail->setFrom($mail_server); 68 | $mail->addAddress("$email"); 69 | $mail->isHTML(true); 70 | $mail->Subject = $gdpsname.' Account activation'; 71 | $mail->Body = "

$gdpsname Account Activation | $userName

activate your $gdpsname account by going to link down:

72 |

Activate your account

73 |

Can not open link? $url_register?token=$token

"; 74 | $mail->AltBody = ''; 75 | if($mail->send()) { 76 | echo "1"; 77 | } else { 78 | echo "-1"; 79 | } 80 | } 81 | } 82 | } 83 | } 84 | } 85 | ?> 86 | -------------------------------------------------------------------------------- /accounts/syncGJAccount.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /accounts/syncGJAccount20.php: -------------------------------------------------------------------------------- 1 | remove($_POST["userName"]); 15 | $password = $_POST["password"]; 16 | $secret = ""; 17 | $generatePass = new generatePass(); 18 | $pass = $generatePass->isValidUsrname($userName, $password); 19 | if ($pass == 1) { 20 | $query = $db->prepare("select accountID, saveData from accounts where userName = :userName"); 21 | $query->execute([':userName' => $userName]); 22 | $account = $query->fetch(); 23 | $accountID = $account["accountID"]; 24 | if(!is_numeric($accountID)){ 25 | exit("-1"); 26 | } 27 | if(!file_exists("../data/accounts/$accountID")){ 28 | $saveData = $account["saveData"]; 29 | if(substr($saveData,0,4) == "SDRz"){ 30 | $saveData = base64_decode($saveData); 31 | } 32 | }else{ 33 | $saveData = file_get_contents("../data/accounts/$accountID"); 34 | if(file_exists("../data/accounts/keys/$accountID")){ 35 | if(substr($saveData,0,3) != "H4s"){ 36 | $protected_key_encoded = file_get_contents("../data/accounts/keys/$accountID"); 37 | $protected_key = KeyProtectedByPassword::loadFromAsciiSafeString($protected_key_encoded); 38 | $user_key = $protected_key->unlockKey($password); 39 | try { 40 | $saveData = Crypto::decrypt($saveData, $user_key); 41 | } catch (Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException $ex) { 42 | exit("-2"); 43 | } 44 | } 45 | } 46 | } 47 | echo $saveData.";21;30;a;a"; 48 | }else{ 49 | echo -1; 50 | } 51 | ?> -------------------------------------------------------------------------------- /api/getDailyLevel.php: -------------------------------------------------------------------------------- 1 | prepare( 5 | "SELECT * FROM levels 6 | WHERE levelID IN 7 | (SELECT levelID FROM dailyfeatures GROUP BY levelID) 8 | ORDER BY levelID" 9 | ); 10 | 11 | $getdailydata = $db->prepare("SELECT * FROM dailyfeatures"); 12 | 13 | $getleveldata->execute(["levels"=>$levels]); 14 | $getdailydata->execute(["dailyfeatures"=>$dailyfeatures]); 15 | 16 | $row = $getleveldata->fetchAll(PDO::FETCH_ASSOC)[0]; 17 | $rowx = $getdailydata->fetchAll(PDO::FETCH_ASSOC)[0]; 18 | 19 | $feaid = $rowx["feaID"]; 20 | $author = $row["userName"]; 21 | $levelid = $row["levelID"]; 22 | $name = $row["levelName"]; 23 | $desc = $row["levelDesc"]; 24 | $version = $row["levelVersion"]; 25 | $song = $row["songID"]; 26 | $objects = $row["objects"]; 27 | $coins = $row["coins"]; 28 | $downloads = $row["downloads"]; 29 | $likes = $row["likes"]; 30 | $ratedate = $row["rateDate"]; 31 | $difficulty = $row["starDifficulty"]; 32 | $demon = $row["starDemon"]; 33 | $date = $row["uploadDate"]; 34 | $length = $row["levelLength"]; 35 | $type = $rowx["type"]; 36 | $desc_encoded = base64_decode($desc); 37 | 38 | $data = array( 39 | "feaid"=>$feaid, 40 | "author"=>$author, 41 | "levelid"=>$levelid, 42 | "name"=>$name, 43 | "desc"=>$desc, 44 | "version"=>$version, 45 | "song"=>$song, 46 | "objects"=>$objects, 47 | "downloads"=>$downloads, 48 | "likes"=>$likes, 49 | "ratedate"=>$ratedate, 50 | "difficulty"=>$difficulty, 51 | "demon"=>$demon, 52 | "coins"=>$coins, 53 | "date"=>$date, 54 | "length"=>$length, 55 | "type"=>$type, 56 | "desc_encoded"=>$desc_encoded 57 | ); 58 | 59 | echo json_encode($data); 60 | ?> -------------------------------------------------------------------------------- /api/getLevelInfo.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT count(*) FROM levels WHERE levelID=:levelID"); 6 | $ifexists->execute(["levelID"=>$levelID]); 7 | if($ifexists->fetchColumn()==0){exit("-4");} 8 | 9 | $getleveldata = $db->prepare("SELECT * FROM levels WHERE levelID=:levelID"); 10 | $getleveldata->execute(["levelID"=>$levelID]); 11 | 12 | $row = $getleveldata->fetchAll(PDO::FETCH_ASSOC)[0]; 13 | 14 | $author = $row["userName"]; 15 | $id = $row["levelID"]; 16 | $name = $row["levelName"]; 17 | $desc = $row["levelDesc"]; 18 | $version = $row["levelVersion"]; 19 | $song = $row["songID"]; 20 | $objects = $row["objects"]; 21 | $coins = $row["coins"]; 22 | $downloads = $row["downloads"]; 23 | $likes = $row["likes"]; 24 | $ratedate = $row["rateDate"]; 25 | $difficulty = $row["starDifficulty"]; 26 | $demon = $row["starDemon"]; 27 | $date = $row["uploadDate"]; 28 | $length = $row["levelLength"]; 29 | $desc_encoded = base64_decode($desc); 30 | $unlisted = $row["unlisted"]; 31 | 32 | $data = array( 33 | "author"=>$author, 34 | "id"=>$id, 35 | "name"=>$name, 36 | "desc"=>$desc, 37 | "version"=>$version, 38 | "song"=>$song, 39 | "objects"=>$objects, 40 | "downloads"=>$downloads, 41 | "likes"=>$likes, 42 | "ratedate"=>$ratedate, 43 | "difficulty"=>$difficulty, 44 | "demon"=>$demon, 45 | "coins"=>$coins, 46 | "date"=>$date, 47 | "length"=>$length, 48 | "desc_encoded"=>$desc_encoded, 49 | "unlisted"=>$unlisted); 50 | 51 | echo json_encode($data); 52 | ?> -------------------------------------------------------------------------------- /api/getUserInfo.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT count(*) FROM users WHERE userName=:userName"); 6 | $ifexists->execute(["userName"=>$userName]); 7 | if($ifexists->fetchColumn()==0){exit();} 8 | 9 | $getuserdata = $db->prepare("SELECT * FROM users WHERE userName=:userName"); 10 | $getuserdata->execute(["userName"=>$userName]); 11 | 12 | $getaccdata = $db->prepare("SELECT * FROM accounts WHERE userName=:userName"); 13 | $getaccdata->execute(["userName"=>$userName]); 14 | 15 | $rowx = $getaccdata->fetchAll(PDO::FETCH_ASSOC)[0]; 16 | $row = $getuserdata->fetchAll(PDO::FETCH_ASSOC)[0]; 17 | 18 | $stars = $row["stars"]; 19 | $diamonds = $row["diamonds"]; 20 | $demons = $row["demons"]; 21 | $cp = $row["creatorPoints"]; 22 | $icon = $row["accIcon"]; 23 | $color1 = $row["color1"]; 24 | $color2 = $row["color2"]; 25 | $accountID = $row["extID"]; 26 | $userID = $row["userID"]; 27 | $time = $row["lastPlayed"]; 28 | $ucoins = $row["userCoins"]; 29 | $coins = $row["coins"]; 30 | 31 | $ms = $rowx["mS"]; 32 | $frs = $rowx["frS"]; 33 | $cs = $rowx["cS"]; 34 | 35 | $regdate = $rowx["registerDate"]; 36 | $yt = $rowx["youtubeurl"]; 37 | $tw = $rowx["twitter"]; 38 | $th = $rowx["twitch"]; 39 | 40 | $generatedicon = "https://gdbrowser.com/icon/icon?icon=".$icon."&form=cube&col1=".$color1."&col2=".$color2; 41 | 42 | $ifmod = $db->prepare("SELECT count(*) FROM roleassign WHERE accountID=".$accountID); 43 | $ifmod->execute([]); 44 | 45 | if($ifmod->fetchColumn()!=0) { 46 | $checkifmod = $db->prepare("SELECT roleID FROM roleassign WHERE accountID=".$accountID); 47 | $checkifmod->execute([]); 48 | $roleID = $checkifmod->fetchColumn(); 49 | $whatkindamod = $db->prepare("SELECT roleName FROM roles WHERE roleID=:roleID"); 50 | $whatkindamod->execute(["roleID"=>$roleID]); 51 | $roleName = $whatkindamod->fetchColumn(); 52 | 53 | $true = "True"; 54 | $mod = array( 55 | "isMod"=>$true, 56 | "roleName"=>$roleName); 57 | } else { 58 | $mod = array("isMod"=>"False", "roleName"=>"None"); 59 | } 60 | 61 | $data = array( 62 | "user_name"=>$userName, 63 | "stars"=>$stars, 64 | "diamonds"=>$diamonds, 65 | "demons"=>$demons, 66 | "creatorPoints"=>$cp, 67 | "icon"=>$icon, 68 | "color1"=>$color1, 69 | "color2"=>$color2, 70 | "accountID"=>$accountID, 71 | "time"=>$time, 72 | "userID"=>$userID, 73 | "iconSprite"=>$generatedicon, 74 | "ucoins"=>$ucoins, 75 | "coins"=>$coins, 76 | "regdate"=>$regdate, 77 | "yt"=>$yt, 78 | "tw"=>$tw, 79 | "th"=>$th, 80 | "ms"=>$ms, 81 | "frs"=>$frs, 82 | "cs"=>$cs, 83 | "isMod"=>$mod["isMod"], 84 | "role"=>$mod["roleName"] 85 | ); 86 | 87 | echo json_encode($data); 88 | ?> -------------------------------------------------------------------------------- /api/getWeeklyLevel.php: -------------------------------------------------------------------------------- 1 | prepare( 5 | "SELECT * FROM levels 6 | WHERE levelID IN 7 | (SELECT levelID FROM dailyfeatures WHERE type IN (1) GROUP BY levelID) 8 | ORDER BY levelID" 9 | ); 10 | $getdailydata = $db->prepare("SELECT * FROM dailyfeatures WHERE type IN (1)"); 11 | 12 | $getleveldata->execute(["levels"=>$levels]); 13 | $getdailydata->execute(["dailyfeatures"=>$dailyfeatures]); 14 | 15 | $row = $getleveldata->fetchAll(PDO::FETCH_ASSOC)[0]; 16 | $rowx = $getdailydata->fetchAll(PDO::FETCH_ASSOC)[0]; 17 | 18 | $feaid = $rowx["feaID"]; 19 | $author = $row["userName"]; 20 | $levelid = $row["levelID"]; 21 | $name = $row["levelName"]; 22 | $desc = $row["levelDesc"]; 23 | $version = $row["levelVersion"]; 24 | $song = $row["songID"]; 25 | $objects = $row["objects"]; 26 | $coins = $row["coins"]; 27 | $downloads = $row["downloads"]; 28 | $likes = $row["likes"]; 29 | $ratedate = $row["rateDate"]; 30 | $difficulty = $row["starDifficulty"]; 31 | $demon = $row["starDemon"]; 32 | $date = $row["uploadDate"]; 33 | $length = $row["levelLength"]; 34 | $type = $rowx["type"]; 35 | $desc_encoded = base64_decode($desc); 36 | 37 | $data = array( 38 | "feaid"=>$feaid, 39 | "author"=>$author, 40 | "levelid"=>$levelid, 41 | "name"=>$name, 42 | "desc"=>$desc, 43 | "version"=>$version, 44 | "song"=>$song, 45 | "objects"=>$objects, 46 | "downloads"=>$downloads, 47 | "likes"=>$likes, 48 | "ratedate"=>$ratedate, 49 | "difficulty"=>$difficulty, 50 | "demon"=>$demon, 51 | "coins"=>$coins, 52 | "date"=>$date, 53 | "length"=>$length, 54 | "type"=>$type, 55 | "desc_encoded"=>$desc_encoded 56 | ); 57 | 58 | echo json_encode($data); 59 | ?> -------------------------------------------------------------------------------- /blockGJUser20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/connection.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /config/name.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /data/accounts/keys.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /data/levels/deleted/filter.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/accounts/backupGJAccountNew.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/accounts/syncGJAccountNew.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deleteGJAccComment20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deleteGJComment20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deleteGJFriendRequests20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deleteGJLevelUser20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deleteGJMessages20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /downloadGJLevel.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /downloadGJLevel19.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /downloadGJLevel20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /downloadGJLevel21.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /downloadGJLevel22.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /downloadGJMessage20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getAccountURL.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJAccountComments20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJChallenges.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJCommentHistory.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJComments.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJComments19.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJComments20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJComments21.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJCreators.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJCreators19.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJDailyLevel.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJFriendRequests20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJGauntlets.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJGauntlets21.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJLevelScores.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJLevelScores211.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJLevels.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJLevels19.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJLevels20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJLevels21.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJMapPacks.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJMapPacks20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJMapPacks21.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJMessages20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJRewards.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJScores.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJScores19.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJScores20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJSongInfo.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJTopArtists.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /getGJUserInfo20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJUserList20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /getGJUsers20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /include/comments/deleteGJAccComment.php: -------------------------------------------------------------------------------- 1 | remove($_POST["commentID"]); 8 | $accountID = $ep->remove($_POST["accountID"]); 9 | $gjp = $ep->remove($_POST["gjp"]); 10 | $GJPCheck = new GJPCheck(); 11 | $gjpresult = $GJPCheck->check($gjp,$accountID); 12 | if($gjpresult == 1){ 13 | $query2 = $db->prepare("SELECT userID FROM users WHERE extID = :accountID"); 14 | $query2->execute([':accountID' => $accountID]); 15 | if ($query2->rowCount() > 0) { 16 | $userID = $query2->fetchColumn(); 17 | } 18 | $query = $db->prepare("DELETE FROM acccomments WHERE commentID=:commentID AND userID=:userID LIMIT 1"); 19 | $query->execute([':userID' => $userID, ':commentID' => $commentID]); 20 | echo "1"; 21 | }else{ 22 | echo "-1"; 23 | } 24 | ?> -------------------------------------------------------------------------------- /include/comments/deleteGJComment.php: -------------------------------------------------------------------------------- 1 | remove($_POST["commentID"]); 8 | $accountID = $ep->remove($_POST["accountID"]); 9 | $gjp = $ep->remove($_POST["gjp"]); 10 | $GJPCheck = new GJPCheck(); 11 | $gjpresult = $GJPCheck->check($gjp,$accountID); 12 | if($gjpresult == 1){ 13 | $query = $db->prepare("SELECT userID FROM users WHERE extID = :accountID"); 14 | $query->execute([':accountID' => $accountID]); 15 | $userID = $query->fetchColumn(); 16 | $query = $db->prepare("DELETE FROM comments WHERE commentID=:commentID AND userID=:userID LIMIT 1"); 17 | $query->execute([':commentID' => $commentID, ':userID' => $userID]); 18 | if($query->rowCount() == 0){ 19 | $query = $db->prepare("SELECT levelID FROM comments WHERE commentID = :commentID"); 20 | $query->execute([':commentID' => $commentID]); 21 | $levelID = $query->fetchColumn(); 22 | $query = $db->prepare("SELECT userID FROM levels WHERE levelID = :levelID"); 23 | $query->execute([':levelID' => $levelID]); 24 | $creatorID = $query->fetchColumn(); 25 | $query = $db->prepare("SELECT extID FROM users WHERE userID = :userID"); 26 | $query->execute([':userID' => $creatorID]); 27 | $creatorAccID = $query->fetchColumn(); 28 | if($creatorAccID == $accountID){ 29 | $query = $db->prepare("DELETE FROM comments WHERE commentID=:commentID AND levelID=:levelID LIMIT 1"); 30 | $query->execute([':commentID' => $commentID, ':levelID' => $levelID]); 31 | } 32 | } 33 | echo "1"; 34 | }else{ 35 | echo "-1"; 36 | } 37 | ?> -------------------------------------------------------------------------------- /include/comments/getGJAccountComments.php: -------------------------------------------------------------------------------- 1 | remove($_POST["accountID"]); 11 | $page = $ep->remove($_POST["page"]); 12 | $commentpage = $page*10; 13 | $userID = $gs->getUserID($accountid); 14 | $query = "SELECT comment, userID, likes, isSpam, commentID, timestamp FROM acccomments WHERE userID = :userID ORDER BY timeStamp DESC LIMIT 10 OFFSET $commentpage"; 15 | $query = $db->prepare($query); 16 | $query->execute([':userID' => $userID]); 17 | $result = $query->fetchAll(); 18 | if($query->rowCount() == 0){ 19 | exit("#0:0:0"); 20 | } 21 | $countquery = $db->prepare("SELECT count(*) FROM acccomments WHERE userID = :userID"); 22 | $countquery->execute([':userID' => $userID]); 23 | $commentcount = $countquery->fetchColumn(); 24 | foreach($result as &$comment1) { 25 | if($comment1["commentID"]!=""){ 26 | $uploadDate = $gs->makeTime(time()-$comment1["timestamp"]); 27 | $commentstring .= "2~".$comment1["comment"]."~3~".$comment1["userID"]."~4~".$comment1["likes"]."~5~0~7~".$comment1["isSpam"]."~9~".$uploadDate."~6~".$comment1["commentID"]."|"; 28 | } 29 | } 30 | $commentstring = substr($commentstring, 0, -1); 31 | echo $commentstring; 32 | echo "#".$commentcount.":".$commentpage.":10"; 33 | ?> -------------------------------------------------------------------------------- /include/comments/getGJComments.php: -------------------------------------------------------------------------------- 1 | remove($_POST["binaryVersion"]); 10 | $gameVersion = $ep->remove($_POST["gameVersion"]); 11 | $commentstring = ""; 12 | $userstring = ""; 13 | 14 | $users = array(); 15 | if(isset($_POST["mode"])){ 16 | $mode = $ep->remove($_POST["mode"]); 17 | }else{ 18 | $mode = 0; 19 | } 20 | if(isset($_POST["count"]) AND is_numeric($_POST["count"])){ 21 | $count = $ep->remove($_POST["count"]); 22 | }else{ 23 | $count = 10; 24 | } 25 | $page = $ep->remove($_POST["page"]); 26 | $commentpage = $page*$count; 27 | if($mode==0){ 28 | $modeColumn = "commentID"; 29 | }else{ 30 | $modeColumn = "likes"; 31 | } 32 | if(empty($_POST["levelID"]) OR !$_POST["levelID"]){ 33 | $displayLevelID = true; 34 | $levelID = $ep->remove($_POST["userID"]); 35 | $query = "SELECT levelID, commentID, timestamp, comment, userID, likes, isSpam, percent FROM comments WHERE userID = :levelID ORDER BY $modeColumn DESC LIMIT $count OFFSET $commentpage"; 36 | $countquery = "SELECT count(*) FROM comments WHERE userID = :levelID"; 37 | }else{ 38 | $displayLevelID = false; 39 | $levelID = $ep->remove($_POST["levelID"]); 40 | $query = "SELECT levelID, commentID, timestamp, comment, userID, likes, isSpam, percent FROM comments WHERE levelID = :levelID ORDER BY $modeColumn DESC LIMIT $count OFFSET $commentpage"; 41 | $countquery = "SELECT count(*) FROM comments WHERE levelID = :levelID"; 42 | } 43 | $countquery = $db->prepare($countquery); 44 | $countquery->execute([':levelID' => $levelID]); 45 | $commentcount = $countquery->fetchColumn(); 46 | if($commentcount == 0){ 47 | exit("-2"); 48 | } 49 | $query = $db->prepare($query); 50 | $query->execute([':levelID' => $levelID]); 51 | $result = $query->fetchAll(); 52 | foreach($result as &$comment1) { 53 | if($comment1["commentID"]!=""){ 54 | $uploadDate = $gs->makeTime(time()-$comment1["timestamp"]); 55 | $actualcomment = $comment1["comment"]; 56 | if($gameVersion < 20){ 57 | $actualcomment = base64_decode($actualcomment); 58 | } 59 | if($displayLevelID){ 60 | $commentstring .= "1~".$comment1["levelID"]."~"; 61 | } 62 | $commentstring .= "2~".$actualcomment."~3~".$comment1["userID"]."~4~".$comment1["likes"]."~5~0~7~".$comment1["isSpam"]."~9~".$uploadDate."~6~".$comment1["commentID"]."~10~".$comment1["percent"]; 63 | $query12 = $db->prepare("SELECT userID, userName, icon, color1, color2, iconType, special, extID FROM users WHERE userID = :userID"); 64 | $query12->execute([':userID' => $comment1["userID"]]); 65 | if ($query12->rowCount() > 0) { 66 | $user = $query12->fetchAll()[0]; 67 | if(is_numeric($user["extID"])){ 68 | $extID = $user["extID"]; 69 | }else{ 70 | $extID = 0; 71 | } 72 | if(!in_array($user["userID"], $users)){ 73 | $users[] = $user["userID"]; 74 | $userstring .= $user["userID"] . ":" . $user["userName"] . ":" . $extID . "|"; 75 | } 76 | if($binaryVersion > 31){ 77 | $commentstring .= "~11~".$gs->getMaxValuePermission($extID, "modBadgeLevel")."~12~".$gs->getAccountCommentColor($extID).":1~".$user["userName"]."~7~1~9~".$user["icon"]."~10~".$user["color1"]."~11~".$user["color2"]."~14~".$user["iconType"]."~15~".$user["special"]."~16~".$user["extID"]; 78 | } 79 | $commentstring .= "|"; 80 | } 81 | } 82 | } 83 | $commentstring = substr($commentstring, 0, -1); 84 | $userstring = substr($userstring, 0, -1); 85 | echo $commentstring; 86 | if($binaryVersion < 32){ 87 | echo "#$userstring"; 88 | } 89 | echo "#".$commentcount.":".$commentpage.":10"; 90 | ?> -------------------------------------------------------------------------------- /include/comments/uploadGJAccComment.php: -------------------------------------------------------------------------------- 1 | remove($_POST["gjp"]); 14 | $userName = $ep->remove($_POST["userName"]); 15 | $comment = $ep->remove($_POST["comment"]); 16 | $id = $ep->remove($_POST["accountID"]); 17 | $userID = $mainLib->getUserID($id, $userName); 18 | $uploadDate = time(); 19 | //usercheck 20 | if($id != "" AND $comment != "" AND $GJPCheck->check($gjp,$id) == 1){ 21 | $decodecomment = base64_decode($comment); 22 | if($cmds->doProfileCommands($id, $decodecomment)){ 23 | exit("-1"); 24 | } 25 | $query = $db->prepare("INSERT INTO acccomments (userName, comment, userID, timeStamp) 26 | VALUES (:userName, :comment, :userID, :uploadDate)"); 27 | $query->execute([':userName' => $userName, ':comment' => $comment, ':userID' => $userID, ':uploadDate' => $uploadDate]); 28 | echo 1; 29 | }else{ 30 | echo -1; 31 | } 32 | ?> -------------------------------------------------------------------------------- /include/comments/uploadGJComment.php: -------------------------------------------------------------------------------- 1 | remove($_POST["gjp"]); 15 | $userName = $ep->remove($_POST["userName"]); 16 | $comment = $ep->remove($_POST["comment"]); 17 | $gameversion = $_POST["gameVersion"]; 18 | if($gameversion < 20){ 19 | $comment = base64_encode($comment); 20 | } 21 | $levelID = $ep->remove($_POST["levelID"]); 22 | if(!empty($_POST["percent"])){ 23 | $percent = $ep->remove($_POST["percent"]); 24 | }else{ 25 | $percent = 0; 26 | } 27 | if(!empty($_POST["accountID"]) AND $_POST["accountID"]!="0"){ 28 | $id = $ep->remove($_POST["accountID"]); 29 | $register = 1; 30 | $GJPCheck = new GJPCheck(); 31 | $gjpresult = $GJPCheck->check($gjp,$id); 32 | if($gjpresult != 1){ 33 | exit("-1"); 34 | } 35 | }else{ 36 | $id = $ep->remove($_POST["udid"]); 37 | $register = 0; 38 | if(is_numeric($id)){ 39 | exit("-1"); 40 | } 41 | } 42 | $userID = $mainLib->getUserID($id, $userName); 43 | $uploadDate = time(); 44 | $decodecomment = base64_decode($comment); 45 | if($cmds->doCommands($id, $decodecomment, $levelID)){ 46 | exit("-1"); 47 | } 48 | if($id != "" AND $comment != ""){ 49 | $query = $db->prepare("INSERT INTO comments (userName, comment, levelID, userID, timeStamp, percent) VALUES (:userName, :comment, :levelID, :userID, :uploadDate, :percent)"); 50 | if($register == 1){ 51 | $query->execute([':userName' => $userName, ':comment' => $comment, ':levelID' => $levelID, ':userID' => $userID, ':uploadDate' => $uploadDate, ':percent' => $percent]); 52 | echo 1; 53 | if($percent != 0){ 54 | $query2 = $db->prepare("SELECT percent FROM levelscores WHERE accountID = :accountID AND levelID = :levelID"); 55 | $query2->execute([':accountID' => $id, ':levelID' => $levelID]); 56 | $result = $query2->fetchColumn(); 57 | if ($query2->rowCount() == 0) { 58 | $query = $db->prepare("INSERT INTO levelscores (accountID, levelID, percent, uploadDate) 59 | VALUES (:accountID, :levelID, :percent, :uploadDate)"); 60 | } else { 61 | if($result < $percent){ 62 | $query = $db->prepare("UPDATE levelscores SET percent=:percent, uploadDate=:uploadDate WHERE accountID=:accountID AND levelID=:levelID"); 63 | $query->execute([':accountID' => $id, ':levelID' => $levelID, ':percent' => $percent, ':uploadDate' => $uploadDate]); 64 | } 65 | } 66 | } 67 | }else{ 68 | $query->execute([':userName' => $userName, ':comment' => $comment, ':levelID' => $levelID, ':userID' => $userID, ':uploadDate' => $uploadDate, ':percent' => $percent]); 69 | echo 1; 70 | } 71 | }else{ 72 | echo -1; 73 | } 74 | ?> 75 | -------------------------------------------------------------------------------- /include/components/images/tools_favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woidzero/IoCore/38e161086e5d7266dd8df16ff9d2401c103d8e6c/include/components/images/tools_favicon.png -------------------------------------------------------------------------------- /include/levelpacks/getGJGauntlets.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT ID,level1,level2,level3,level4,level5 FROM gauntlets WHERE level5 != '0' ORDER BY ID ASC"); 9 | $query->execute(); 10 | $result = $query->fetchAll(); 11 | foreach($result as &$gauntlet){ 12 | $lvls = $gauntlet["level1"].",".$gauntlet["level2"].",".$gauntlet["level3"].",".$gauntlet["level4"].",".$gauntlet["level5"]; 13 | $gauntletstring .= "1:".$gauntlet["ID"].":3:".$lvls."|"; 14 | $string .= $gauntlet["ID"].$lvls; 15 | } 16 | $gauntletstring = substr($gauntletstring, 0, -1); 17 | echo $gauntletstring; 18 | echo "#".$generateHash->genSolo2($string); 19 | ?> -------------------------------------------------------------------------------- /include/levelpacks/getGJMapPacks.php: -------------------------------------------------------------------------------- 1 | remove($_POST["page"]); 8 | $packpage = $page*10; 9 | $mappackstring = ""; 10 | $lvlsmultistring = ""; 11 | $query = $db->prepare("SELECT colors2,rgbcolors,ID,name,levels,stars,coins,difficulty FROM `mappacks` ORDER BY `ID` ASC LIMIT 10 OFFSET $packpage"); 12 | $query->execute(); 13 | $result = $query->fetchAll(); 14 | $packcount = $query->rowCount(); 15 | foreach($result as &$mappack) { 16 | $lvlsmultistring .= $mappack["ID"] . ","; 17 | $colors2 = $mappack["colors2"]; 18 | if($colors2 == "none" OR $colors2 == ""){ 19 | $colors2 = $mappack["rgbcolors"]; 20 | } 21 | $mappackstring .= "1:".$mappack["ID"].":2:".$mappack["name"].":3:".$mappack["levels"].":4:".$mappack["stars"].":5:".$mappack["coins"].":6:".$mappack["difficulty"].":7:".$mappack["rgbcolors"].":8:".$colors2."|"; 22 | } 23 | $query = $db->prepare("SELECT count(*) FROM mappacks"); 24 | $query->execute(); 25 | $totalpackcount = $query->fetchColumn(); 26 | $mappackstring = substr($mappackstring, 0, -1); 27 | $lvlsmultistring = substr($lvlsmultistring, 0, -1); 28 | echo $mappackstring; 29 | echo "#".$totalpackcount.":".$packpage.":10"; 30 | echo "#"; 31 | require "../lib/generateHash.php"; 32 | $hash = new generateHash(); 33 | echo $hash->genPack($lvlsmultistring); 34 | ?> -------------------------------------------------------------------------------- /include/levels/cp.php: -------------------------------------------------------------------------------- 1 | prepare("update users 5 | set creatorPoints = ( 6 | select COUNT(*) 7 | from levels 8 | where levels.userID = users.userID AND starStars != 0 9 | ) + ( 10 | select COUNT(*) 11 | from levels 12 | where levels.userID = users.userID AND levels.starFeatured != 0 AND levels.starEpic = 0 13 | ) + ( 14 | select COUNT(*) 15 | from levels 16 | where levels.userID = users.userID AND levels.starEpic = 1 AND levels.starFeatured = 0 17 | ) + ( 18 | select COUNT(*) 19 | from levels 20 | where levels.userID = users.userID AND levels.starEpic = 1 AND levels.starFeatured = 0 21 | ) + ( 22 | select COUNT(*) 23 | from levels 24 | where levels.userID = users.userID AND levels.starEpic = 1 AND levels.starFeatured = 1 25 | ) + ( 26 | select COUNT(*) 27 | from levels 28 | where levels.userID = users.userID AND levels.starEpic = 1 AND levels.starFeatured = 1 29 | )"); 30 | $query->execute(); 31 | ?> 32 | -------------------------------------------------------------------------------- /include/levels/deleteGJLevelUser.php: -------------------------------------------------------------------------------- 1 | remove($_POST["levelID"]); 10 | $accountID = $ep->remove($_POST["accountID"]); 11 | $gjp = $ep->remove($_POST["gjp"]); 12 | $GJPCheck = new GJPCheck(); 13 | $gjpresult = $GJPCheck->check($gjp,$accountID); 14 | if(!is_numeric($levelID)){ 15 | exit("-1"); 16 | } 17 | if($gjpresult == 1){ 18 | $userID = $mainLib->getUserID($accountID); 19 | $query = $db->prepare("DELETE from levels WHERE levelID=:levelID AND userID=:userID AND starStars = 0 LIMIT 1"); 20 | $query->execute([':levelID' => $levelID, ':userID' => $userID]); 21 | $query6 = $db->prepare("INSERT INTO actions (type, value, timestamp, value2) VALUES 22 | (:type,:itemID, :time, :ip)"); 23 | $query6->execute([':type' => 8, ':itemID' => $levelID, ':time' => time(), ':ip' => $userID]); 24 | if(file_exists("../../data/levels/$levelID") AND $query->rowCount() != 0){ 25 | rename("../../data/levels/$levelID","../../data/levels/deleted/$levelID"); 26 | } 27 | echo "1"; 28 | }else{ 29 | echo "-1"; 30 | } 31 | ?> -------------------------------------------------------------------------------- /include/levels/getGJDailyLevel.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT feaID FROM dailyfeatures WHERE timestamp < :current AND type = :type ORDER BY timestamp DESC LIMIT 1"); 14 | $query->execute([':current' => $current, ':type' => $weekly]); 15 | $dailyID = $query->fetchColumn(); 16 | if($weekly == 1){ 17 | $dailyID = $dailyID + 100001; //the fuck went through robtops head when he was implementing this 18 | } 19 | //Time left 20 | $timeleft = $midnight - $current; 21 | //output 22 | echo $dailyID ."|". $timeleft; 23 | ?> 24 | -------------------------------------------------------------------------------- /include/levels/rateGJDemon.php: -------------------------------------------------------------------------------- 1 | remove($_POST["gjp"]); 14 | $rating = $ep->remove($_POST["rating"]); 15 | $levelID = $ep->remove($_POST["levelID"]); 16 | $id = $ep->remove($_POST["accountID"]); 17 | $GJPCheck = new GJPCheck(); 18 | $gjpresult = $GJPCheck->check($gjp,$id); 19 | if($gs->checkPermission($id, "actionRateDemon") == false OR $gjpresult != 1){ 20 | exit("-1"); 21 | } 22 | $auto = 0; 23 | $demon = 0; 24 | switch($rating){ 25 | case 1: 26 | $dmn = 3; 27 | $dmnname = "Easy"; 28 | break; 29 | case 2: 30 | $dmn = 4; 31 | $dmnname = "Medium"; 32 | break; 33 | case 3: 34 | $dmn = 0; 35 | $dmnname = "Hard"; 36 | break; 37 | case 4: 38 | $dmn = 5; 39 | $dmnname = "Insane"; 40 | break; 41 | case 5: 42 | $dmn = 6; 43 | $dmnname = "Extreme"; 44 | break; 45 | } 46 | $timestamp = time(); 47 | $query = $db->prepare("UPDATE levels SET starDemonDiff=:demon WHERE levelID=:levelID"); 48 | $query->execute([':demon' => $dmn, ':levelID'=>$levelID]); 49 | $query = $db->prepare("INSERT INTO modactions (type, value, value3, timestamp, account) VALUES ('10', :value, :levelID, :timestamp, :id)"); 50 | $query->execute([':value' => $dmnname, ':timestamp' => $timestamp, ':id' => $id, ':levelID' => $levelID]); 51 | echo $levelID; 52 | ?> 53 | -------------------------------------------------------------------------------- /include/levels/rateGJStars.php: -------------------------------------------------------------------------------- 1 | remove($_POST["gjp"]); 10 | $stars = $ep->remove($_POST["stars"]); 11 | $levelID = $ep->remove($_POST["levelID"]); 12 | $accountID = $ep->remove($_POST["accountID"]); 13 | if($accountID != "" AND $gjp != ""){ 14 | $GJPCheck = new GJPCheck(); 15 | $gjpresult = $GJPCheck->check($gjp,$accountID); 16 | if($gjpresult == 1){ 17 | $permState = $gs->checkPermission($accountID, "actionRateStars"); 18 | if($permState){ 19 | $difficulty = $gs->getDiffFromStars($stars); 20 | $gs->rateLevel($accountID, $levelID, 0, $difficulty["diff"], $difficulty["auto"], $difficulty["demon"]); 21 | echo 1; 22 | }else{ 23 | echo -1; 24 | } 25 | }else{echo -1;} 26 | }else{echo -1;} -------------------------------------------------------------------------------- /include/levels/reportGJLevel.php: -------------------------------------------------------------------------------- 1 | remove($_POST["levelID"]); 11 | $ip = $gs->getIP(); 12 | $query = "SELECT count(*) FROM reports WHERE levelID = :levelID AND hostname = :hostname"; 13 | $query = $db->prepare($query); 14 | $query->execute([':levelID' => $levelID, ':hostname' => $ip]); 15 | 16 | if($query->fetchColumn() == 0){ 17 | $query = $db->prepare("INSERT INTO reports (levelID, hostname) VALUES (:levelID, :hostname)"); 18 | $query->execute([':levelID' => $levelID, ':hostname' => $ip]); 19 | echo $db->lastInsertId(); 20 | }else{ 21 | echo -1; 22 | } 23 | } 24 | ?> -------------------------------------------------------------------------------- /include/levels/suggestGJStars.php: -------------------------------------------------------------------------------- 1 | remove($_POST["gjp"]); 11 | $stars = $ep->remove($_POST["stars"]); 12 | $feature = $ep->remove($_POST["feature"]); 13 | $levelID = $ep->remove($_POST["levelID"]); 14 | $accountID = $ep->remove($_POST["accountID"]); 15 | if($accountID != "" AND $gjp != ""){ 16 | $GJPCheck = new GJPCheck(); 17 | $gjpresult = $GJPCheck->check($gjp,$accountID); 18 | if($gjpresult == 1){ 19 | $difficulty = $gs->getDiffFromStars($stars); 20 | if($gs->checkPermission($accountID, "actionRateStars")){ 21 | $gs->rateLevel($accountID, $levelID, $stars, $difficulty["diff"], $difficulty["auto"], $difficulty["demon"]); 22 | $gs->featureLevel($accountID, $levelID, $feature); 23 | $gs->verifyCoinsLevel($accountID, $levelID, 1); 24 | echo 1; 25 | include "cp.php"; 26 | }else if($gs->checkPermission($accountID, "actionSuggestRating")){ 27 | $gs->suggestLevel($accountID, $levelID, $difficulty["diff"], $stars, $feature, $difficulty["auto"], $difficulty["demon"]); 28 | echo 1; 29 | }else{ 30 | echo -2; 31 | } 32 | }else{ 33 | echo -2; 34 | } 35 | }else{ 36 | echo -2; 37 | } 38 | ?> 39 | -------------------------------------------------------------------------------- /include/levels/updateGJDesc.php: -------------------------------------------------------------------------------- 1 | remove($_POST["levelDesc"]); 13 | $levelID = $ep->remove($_POST["levelID"]); 14 | if (isset($_POST['udid']) && !empty($_POST['udid'])) { 15 | $id = $ep->remove($_POST["udid"]); 16 | if (is_numeric($id)) { 17 | exit("-1"); 18 | } 19 | } else { 20 | $id = $ep->remove($_POST["accountID"]); 21 | $gjp = $ep->remove($_POST["gjp"]); 22 | $gjpresult = $GJPCheck->check($gjp, $id); 23 | if ($gjpresult != 1) { 24 | exit("-1"); 25 | } 26 | } 27 | $levelDesc = str_replace('-', '+', $levelDesc); 28 | $levelDesc = str_replace('_', '/', $levelDesc); 29 | $rawDesc = base64_decode($levelDesc); 30 | if (strpos($rawDesc, ' substr_count($rawDesc, '')) { 33 | $tags = $tags - substr_count($rawDesc, ''); 34 | for ($i = 0; $i < $tags; $i++) { 35 | $rawDesc .= ''; 36 | } 37 | $levelDesc = str_replace('+', '-', base64_encode($rawDesc)); 38 | $levelDesc = str_replace('/', '_', $levelDesc); 39 | } 40 | } 41 | $query = $db->prepare("UPDATE levels SET levelDesc=:levelDesc WHERE levelID=:levelID AND extID=:extID"); 42 | $query->execute([':levelID' => $levelID, ':extID' => $id, ':levelDesc' => $levelDesc]); 43 | echo 1; 44 | -------------------------------------------------------------------------------- /include/lib/GJPCheck.php: -------------------------------------------------------------------------------- 1 | getIP(); 10 | $query = $db->prepare("SELECT count(*) FROM actions WHERE type = 16 AND value = :accountID AND value2 = :ip AND timestamp > :timestamp"); 11 | $query->execute([':accountID' => $accountID, ':ip' => $ip, ':timestamp' => time() - 3600]); 12 | if($query->fetchColumn() > 0){ 13 | return 1; 14 | } 15 | } 16 | require_once dirname(__FILE__)."/XORCipher.php"; 17 | require_once dirname(__FILE__)."/generatePass.php"; 18 | $xor = new XORCipher(); 19 | $gjpdecode = str_replace("_","/",$gjp); 20 | $gjpdecode = str_replace("-","+",$gjpdecode); 21 | $gjpdecode = base64_decode($gjpdecode); 22 | $gjpdecode = $xor->cipher($gjpdecode,37526); 23 | $generatePass = new generatePass(); 24 | if($generatePass->isValid($accountID, $gjpdecode) == 1 AND $sessionGrants){ 25 | $ip = $ml->getIP(); 26 | $query = $db->prepare("INSERT INTO actions (type, value, value2, timestamp) VALUES (16, :accountID, :ip, :timestamp)"); 27 | $query->execute([':accountID' => $accountID, ':ip' => $ip, ':timestamp' => time()]); 28 | } 29 | return $generatePass->isValid($accountID, $gjpdecode); 30 | } 31 | } 32 | ?> 33 | -------------------------------------------------------------------------------- /include/lib/XORCipher.php: -------------------------------------------------------------------------------- 1 | text2ascii($key); 7 | $plaintext = $this->text2ascii($plaintext); 8 | 9 | $keysize = count($key); 10 | $input_size = count($plaintext); 11 | 12 | $cipher = ""; 13 | 14 | for ($i = 0; $i < $input_size; $i++) 15 | $cipher .= chr($plaintext[$i] ^ $key[$i % $keysize]); 16 | 17 | return $cipher; 18 | } 19 | 20 | public function crack($cipher, $keysize) { 21 | $cipher = $this->text2ascii($cipher); 22 | $occurences = $key = array(); 23 | $input_size = count($cipher); 24 | 25 | for ($i = 0; $i < $input_size; $i++) { 26 | $j = $i % $keysize; 27 | if (++$occurences[$j][$cipher[$i]] > $occurences[$j][$key[$j]]) 28 | $key[$j] = $cipher[$i]; 29 | } 30 | 31 | return $this->ascii2text(array_map(function($v) { return $v ^ 32; }, $key)); 32 | } 33 | 34 | public function plaintext($cipher, $key) { 35 | $key = $this->text2ascii($key); 36 | $cipher = $this->text2ascii($cipher); 37 | $keysize = count($key); 38 | $input_size = count($cipher); 39 | $plaintext = ""; 40 | 41 | for ($i = 0; $i < $input_size; $i++) 42 | $plaintext .= chr($cipher[$i] ^ $key[$i % $keysize]); 43 | 44 | return $plaintext; 45 | } 46 | 47 | private function text2ascii($text) { 48 | return array_map('ord', str_split($text)); 49 | } 50 | 51 | private function ascii2text($ascii) { 52 | $text = ""; 53 | 54 | foreach($ascii as $char) 55 | $text .= chr($char); 56 | 57 | return $text; 58 | } 59 | } -------------------------------------------------------------------------------- /include/lib/connection.php: -------------------------------------------------------------------------------- 1 | true)); 9 | $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 10 | } catch(PDOException $e) { 11 | echo "Connection failed: " . $e->getMessage(); 12 | } 13 | ?> -------------------------------------------------------------------------------- /include/lib/defuse-crypto.phar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/woidzero/IoCore/38e161086e5d7266dd8df16ff9d2401c103d8e6c/include/lib/defuse-crypto.phar -------------------------------------------------------------------------------- /include/lib/exploitPatch.php: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /include/lib/generateHash.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT levelID, starStars, starCoins FROM levels WHERE levelID = :id"); 9 | $query->execute([':id' => $id]); 10 | $result2 = $query->fetchAll(); 11 | $result = $result2[0]; 12 | $hash = $hash . $result["levelID"][0].$result["levelID"][strlen($result["levelID"])-1].$result["starStars"].$result["starCoins"]; 13 | } 14 | return sha1($hash . "xI25fpAapCQg"); 15 | } 16 | public function genSolo($levelstring) { 17 | $hash = "aaaaa"; 18 | $len = strlen($levelstring); 19 | $divided = intval($len/40); 20 | $p = 0; 21 | for($k = 0; $k < $len ; $k= $k+$divided){ 22 | if($p > 39) break; 23 | $hash[$p] = $levelstring[$k]; 24 | $p++; 25 | } 26 | return sha1($hash . "xI25fpAapCQg"); 27 | } 28 | public function genSolo2($lvlsmultistring) { 29 | return sha1($lvlsmultistring . "xI25fpAapCQg"); 30 | } 31 | public function genSolo3($lvlsmultistring) { 32 | return sha1($lvlsmultistring . "oC36fpYaPtdg"); 33 | } 34 | public function genSolo4($lvlsmultistring){ 35 | return sha1($lvlsmultistring . "pC26fpYaQCtg"); 36 | } 37 | public function genPack($lvlsmultistring) { 38 | $lvlsarray = explode(",", $lvlsmultistring); 39 | include dirname(__FILE__)."/connection.php"; 40 | $hash = ""; 41 | foreach($lvlsarray as $id){ 42 | $query=$db->prepare("SELECT ID,stars,coins FROM mappacks WHERE ID = :id"); 43 | $query->execute([':id' => $id]); 44 | $result2 = $query->fetchAll(); 45 | $result = $result2[0]; 46 | $hash = $hash . $result["ID"][0].$result["ID"][strlen($result["ID"])-1].$result["stars"].$result["coins"]; 47 | } 48 | return sha1($hash . "xI25fpAapCQg"); 49 | } 50 | public function genSeed2noXor($levelstring) { 51 | $hash = "aaaaa"; 52 | $len = strlen($levelstring); 53 | $divided = intval($len/50); 54 | $p = 0; 55 | for($k = 0; $k < $len ; $k= $k+$divided){ 56 | if($p > 49) break; 57 | $hash[$p] = $levelstring[$k]; 58 | $p++; 59 | } 60 | $hash = sha1($hash."xI25fpAapCQg"); 61 | return $hash; 62 | } 63 | } 64 | ?> -------------------------------------------------------------------------------- /include/lib/generatePass.php: -------------------------------------------------------------------------------- 1 | getIP(); 9 | $newtime = time() - (60*60); 10 | $query6 = $db->prepare("SELECT count(*) FROM actions WHERE type = '6' AND timestamp > :time AND value2 = :ip"); 11 | $query6->execute([':time' => $newtime, ':ip' => $ip]); 12 | if($query6->fetchColumn() > 7){ 13 | return -1; 14 | }else{ 15 | $query = $db->prepare("SELECT accountID, salt, password, isAdmin FROM accounts WHERE userName LIKE :userName"); 16 | $query->execute([':userName' => $userName]); 17 | if($query->rowCount() == 0){ 18 | return 0; 19 | } 20 | $result = $query->fetch(); 21 | if(password_verify($pass, $result["password"])){ 22 | $modipCategory = $gs->getMaxValuePermission($result["accountID"], "modipCategory"); 23 | if($modipCategory > 0){ //modIPs 24 | $query4 = $db->prepare("SELECT count(*) FROM modips WHERE accountID = :id"); 25 | $query4->execute([':id' => $result["accountID"]]); 26 | if ($query4->fetchColumn() > 0) { 27 | $query6 = $db->prepare("UPDATE modips SET IP=:hostname, modipCategory=:modipCategory WHERE accountID=:id"); 28 | }else{ 29 | $query6 = $db->prepare("INSERT INTO modips (IP, accountID, isMod, modipCategory) VALUES (:hostname,:id,'1',:modipCategory)"); 30 | } 31 | $query6->execute([':hostname' => $ip, ':id' => $result["accountID"], ':modipCategory' => $modipCategory]); 32 | } 33 | return 1; 34 | }else{ 35 | $md5pass = md5($pass . "epithewoihewh577667675765768rhtre67hre687cvolton5gw6547h6we7h6wh"); 36 | CRYPT_BLOWFISH or die ('-2'); 37 | $Blowfish_Pre = '$2a$05$'; 38 | $Blowfish_End = '$'; 39 | $hashed_pass = crypt($md5pass, $Blowfish_Pre . $result['salt'] . $Blowfish_End); 40 | if ($hashed_pass == $result['password']) { 41 | $pass = password_hash($pass, PASSWORD_DEFAULT); 42 | //updating hash 43 | $query = $db->prepare("UPDATE accounts SET password=:password WHERE userName=:userName"); 44 | $query->execute([':userName' => $userName, ':password' => $pass]); 45 | return 1; 46 | } else { 47 | if($md5pass == $result['password']){ 48 | $pass = password_hash($pass, PASSWORD_DEFAULT); 49 | //updating hash 50 | $query = $db->prepare("UPDATE accounts SET password=:password WHERE userName=:userName"); 51 | $query->execute([':userName' => $userName, ':password' => $pass]); 52 | return 1; 53 | } else { 54 | $query6 = $db->prepare("INSERT INTO actions (type, value, timestamp, value2) VALUES 55 | ('6',:username,:time,:ip)"); 56 | $query6->execute([':username' => $userName, ':time' => time(), ':ip' => $ip]); 57 | return 0; 58 | } 59 | } 60 | } 61 | } 62 | } 63 | public function isValid($accid, $pass){ 64 | include dirname(__FILE__)."/connection.php"; 65 | $query = $db->prepare("SELECT userName FROM accounts WHERE accountID = :accid"); 66 | $query->execute([':accid' => $accid]); 67 | if($query->rowCount() == 0){ 68 | return 0; 69 | } 70 | $result = $query->fetch(); 71 | $userName = $result["userName"]; 72 | $generatePass = new generatePass(); 73 | return $generatePass->isValidUsrname($userName, $pass); 74 | } 75 | } 76 | ?> -------------------------------------------------------------------------------- /include/lib/mail.php: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /include/lib/songReup.php: -------------------------------------------------------------------------------- 1 | prepare("INSERT INTO songs (ID, name, authorID, authorName, size, download) 11 | VALUES (:id, :name, :authorID, :authorName, :size, :download)"); 12 | $query->execute([':id'=>$resultarray[1], ':name' => $resultarray[3], ':authorID' => $resultarray[5], ':authorName' => $resultarray[7], ':size' => $resultarray[9], ':download' => $resultarray[13]]); 13 | return $db->lastInsertId(); 14 | } 15 | } 16 | ?> -------------------------------------------------------------------------------- /include/messages/deleteGJMessages.php: -------------------------------------------------------------------------------- 1 | remove($_POST["messageID"]);} 8 | $accountID = $ep->remove($_POST["accountID"]); 9 | if(isset($_POST['messages'])){ 10 | $messageID = "0"; 11 | $messages = $ep->remove($_POST["messages"]); 12 | $messages = preg_replace('/[^0-9,]/', '', $messages); 13 | $gjp = $ep->remove($_POST["gjp"]); 14 | $GJPCheck = new GJPCheck(); 15 | $gjpresult = $GJPCheck->check($gjp,$accountID); 16 | if($gjpresult == 1){ 17 | $query = $db->prepare("DELETE FROM messages WHERE messageID IN (".$messages.") AND accID=:accountID LIMIT 10"); 18 | $query->execute([':accountID' => $accountID]); 19 | $query = $db->prepare("DELETE FROM messages WHERE messageID IN (".$messages.") AND toAccountID=:accountID LIMIT 10"); 20 | $query->execute([':accountID' => $accountID]); 21 | echo "1"; 22 | }else{ 23 | echo "-1"; 24 | } 25 | } else { 26 | $gjp = $ep->remove($_POST["gjp"]); 27 | $GJPCheck = new GJPCheck(); 28 | $gjpresult = $GJPCheck->check($gjp,$accountID); 29 | if($gjpresult == 1){ 30 | $query = $db->prepare("DELETE FROM messages WHERE messageID=:messageID AND accID=:accountID LIMIT 1"); 31 | $query->execute([':messageID' => $messageID, ':accountID' => $accountID]); 32 | $query = $db->prepare("DELETE FROM messages WHERE messageID=:messageID AND toAccountID=:accountID LIMIT 1"); 33 | $query->execute([':messageID' => $messageID, ':accountID' => $accountID]); 34 | echo "1"; 35 | }else{ 36 | echo "-1"; 37 | } 38 | } 39 | ?> 40 | -------------------------------------------------------------------------------- /include/messages/downloadGJMessage.php: -------------------------------------------------------------------------------- 1 | remove($_POST["accountID"]); 8 | $gjp = $ep->remove($_POST["gjp"]); 9 | $messageID = $ep->remove($_POST["messageID"]); 10 | $GJPCheck = new GJPCheck(); 11 | $gjpresult = $GJPCheck->check($gjp,$accountID); 12 | if($gjpresult == 1){ 13 | $query=$db->prepare("SELECT accID, toAccountID, timestamp, userName, messageID, subject, isNew, body FROM messages WHERE messageID = :messageID AND (accID = :accID OR toAccountID = :accID) LIMIT 1"); 14 | $query->execute([':messageID' => $messageID, ':accID' => $accountID]); 15 | $result = $query->fetch(); 16 | if($query->rowCount() == 0){ 17 | exit("-1"); 18 | } 19 | if(empty($_POST["isSender"])){ 20 | $query=$db->prepare("UPDATE messages SET isNew=1 WHERE messageID = :messageID AND toAccountID = :accID"); 21 | $query->execute([':messageID' => $messageID, ':accID' =>$accountID]); 22 | $accountID = $result["accID"]; 23 | $isSender = 0; 24 | }else{ 25 | $isSender = 1; 26 | $accountID = $result["toAccountID"]; 27 | } 28 | $query=$db->prepare("SELECT userName,userID,extID FROM users WHERE extID = :accountID"); 29 | $query->execute([':accountID' => $accountID]); 30 | $result12 = $query->fetch(); 31 | $uploadDate = date("d/m/Y G.i", $result["timestamp"]); 32 | echo "6:".$result12["userName"].":3:".$result12["userID"].":2:".$result12["extID"].":1:".$result["messageID"].":4:".$result["subject"].":8:".$result["isNew"].":9:".$isSender.":5:".$result["body"].":7:".$uploadDate.""; 33 | }else{ 34 | echo -1; 35 | } 36 | ?> -------------------------------------------------------------------------------- /include/messages/getGJMessages.php: -------------------------------------------------------------------------------- 1 | remove($_POST["accountID"]); 12 | $gjp = $ep->remove($_POST["gjp"]); 13 | $page = $ep->remove($_POST["page"]); 14 | $offset = $page * 10; 15 | $GJPCheck = new GJPCheck(); 16 | $gjpresult = $GJPCheck->check($gjp,$toAccountID); 17 | if($gjpresult != 1){ 18 | exit("-1"); 19 | } 20 | if(!isset($_POST["getSent"]) OR $_POST["getSent"] != 1){ 21 | $query = "SELECT * FROM messages WHERE toAccountID = :toAccountID ORDER BY messageID DESC LIMIT 10 OFFSET $offset"; 22 | $countquery = "SELECT count(*) FROM messages WHERE toAccountID = :toAccountID"; 23 | $getSent = 0; 24 | }else{ 25 | $query = "SELECT * FROM messages WHERE accID = :toAccountID ORDER BY messageID DESC LIMIT 10 OFFSET $offset"; 26 | $countquery = "SELECT count(*) FROM messages WHERE accID = :toAccountID"; 27 | $getSent = 1; 28 | } 29 | $query = $db->prepare($query); 30 | $query->execute([':toAccountID' => $toAccountID]); 31 | $result = $query->fetchAll(); 32 | $countquery = $db->prepare($countquery); 33 | $countquery->execute([':toAccountID' => $toAccountID]); 34 | $msgcount = $countquery->fetchColumn(); 35 | if($msgcount == 0){ 36 | exit("-2"); 37 | } 38 | foreach ($result as &$message1) { 39 | if($message1["messageID"]!=""){ 40 | $uploadDate = date("d/m/Y G.i", $message1["timestamp"]); 41 | if($getSent == 1){ 42 | $accountID = $message1["toAccountID"]; 43 | }else{ 44 | $accountID = $message1["accID"]; 45 | } 46 | $query=$db->prepare("SELECT * FROM users WHERE extID = :accountID"); 47 | $query->execute([':accountID' => $accountID]); 48 | $result12 = $query->fetchAll()[0]; 49 | $msgstring .= "6:".$result12["userName"].":3:".$result12["userID"].":2:".$result12["extID"].":1:".$message1["messageID"].":4:".$message1["subject"].":8:".$message1["isNew"].":9:".$getSent.":7:".$uploadDate."|"; 50 | } 51 | } 52 | $msgstring = substr($msgstring, 0, -1); 53 | echo $msgstring ."#".$msgcount.":".$offset.":10"; 54 | ?> -------------------------------------------------------------------------------- /include/messages/uploadGJMessage.php: -------------------------------------------------------------------------------- 1 | remove($_POST["gjp"]); 11 | $gameVersion = $ep->remove($_POST["gameVersion"]); 12 | $binaryVersion = $ep->remove($_POST["binaryVersion"]); 13 | $secret = $ep->remove($_POST["secret"]); 14 | $subject = $ep->remove($_POST["subject"]); 15 | $toAccountID = $ep->number($_POST["toAccountID"]); 16 | $body = $ep->remove($_POST["body"]); 17 | $accID = $ep->number($_POST["accountID"]); 18 | if($accID == $toAccountID){ 19 | exit("-1"); 20 | } 21 | $query3 = "SELECT userName FROM users WHERE extID = :accID ORDER BY userName DESC"; 22 | $query3 = $db->prepare($query3); 23 | $query3->execute([':accID' => $accID]); 24 | $userName = $query3->fetchColumn(); 25 | //continuing the accounts system 26 | $id = $ep->remove($_POST["accountID"]); 27 | $register = 1; 28 | $userID = $gs->getUserID($id); 29 | $uploadDate = time(); 30 | 31 | $blocked = $db->query("SELECT ID FROM `blocks` WHERE person1 = $toAccountID AND person2 = $accID")->fetchAll(PDO::FETCH_COLUMN); 32 | $mSOnly = $db->query("SELECT mS FROM `accounts` WHERE accountID = $toAccountID AND mS > 0")->fetchAll(PDO::FETCH_COLUMN); 33 | $friend = $db->query("SELECT ID FROM `friendships` WHERE (person1 = $accID AND person2 = $toAccountID) || (person2 = $accID AND person1 = $toAccountID)")->fetchAll(PDO::FETCH_COLUMN); 34 | 35 | $query = $db->prepare("INSERT INTO messages (subject, body, accID, userID, userName, toAccountID, secret, timestamp) 36 | VALUES (:subject, :body, :accID, :userID, :userName, :toAccountID, :secret, :uploadDate)"); 37 | 38 | $GJPCheck = new GJPCheck(); 39 | $gjpresult = $GJPCheck->check($gjp,$id); 40 | if (!empty($mSOnly[0]) and $mSOnly[0] == 2) { 41 | echo -1; 42 | } else { 43 | if ($gjpresult == 1 and empty($blocked[0]) and (empty($mSOnly[0]) || !empty($friend[0]))) { 44 | $query->execute([':subject' => $subject, ':body' => $body, ':accID' => $id, ':userID' => $userID, ':userName' => $userName, ':toAccountID' => $toAccountID, ':secret' => $secret, ':uploadDate' => $uploadDate]); 45 | echo 1; 46 | } else { 47 | echo -1; 48 | } 49 | } 50 | ?> -------------------------------------------------------------------------------- /include/misc/cp.php: -------------------------------------------------------------------------------- 1 | prepare("update users 5 | set creatorPoints = ( 6 | select COUNT(*) 7 | from levels 8 | where levels.userID = users.userID AND starStars != 0 9 | ) + ( 10 | select COUNT(*) 11 | from levels 12 | where levels.userID = users.userID AND levels.starFeatured != 0 AND levels.starEpic = 0 13 | ) + ( 14 | select COUNT(*) 15 | from levels 16 | where levels.userID = users.userID AND levels.starEpic = 1 AND levels.starFeatured = 0 17 | ) + ( 18 | select COUNT(*) 19 | from levels 20 | where levels.userID = users.userID AND levels.starEpic = 1 AND levels.starFeatured = 0 21 | ) + ( 22 | select COUNT(*) 23 | from levels 24 | where levels.userID = users.userID AND levels.starEpic = 1 AND levels.starFeatured = 1 25 | ) + ( 26 | select COUNT(*) 27 | from levels 28 | where levels.userID = users.userID AND levels.starEpic = 1 AND levels.starFeatured = 1 29 | )"); 30 | $query->execute(); 31 | ?> 32 | -------------------------------------------------------------------------------- /include/misc/getAccountURL.php: -------------------------------------------------------------------------------- 1 | remove($_POST["songID"]); 12 | $query3=$db->prepare("SELECT ID,name,authorID,authorName,size,isDisabled,download FROM songs WHERE ID = :songid LIMIT 1"); 13 | $query3->execute([':songid' => $songid]); 14 | if($query3->rowCount() == 0) { 15 | if ($songid > 5000000) exit("-1"); //this is custom music, if do not exit they will to take a long time 16 | //fixed by WOSHIZHAZHA120 17 | $url = 'http://www.boomlings.com/database/getGJSongInfo.php'; 18 | $data = array('songID' => $songid, 'secret' => 'Wmfd2893gb7'); 19 | $options = array( 20 | 'http' => array( 21 | 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 22 | 'method' => 'POST', 23 | 'content' => http_build_query($data), 24 | ), 25 | ); 26 | $context = stream_context_create($options); 27 | $result = file_get_contents($url, false, $context); 28 | if ($result == "-2" OR $result == "-1" OR $result == "") { 29 | $url = 'http://www.boomlings.com/database/getGJLevels21.php'; 30 | $data = array( 31 | 'gameVersion' => '21', 32 | 'binaryVersion' => '33', 33 | 'gdw' => '0', 34 | 'type' => '2', 35 | 'str' => '', 36 | 'diff' => '-', 37 | 'len' => '-', 38 | 'page' => '0', 39 | 'total' => '9999', 40 | 'uncompleted' => '0', 41 | 'onlyCompleted' => '0', 42 | 'featured' => '0', 43 | 'original' => '0', 44 | 'twoPlayer' => '0', 45 | 'coins' => '0', 46 | 'epic' => '0', 47 | 'song' => $songid, 48 | 'customSong' => '1', 49 | 'secret' => 'Wmfd2893gb7' 50 | ); 51 | 52 | $ch = curl_init($url); 53 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 54 | curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 55 | $result = curl_exec($ch); 56 | curl_close($ch); 57 | if(substr_count($result, "1~|~".$songid."~|~2") != 0){ 58 | $result = explode('#',$result)[2]; 59 | }else{ 60 | $ch = curl_init(); 61 | curl_setopt($ch, CURLOPT_URL, "https://www.newgrounds.com/audio/listen/".$songid); 62 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 63 | $songinfo = curl_exec($ch); 64 | curl_close($ch); 65 | if(empty(explode('"url":"', $songinfo)[1])){ 66 | exit("-1"); 67 | } 68 | $songurl = explode('","', explode('"url":"', $songinfo)[1])[0]; 69 | $songauthor = explode('","', explode('artist":"', $songinfo)[1])[0]; 70 | $songurl = str_replace("\/", "/", $songurl); 71 | $songname = explode("", explode("", $songinfo)[0])[1]; 72 | if($songurl == ""){ 73 | exit("-1"); 74 | } 75 | $result = "1~|~".$songid."~|~2~|~".$songname."~|~3~|~1234~|~4~|~".$songauthor."~|~5~|~6.69~|~6~|~~|~10~|~".$songurl."~|~7~|~~|~8~|~1"; 76 | } 77 | } 78 | echo $result; 79 | $reup = $songReup->reup($result); 80 | }else{ 81 | $result4 = $query3->fetch(); 82 | if($result4["isDisabled"] == 1){ 83 | exit("-2"); 84 | } 85 | $dl = $result4["download"]; 86 | if(strpos($dl, ':') !== false){ 87 | $dl = urlencode($dl); 88 | } 89 | echo "1~|~".$result4["ID"]."~|~2~|~".$result4["name"]."~|~3~|~".$result4["authorID"]."~|~4~|~".$result4["authorName"]."~|~5~|~".$result4["size"]."~|~6~|~~|~10~|~".$dl."~|~7~|~~|~8~|~0"; 90 | } 91 | ?> 92 | -------------------------------------------------------------------------------- /include/misc/getTopArtists.php: -------------------------------------------------------------------------------- 1 | number($_POST["page"]) . "0"; 11 | $offset = $offset*2; // ask robtop 12 | }else{ 13 | $offset = 0; 14 | } 15 | 16 | 17 | if($redirect == 1) { 18 | // send result 19 | $url = "http://boomlings.com/database/getGJTopArtists.php"; 20 | $request = "page=$offset&secret=Wmfd2893gb7"; 21 | parse_str($request, $post); 22 | // post 23 | $ch = curl_init($url); 24 | curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 25 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 26 | $robsult = curl_exec($ch); 27 | curl_close($ch); 28 | echo $robsult; 29 | } else { 30 | // select 31 | $querywhat = "SELECT authorName, download FROM songs WHERE (authorName NOT LIKE '%Reupload%' AND authorName NOT LIKE 'unknown') GROUP BY authorName ORDER BY COUNT(authorName) DESC LIMIT 20 OFFSET $offset"; // offset couldn't be used in prepare statement for some very odd reason 32 | $query = $db->prepare($querywhat); 33 | $query->execute(); 34 | $res = $query->fetchAll(); 35 | // count 36 | $countquery = $db->prepare("SELECT count(DISTINCT(authorName)) FROM songs WHERE (authorName NOT LIKE '%Reupload%' AND authorName NOT LIKE 'unknown')"); 37 | $countquery->execute(); 38 | $totalCount = $countquery->fetchColumn(); 39 | // parse 40 | foreach($res as $sel){ 41 | $str .= "4:$sel[0]"; 42 | // TO-DO: Fetch YouTube links from RobTop's servers, as we are unable to auto-determine YouTube links. 43 | // Also credit to @Intelligent-Cat for this piece of code 44 | if (substr($sel[1], 0, 26) == "https://api.soundcloud.com") { 45 | if (strpos(urlencode($sel[0]), '+' ) !== false) { 46 | $str .= ":7:../redirect?q=https%3A%2F%2Fsoundcloud.com%2Fsearch%2Fpeople?q=$sel[0]"; 47 | // search is used instead of directly redirecting the user due to how user links work with spaces in them 48 | } else { 49 | $str .= ":7:../redirect?q=https%3A%2F%2Fsoundcloud.com%2F$sel[0]"; 50 | // unlikely to hit a different account if there are multiple users with the same name. 51 | } 52 | } 53 | $str .= "|"; 54 | } 55 | $str = rtrim($str, "|"); 56 | $str .= "#$totalCount:$offset:20"; 57 | // send result 58 | echo "$str"; 59 | } 60 | ?> 61 | -------------------------------------------------------------------------------- /include/misc/likeGJItem.php: -------------------------------------------------------------------------------- 1 | getIP(); 10 | $itemID = $ep->remove($_POST["itemID"]); 11 | $query6 = $db->prepare("SELECT count(*) FROM actions WHERE type=:type AND value=:itemID AND value2=:ip"); 12 | $query6->execute([':type' => $type, ':itemID' => $itemID, ':ip' => $ip]); 13 | if($query6->fetchColumn() > 2){ 14 | exit("-1"); 15 | } 16 | $query6 = $db->prepare("INSERT INTO actions (type, value, timestamp, value2) VALUES 17 | (:type,:itemID, :time, :ip)"); 18 | $query6->execute([':type' => $type, ':itemID' => $itemID, ':time' => time(), ':ip' => $ip]); 19 | switch($_POST["type"]){ 20 | case 1: 21 | $table = "levels"; 22 | $column = "levelID"; 23 | break; 24 | case 2: 25 | $table = "comments"; 26 | $column = "commentID"; 27 | break; 28 | case 3: 29 | $table = "acccomments"; 30 | $column = "commentID"; 31 | break; 32 | } 33 | $query=$db->prepare("SELECT likes FROM $table WHERE $column = :itemID LIMIT 1"); 34 | $query->execute([':itemID' => $itemID]); 35 | $likes = $query->fetchColumn(); 36 | if($_POST["like"]==1){ 37 | $likes++; 38 | }else{ 39 | $likes--; 40 | } 41 | $query2=$db->prepare("UPDATE $table SET likes = :likes WHERE $column = :itemID"); 42 | $query2->execute([':itemID' => $itemID, ':likes' => $likes]); 43 | echo "1"; 44 | ?> -------------------------------------------------------------------------------- /include/mods/requestUserAccess.php: -------------------------------------------------------------------------------- 1 | remove($_POST["gjp"]); 10 | $accountID = $ep->remove($_POST["accountID"]); 11 | 12 | if($accountID != "" AND $gjp != ""){ 13 | $GJPCheck = new GJPCheck(); 14 | $gjpresult = $GJPCheck->check($gjp,$accountID); 15 | if($gjpresult == 1){ 16 | if ($gs->getMaxValuePermission($accountID,"actionRequestMod") == 1) { 17 | $permState = $gs->getMaxValuePermission($accountID,"modBadgeLevel"); 18 | if ($permState >= 2){ 19 | exit("2"); 20 | } 21 | echo $permState; 22 | } 23 | } else { 24 | echo -1; 25 | } 26 | } else { 27 | echo -1; 28 | } 29 | ?> 30 | -------------------------------------------------------------------------------- /include/profiles/getGJUsers.php: -------------------------------------------------------------------------------- 1 | remove($_POST["str"]); 7 | $page = $ep->remove($_POST["page"]); 8 | $userstring = ""; 9 | $usrpagea = $page*10; 10 | $query = "SELECT userName, userID, coins, userCoins, icon, color1, color2, iconType, special, extID, stars, creatorPoints, demons FROM users WHERE userID = :str OR userName LIKE CONCAT('%', :str, '%') ORDER BY stars DESC LIMIT 10 OFFSET $usrpagea"; 11 | $query = $db->prepare($query); 12 | $query->execute([':str' => $str]); 13 | $result = $query->fetchAll(); 14 | if(count($result) < 1){ 15 | exit("-1"); 16 | } 17 | $countquery = "SELECT count(*) FROM users WHERE userName LIKE CONCAT('%', :str, '%')"; 18 | $countquery = $db->prepare($countquery); 19 | $countquery->execute([':str' => $str]); 20 | $usercount = $countquery->fetchColumn(); 21 | foreach($result as &$user){ 22 | $userstring .= "1:".$user["userName"].":2:".$user["userID"].":13:".$user["coins"].":17:".$user["userCoins"].":9:".$user["icon"].":10:".$user["color1"].":11:".$user["color2"].":14:".$user["iconType"].":15:".$user["special"].":16:".$user["extID"].":3:".$user["stars"].":8:".round($user["creatorPoints"],0,PHP_ROUND_HALF_DOWN).":4:".$user["demons"]."|"; 23 | } 24 | $userstring = substr($userstring, 0, -1); 25 | echo $userstring; 26 | echo "#".$usercount.":".$usrpagea.":10"; 27 | ?> -------------------------------------------------------------------------------- /include/profiles/updateGJAccSettings.php: -------------------------------------------------------------------------------- 1 | remove($_POST["mS"]); 10 | $frS = $ep->remove($_POST["frS"]); 11 | $cS = $ep->remove($_POST["cS"]); 12 | $youtubeurl = $ep->remove($_POST["yt"]); 13 | $gjp = $ep->remove($_POST["gjp"]); 14 | $accountID = $ep->remove($_POST["accountID"]); 15 | $twitter = $ep->remove($_POST["twitter"]); 16 | $twitch = $ep->remove($_POST["twitch"]); 17 | //query 18 | $query = $db->prepare("UPDATE accounts SET mS=:mS, frS=:frS, cS=:cS, youtubeurl=:youtubeurl, twitter=:twitter, twitch=:twitch WHERE accountID=:accountID"); 19 | $GJPCheck = new GJPCheck(); 20 | $gjpresult = $GJPCheck->check($gjp,$accountID); 21 | if($gjpresult == 1){ 22 | $query->execute([':mS' => $mS, ':frS' => $frS, ':cS' => $cS, ':youtubeurl' => $youtubeurl, ':accountID' => $accountID, ':twitch' => $twitch, ':twitter' => $twitter]); 23 | echo 1; 24 | }else{ 25 | echo -1; 26 | } 27 | ?> -------------------------------------------------------------------------------- /include/relationships/acceptGJFriendRequest.php: -------------------------------------------------------------------------------- 1 | remove($_POST["accountID"]); 11 | $gjp = $ep->remove($_POST["gjp"]); 12 | $requestID = $ep->remove($_POST["requestID"]); 13 | $GJPCheck = new GJPCheck(); 14 | $gjpresult = $GJPCheck->check($gjp,$accountID); 15 | if($gjpresult == 1){ 16 | // ACCEPTING FOR USER 2 17 | $query = $db->prepare("SELECT accountID, toAccountID FROM friendreqs WHERE ID = :requestID"); 18 | $query->execute([':requestID' => $requestID]); 19 | $request = $query->fetch(); 20 | $reqAccountID = $request["accountID"]; 21 | $toAccountID = $request["toAccountID"]; 22 | if($toAccountID != $accountID OR $reqAccountID == $accountID){ 23 | exit("-1"); 24 | } 25 | $query = $db->prepare("INSERT INTO friendships (person1, person2, isNew1, isNew2) 26 | VALUES (:accountID, :targetAccountID, 1, 1)"); 27 | 28 | $query->execute([':accountID' => $reqAccountID, ':targetAccountID' => $toAccountID]); 29 | //REMOVING THE REQUEST 30 | $query = $db->prepare("DELETE from friendreqs WHERE ID=:requestID LIMIT 1"); 31 | $query->execute([':requestID' => $requestID]); 32 | //RESPONSE SO IT DOESNT SAY "FAILED" 33 | echo "1"; 34 | }else{ 35 | echo "-1"; 36 | } 37 | ?> -------------------------------------------------------------------------------- /include/relationships/blockGJUser.php: -------------------------------------------------------------------------------- 1 | remove($_POST["accountID"]); 11 | $gjp = $ep->remove($_POST["gjp"]); 12 | $targetAccountID = $ep->remove($_POST["targetAccountID"]); 13 | if($accountID == $targetAccountID){ 14 | exit("-1"); 15 | } 16 | //GJPCheck 17 | $GJPCheck = new GJPCheck(); 18 | $gjpresult = $GJPCheck->check($gjp,$accountID); 19 | if($gjpresult == 1){ 20 | $query = $db->prepare("INSERT INTO blocks (person1, person2) VALUES (:accountID, :targetAccountID)"); 21 | $query->execute([':accountID' => $accountID, ':targetAccountID' => $targetAccountID]); 22 | echo 1; 23 | }else{ 24 | echo -1; 25 | } 26 | }else{ 27 | echo -1; 28 | } 29 | ?> -------------------------------------------------------------------------------- /include/relationships/deleteGJFriendRequests.php: -------------------------------------------------------------------------------- 1 | remove($_POST["gjp"]); 11 | $accountID = $ep->remove($_POST["accountID"]); 12 | $targetAccountID = $ep->remove($_POST["targetAccountID"]); 13 | //REMOVING THE REQUEST 14 | if(!empty($_POST["isSender"]) AND $_POST["isSender"] == 1){ 15 | $query = $db->prepare("DELETE from friendreqs WHERE accountID=:accountID AND toAccountID=:targetAccountID LIMIT 1"); 16 | }else{ 17 | $query = $db->prepare("DELETE from friendreqs WHERE toAccountID=:accountID AND accountID=:targetAccountID LIMIT 1"); 18 | } 19 | $GJPCheck = new GJPCheck(); 20 | $gjpresult = $GJPCheck->check($gjp,$accountID); 21 | if($gjpresult == 1){ 22 | $query->execute([':accountID' => $accountID, ':targetAccountID' => $targetAccountID]); 23 | //RESPONSE SO IT DOESNT SAY "FAILED" 24 | echo "1"; 25 | }else{ 26 | //OR YOU KNOW WHAT LETS MAKE IT SAY "FAILED" 27 | echo "-1"; 28 | } 29 | ?> -------------------------------------------------------------------------------- /include/relationships/getGJFriendRequests.php: -------------------------------------------------------------------------------- 1 | remove($_POST["getSent"]); 11 | }else{ 12 | $getSent = 0; 13 | } 14 | if(empty($_POST["accountID"]) OR (!isset($_POST["page"]) OR !is_numeric($_POST["page"])) OR empty($_POST["gjp"])){ 15 | exit("-1"); 16 | } 17 | $accountID = $ep->remove($_POST["accountID"]); 18 | $page = $ep->remove($_POST["page"]); 19 | $gjp = $ep->remove($_POST["gjp"]); 20 | $gjpresult = $GJPCheck->check($gjp,$accountID); 21 | if($gjpresult != 1){ 22 | exit("-1"); 23 | } 24 | $offset = $page*10; 25 | if($getSent == 0){ 26 | $query = "SELECT accountID, toAccountID, uploadDate, ID, comment, isNew FROM friendreqs WHERE toAccountID = :accountID LIMIT 10 OFFSET $offset"; 27 | $countquery = "SELECT count(*) FROM friendreqs WHERE toAccountID = :accountID"; 28 | }else if($getSent == 1){ 29 | $query = "SELECT * FROM friendreqs WHERE accountID = :accountID LIMIT 10 OFFSET $offset"; 30 | $countquery = "SELECT count(*) FROM friendreqs WHERE accountID = :accountID"; 31 | } 32 | $query = $db->prepare($query); 33 | $query->execute([':accountID' => $accountID]); 34 | $result = $query->fetchAll(); 35 | $countquery = $db->prepare($countquery); 36 | $countquery->execute([':accountID' => $accountID]); 37 | $reqcount = $countquery->fetchColumn(); 38 | if($reqcount == 0){ 39 | exit("-2"); 40 | } 41 | foreach($result as &$request) { 42 | if($getSent == 0){ 43 | $requester = $request["accountID"]; 44 | }else if($getSent == 1){ 45 | $requester = $request["toAccountID"]; 46 | } 47 | $query = "SELECT userName, userID, icon, color1, color2, iconType, special, extID FROM users WHERE extID = :requester"; 48 | $query = $db->prepare($query); 49 | $query->execute([':requester' => $requester]); 50 | $result2 = $query->fetchAll(); 51 | $user = $result2[0]; 52 | $uploadTime = date("d/m/Y G.i", $request["uploadDate"]); 53 | if(is_numeric($user["extID"])){ 54 | $extid = $user["extID"]; 55 | }else{ 56 | $extid = 0; 57 | } 58 | $reqstring .= "1:".$user["userName"].":2:".$user["userID"].":9:".$user["icon"].":10:".$user["color1"].":11:".$user["color2"].":14:".$user["iconType"].":15:".$user["special"].":16:".$extid.":32:".$request["ID"].":35:".$request["comment"].":41:".$request["isNew"].":37:".$uploadTime."|"; 59 | 60 | } 61 | $reqstring = substr($reqstring, 0, -1); 62 | echo $reqstring; 63 | echo "#".$reqcount.":".$offset.":10"; 64 | ?> -------------------------------------------------------------------------------- /include/relationships/getGJUserList.php: -------------------------------------------------------------------------------- 1 | remove($_POST["accountID"]); 12 | $gjp = $ep->remove($_POST["gjp"]); 13 | $type = $ep->remove($_POST["type"]); 14 | $people = ""; 15 | $peoplestring = ""; 16 | $gjpresult = $GJPCheck->check($gjp,$accountID); 17 | $new = array(); 18 | if($gjpresult != 1){ 19 | exit("-1"); 20 | } 21 | if($type == 0){ 22 | $query = "SELECT person1,isNew1,person2,isNew2 FROM friendships WHERE person1 = :accountID OR person2 = :accountID"; 23 | }else if($type==1){ 24 | $query = "SELECT person1,person2 FROM blocks WHERE person1 = :accountID"; 25 | } 26 | $query = $db->prepare($query); 27 | $query->execute([':accountID' => $accountID]); 28 | $result = $query->fetchAll(); 29 | if($query->rowCount() == 0){ 30 | echo "-2"; 31 | } 32 | else 33 | { 34 | foreach ($result as &$friendship) { 35 | $person = $friendship["person1"]; 36 | $isnew = $friendship["isNew1"]; 37 | if($friendship["person1"] == $accountID){ 38 | $person = $friendship["person2"]; 39 | $isnew = $friendship["isNew2"]; 40 | } 41 | $new[$person] = $isnew; 42 | $people .= $person . ","; 43 | } 44 | $people = substr($people, 0,-1); 45 | $query = $db->prepare("SELECT userName, userID, icon, color1, color2, iconType, special, extID FROM users WHERE extID IN ($people) ORDER BY userName ASC"); 46 | $query->execute(); 47 | $result = $query->fetchAll(); 48 | foreach($result as &$user){ 49 | $peoplestring .= "1:".$user["userName"].":2:".$user["userID"].":9:".$user["icon"].":10:".$user["color1"].":11:".$user["color2"].":14:".$user["iconType"].":15:".$user["special"].":16:".$user["extID"].":18:0:41:".$new[$user["extID"]]."|"; 50 | } 51 | $peoplestring = substr($peoplestring, 0, -1); 52 | $query = $db->prepare("UPDATE friendships SET isNew1 = '0' WHERE person2 = :me"); 53 | $query->execute([':me' => $accountID]); 54 | $query = $db->prepare("UPDATE friendships SET isNew2 = '0' WHERE person1 = :me"); 55 | $query->execute([':me' => $accountID]); 56 | if($peoplestring == ""){ 57 | exit("-1"); 58 | } 59 | echo $peoplestring; 60 | } 61 | ?> -------------------------------------------------------------------------------- /include/relationships/readGJFriendRequest.php: -------------------------------------------------------------------------------- 1 | remove($_POST["accountID"]); 11 | $gjp = $ep->remove($_POST["gjp"]); 12 | $requestID = $ep->remove($_POST["requestID"]); 13 | $GJPCheck = new GJPCheck(); 14 | $gjpresult = $GJPCheck->check($gjp,$accountID); 15 | if($gjpresult == 1){ 16 | $query=$db->prepare("UPDATE friendreqs SET isNew='0' WHERE ID = :requestID AND toAccountID = :targetAcc"); 17 | $query->execute([':requestID' => $requestID, ':targetAcc' => $accountID]); 18 | echo "-1"; 19 | }else{ 20 | echo "-1"; 21 | } 22 | ?> -------------------------------------------------------------------------------- /include/relationships/removeGJFriend.php: -------------------------------------------------------------------------------- 1 | remove($_POST["accountID"]); 8 | $gjp = $ep->remove($_POST["gjp"]); 9 | $targetAccountID = $ep->remove($_POST["targetAccountID"]); 10 | // REMOVING FOR USER 1 11 | $query = "DELETE FROM friendships WHERE person1 = :accountID AND person2 = :targetAccountID"; 12 | $query = $db->prepare($query); 13 | $query2 = "DELETE FROM friendships WHERE person2 = :accountID AND person1 = :targetAccountID"; 14 | $query2 = $db->prepare($query2); 15 | //EXECUTING THE QUERIES 16 | $GJPCheck = new GJPCheck(); 17 | $gjpresult = $GJPCheck->check($gjp,$accountID); 18 | if($gjpresult == 1){ 19 | $query->execute([':accountID' => $accountID, ':targetAccountID' => $targetAccountID]); 20 | $query2->execute([':accountID' => $accountID, ':targetAccountID' => $targetAccountID]); 21 | echo "1"; 22 | }else{ 23 | echo "-1"; 24 | } 25 | ?> -------------------------------------------------------------------------------- /include/relationships/unblockGJUser.php: -------------------------------------------------------------------------------- 1 | remove($_POST["accountID"]); //249 - maincra 8 | $gjp = $ep->remove($_POST["gjp"]); 9 | $targetAccountID = $ep->remove($_POST["targetAccountID"]); //250 - tomasek 10 | // REMOVING FOR USER 1 11 | $query = "DELETE FROM blocks WHERE person1 = :accountID AND person2 = :targetAccountID"; 12 | $query = $db->prepare($query); 13 | //EXECUTING THE QUERIES 14 | $GJPCheck = new GJPCheck(); 15 | $gjpresult = $GJPCheck->check($gjp,$accountID); 16 | if($gjpresult == 1){ 17 | $query->execute([':accountID' => $accountID, ':targetAccountID' => $targetAccountID]); 18 | echo "1"; 19 | }else{ 20 | echo "-1"; 21 | } 22 | ?> -------------------------------------------------------------------------------- /include/relationships/uploadFriendRequest.php: -------------------------------------------------------------------------------- 1 | number($_POST["accountID"]); 13 | $gjp = $ep->remove($_POST["gjp"]); 14 | $toAccountID = $ep->number($_POST["toAccountID"]); 15 | if ($toAccountID == $accountID) { 16 | exit("-1"); 17 | } 18 | $comment = $ep->remove($_POST["comment"]); 19 | $uploadDate = time(); 20 | $blocked = $db->query("SELECT ID FROM `blocks` WHERE person1 = $toAccountID AND person2 = $accountID")->fetchAll(PDO::FETCH_COLUMN); 21 | $frSOnly = $db->query("SELECT frS FROM `accounts` WHERE accountID = $toAccountID AND frS = 1")->fetchAll(PDO::FETCH_COLUMN); 22 | $query = $db->prepare("SELECT count(*) FROM friendreqs WHERE (accountID=:accountID AND toAccountID=:toAccountID) OR (toAccountID=:accountID AND accountID=:toAccountID)"); 23 | $query->execute([':accountID' => $accountID, ':toAccountID' => $toAccountID]); 24 | if($query->fetchColumn() == 0){ 25 | //GJPCheck 26 | $GJPCheck = new GJPCheck(); 27 | $gjpresult = $GJPCheck->check($gjp,$accountID); 28 | if($gjpresult == 1 and empty($blocked[0]) and empty($frSOnly[0])){ 29 | $query = $db->prepare("INSERT INTO friendreqs (accountID, toAccountID, comment, uploadDate) 30 | VALUES (:accountID, :toAccountID, :comment, :uploadDate)"); 31 | $query->execute([':accountID' => $accountID, ':toAccountID' => $toAccountID, ':comment' => $comment, ':uploadDate' => $uploadDate]); 32 | echo 1; 33 | }else{ 34 | echo -1; 35 | } 36 | }else{ 37 | echo -1; 38 | } 39 | ?> -------------------------------------------------------------------------------- /include/rewards/getGJChallenges.php: -------------------------------------------------------------------------------- 1 | remove($_POST["accountID"]); 14 | $udid = $ep->remove($_POST["udid"]); 15 | if(is_numeric($udid)){ 16 | exit("-1"); 17 | } 18 | $chk = $ep->remove($_POST["chk"]); 19 | if($accountID != 0){ 20 | $userID = $gs->getUserID($accountID); 21 | }else{ 22 | $userID = $gs->getUserID($udid); 23 | } 24 | $chk = $XORCipher->cipher(base64_decode(substr($chk, 5)),19847); 25 | //Generating quest IDs 26 | $from = strtotime('2000-12-17'); 27 | $today = time(); 28 | $difference = $today - $from; 29 | $questID = floor($difference / 86400); 30 | $questID = $questID * 3; 31 | $quest1ID = $questID; 32 | $quest2ID = $questID+1; 33 | $quest3ID = $questID+2; 34 | //Time left 35 | $midnight = strtotime("tomorrow 00:00:00"); 36 | $current = time(); 37 | $timeleft = $midnight - $current; 38 | $query=$db->prepare("SELECT type,amount,reward,name FROM quests"); 39 | $query->execute(); 40 | $result = $query->fetchAll(); 41 | //var_dump($result); 42 | shuffle($result); 43 | //var_dump($result); 44 | //quests 45 | if (empty($result[0]) || empty($result[1]) || empty($result[2])) { 46 | exit("-1"); 47 | } 48 | $quest1 = $quest1ID.",".$result[0]["type"].",".$result[0]["amount"].",".$result[0]["reward"].",".$result[0]["name"].""; 49 | $quest2 = $quest2ID.",".$result[1]["type"].",".$result[1]["amount"].",".$result[1]["reward"].",".$result[1]["name"].""; 50 | $quest3 = $quest3ID.",".$result[2]["type"].",".$result[2]["amount"].",".$result[2]["reward"].",".$result[2]["name"].""; 51 | $string = base64_encode($XORCipher->cipher("SaKuJ:".$userID.":".$chk.":".$udid.":".$accountID.":".$timeleft.":".$quest1.":".$quest2.":".$quest3."",19847)); 52 | $hash = $generateHash->genSolo3($string); 53 | echo "SaKuJ".$string . "|".$hash; 54 | ?> 55 | -------------------------------------------------------------------------------- /include/rewards/getGJRewards.php: -------------------------------------------------------------------------------- 1 | remove($_POST["accountID"]); 13 | $udid = $ep->remove($_POST["udid"]); 14 | if(is_numeric($udid)){ 15 | exit("-1"); 16 | } 17 | $chk = $ep->remove($_POST["chk"]); 18 | $gjp = $ep->remove($_POST["gjp"]); 19 | $rewardType = $ep->remove($_POST["rewardType"]); 20 | $GJPCheck = new GJPCheck(); 21 | $gjpresult = $GJPCheck->check($gjp,$accountID); 22 | if($gjpresult !== 1 AND $accountID !== 0){ 23 | exit("-1"); 24 | } 25 | $query=$db->prepare("select * from users where extID = ?"); 26 | if($accountID != 0){ 27 | $query->execute(array($accountID)); 28 | $register = 1; 29 | }else{ 30 | $query->execute(array($udid)); 31 | $register = 0; 32 | } 33 | $result = $query->fetchAll(); 34 | if ($query->rowCount() == 0) { 35 | $query = $db->prepare("INSERT INTO users (isRegistered, extID) 36 | VALUES (:register,:id)"); 37 | $query->execute([':register' => $register, ':id' => $id]); 38 | $query=$db->prepare("select * from users where extID = ?"); 39 | if($accountID != 0){ 40 | $query->execute(array($accountID)); 41 | $register = 1; 42 | }else{ 43 | $query->execute(array($udid)); 44 | $register = 0; 45 | } 46 | $result = $query->fetchAll(); 47 | } 48 | $user = $result[0]; 49 | $userid = $user["userID"]; 50 | $chk = $XORCipher->cipher(base64_decode(substr($chk, 5)),59182); 51 | //rewards 52 | //Time left 53 | $currenttime = time(); 54 | $currenttime = $currenttime + 100; 55 | $chest1time = $user["chest1time"]; 56 | $chest1count = $user["chest1count"]; 57 | $chest2count = $user["chest2count"]; 58 | $chest2time = $user["chest2time"]; 59 | $chest1diff = $currenttime - $chest1time; 60 | $chest2diff = $currenttime - $chest2time; 61 | //stuff 62 | $chest1stuff = rand($chest1minOrbs, $chest1maxOrbs).",".rand($chest1minDiamonds, $chest1maxDiamonds).",".rand($chest1minShards, $chest1maxShards).",".rand($chest1minKeys, $chest1maxKeys).""; 63 | $chest2stuff = rand($chest2minOrbs, $chest2maxOrbs).",".rand($chest2minDiamonds, $chest2maxDiamonds).",".rand($chest2minShards, $chest2maxShards).",".rand($chest2minKeys, $chest2maxKeys).""; 64 | //echo $chest1diff ."sakujesvole".$chest2diff; 65 | $chest1left = max(0,$chest1wait - $chest1diff); 66 | $chest2left = max(0,$chest2wait - $chest2diff); 67 | //reward claiming 68 | if($rewardType == 1){ 69 | if($chest1left != 0){ 70 | exit("-1"); 71 | } 72 | $chest1count++; 73 | $query = $db->prepare("UPDATE users SET chest1count=:chest1count, chest1time=:currenttime WHERE userID=:userID"); 74 | $query->execute([':chest1count' => $chest1count, ':userID' => $userid, ':currenttime' => $currenttime]); 75 | $chest1left = $chest1wait; 76 | } 77 | if($rewardType == 2){ 78 | if($chest2left != 0){ 79 | exit("-1"); 80 | } 81 | $chest2count++; 82 | $query = $db->prepare("UPDATE users SET chest2count=:chest2count, chest2time=:currenttime WHERE userID=:userID"); 83 | $query->execute([':chest2count' => $chest2count, ':userID' => $userid, ':currenttime' => $currenttime]); 84 | $chest2left = $chest2wait; 85 | } 86 | $string = base64_encode($XORCipher->cipher("1:".$userid.":".$chk.":".$udid.":".$accountID.":".$chest1left.":".$chest1stuff.":".$chest1count.":".$chest2left.":".$chest2stuff.":".$chest2count.":".$rewardType."",59182)); 87 | $string = str_replace("/","_",$string); 88 | $string = str_replace("+","-",$string); 89 | $hash = $generateHash->genSolo4($string); 90 | echo "SaKuJ".$string . "|".$hash; 91 | ?> 92 | -------------------------------------------------------------------------------- /include/scores/autoban.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT COUNT(starDemon) FROM levels WHERE starDemon = 1"); 10 | $query->execute(); 11 | $demons = $demons + $query->fetchColumn(); 12 | 13 | $query = $db->prepare("SELECT * FROM dailyfeatures"); 14 | $query->execute(); 15 | $result = $query->fetchAll(); 16 | foreach($result as $a){ 17 | $querys = $db->prepare("SELECT starStars FROM levels WHERE levelID = ".$a["levelID"]); 18 | $querys->execute(); 19 | $stars = $stars + $querys->fetchColumn(); 20 | } 21 | $query = $db->prepare("SELECT SUM(stars) FROM mappacks"); 22 | $query->execute(); 23 | $stars = $stars + $query->fetchColumn(); 24 | 25 | $query = $db->prepare("SELECT SUM(starStars) FROM levels"); 26 | $query->execute(); 27 | $stars = $stars + $query->fetchColumn(); 28 | $query = $db->prepare("UPDATE users SET isBanned = 1 WHERE stars > $stars"); 29 | $query->execute(); 30 | 31 | $query = $db->prepare("SELECT SUM(coins) FROM mappacks"); 32 | $query->execute(); 33 | $coins = $coins + $query->fetchColumn(); 34 | 35 | $query = $db->prepare("SELECT SUM(coins) FROM levels"); 36 | $query->execute(); 37 | $pc = $query->fetchColumn(); 38 | 39 | $query = $db->prepare("SELECT * FROM gauntlets"); 40 | $query->execute(); 41 | $result = $query->fetchAll(); 42 | foreach($result as $a){ 43 | $querys = $db->prepare("SELECT starStars FROM levels WHERE levelID = ".$a["level1"]); 44 | $querys->execute(); 45 | $stars = $stars + $querys->fetchColumn(); 46 | } 47 | 48 | $query = $db->prepare("SELECT * FROM gauntlets"); 49 | $query->execute(); 50 | $result = $query->fetchAll(); 51 | foreach($result as $a){ 52 | $querys = $db->prepare("SELECT starStars FROM levels WHERE levelID = ".$a["level5"]); 53 | $querys->execute(); 54 | $stars = $stars + $querys->fetchColumn(); 55 | } 56 | 57 | $query = $db->prepare("SELECT * FROM gauntlets"); 58 | $query->execute(); 59 | $result = $query->fetchAll(); 60 | foreach($result as $a){ 61 | $querys = $db->prepare("SELECT starStars FROM levels WHERE levelID = ".$a["level4"]); 62 | $querys->execute(); 63 | $stars = $stars + $querys->fetchColumn(); 64 | } 65 | 66 | $query = $db->prepare("SELECT * FROM gauntlets"); 67 | $query->execute(); 68 | $result = $query->fetchAll(); 69 | foreach($result as $a){ 70 | $querys = $db->prepare("SELECT starStars FROM levels WHERE levelID = ".$a["level3"]); 71 | $querys->execute(); 72 | $stars = $stars + $querys->fetchColumn(); 73 | } 74 | 75 | $query = $db->prepare("SELECT * FROM gauntlets"); 76 | $query->execute(); 77 | $result = $query->fetchAll(); 78 | foreach($result as $a){ 79 | $querys = $db->prepare("SELECT starStars FROM levels WHERE levelID = ".$a["level2"]); 80 | $querys->execute(); 81 | $stars = $stars + $querys->fetchColumn(); 82 | } 83 | 84 | $query = $db->prepare("UPDATE users SET isBanned = 1 WHERE stars > $stars OR demons > $demons OR coins > $coins OR userCoins > $pc"); 85 | $query->execute(); 86 | $query = $db->prepare("UPDATE users SET isBanned = 1 WHERE stars < 0 OR coins < 0 OR userCoins < 0"); 87 | $query->execute(); 88 | ?> 89 | -------------------------------------------------------------------------------- /include/scores/getGDPSUserBan.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT isBanned FROM users WHERE userID=:userID LIMIT 1"); //getting differences 16 | $query->execute([':userID' => $userID]); 17 | $old = $query->fetch(); 18 | echo $userID; 19 | ?> -------------------------------------------------------------------------------- /include/scores/getGJCreators.php: -------------------------------------------------------------------------------- 1 | remove($_POST["accountID"]); 8 | $type = $ep->remove($_POST["type"]); 9 | $query = "SELECT * FROM users WHERE isCreatorBanned = '0' ORDER BY creatorPoints DESC LIMIT 100"; 10 | $query = $db->prepare($query); 11 | $query->execute([':stars' => $stars, ':count' => $count]); 12 | $result = $query->fetchAll(); 13 | foreach($result as &$user){ 14 | if(is_numeric($user["extID"])){ 15 | $extid = $user["extID"]; 16 | }else{ 17 | $extid = 0; 18 | } 19 | $xi++; 20 | $pplstring .= "1:".$user["userName"].":2:".$user["userID"].":13:".$user["coins"].":17:".$user["userCoins"].":6:".$xi.":9:".$user["icon"].":10:".$user["color1"].":11:".$user["color2"].":14:".$user["iconType"].":15:".$user["special"].":16:".$extid.":3:".$user["stars"].":8:".round($user["creatorPoints"],0,PHP_ROUND_HALF_DOWN).":4:".$user["demons"].":7:".$extid.":46:".$user["diamonds"]."|"; 21 | } 22 | $pplstring = substr($pplstring, 0, -1); 23 | echo $pplstring; 24 | ?> -------------------------------------------------------------------------------- /include/scores/getGJLevelScores.php: -------------------------------------------------------------------------------- 1 | remove($_POST["gjp"]); 12 | $accountID = $ep->remove($_POST["accountID"]); 13 | $levelID = $ep->remove($_POST["levelID"]); 14 | $percent = $ep->remove($_POST["percent"]); 15 | $uploadDate = time(); 16 | if(isset($_POST["s1"])){ 17 | $attempts = $_POST["s1"] - 8354; 18 | }else{ 19 | $attempts = 0; 20 | } 21 | if(isset($_POST["s9"])){ 22 | $coins = $_POST["s9"] - 5819; 23 | }else{ 24 | $coins = 0; 25 | } 26 | 27 | 28 | 29 | 30 | 31 | //UPDATING SCORE 32 | $userID = $gs->getUserID($accountID); 33 | $query2 = $db->prepare("SELECT percent FROM levelscores WHERE accountID = :accountID AND levelID = :levelID"); 34 | $query2->execute([':accountID' => $accountID, ':levelID' => $levelID]); 35 | $oldPercent = $query2->fetchColumn(); 36 | if($query2->rowCount() == 0) { 37 | $query = $db->prepare("INSERT INTO levelscores (accountID, levelID, percent, uploadDate, coins, attempts) 38 | VALUES (:accountID, :levelID, :percent, :uploadDate, :coins, :attempts)"); 39 | } else { 40 | if($oldPercent <= $percent){ 41 | $query = $db->prepare("UPDATE levelscores SET percent=:percent, uploadDate=:uploadDate, coins=:coins, attempts=:attempts WHERE accountID=:accountID AND levelID=:levelID"); 42 | }else{ 43 | $query = $db->prepare("SELECT count(*) FROM levelscores WHERE percent=:percent AND uploadDate=:uploadDate AND accountID=:accountID AND levelID=:levelID AND coins = :coins AND attempts = :attempts"); 44 | } 45 | } 46 | $GJPCheck = new GJPCheck(); 47 | $gjpresult = $GJPCheck->check($gjp,$accountID); 48 | if($gjpresult == 1){ 49 | $query->execute([':accountID' => $accountID, ':levelID' => $levelID, ':percent' => $percent, ':uploadDate' => $uploadDate, ':coins' => $coins, ':attempts' => $attempts]); 50 | if($percent > 100){ 51 | $query = $db->prepare("UPDATE users SET isBanned=1 WHERE extID = :accountID"); 52 | $query->execute([':accountID' => $accountID]); 53 | } 54 | } 55 | 56 | 57 | 58 | //GETTING SCORES 59 | if(!isset($_POST["type"])){ 60 | $type = 1; 61 | }else{ 62 | $type = $_POST["type"]; 63 | } 64 | switch($type){ 65 | case 0: 66 | $friends = $gs->getFriends($accountID); 67 | $friends[] = $accountID; 68 | $friends = implode(",",$friends); 69 | $query2 = $db->prepare("SELECT accountID, uploadDate, percent, coins FROM levelscores WHERE levelID = :levelID AND accountID IN ($friends) ORDER BY percent DESC"); 70 | $query2args = [':levelID' => $levelID]; 71 | break; 72 | case 1: 73 | $query2 = $db->prepare("SELECT accountID, uploadDate, percent, coins FROM levelscores WHERE levelID = :levelID ORDER BY percent DESC"); 74 | $query2args = [':levelID' => $levelID]; 75 | break; 76 | case 2: 77 | $query2 = $db->prepare("SELECT accountID, uploadDate, percent, coins FROM levelscores WHERE levelID = :levelID AND uploadDate > :time ORDER BY percent DESC"); 78 | $query2args = [':levelID' => $levelID, ':time' => time() - 604800]; 79 | break; 80 | default: 81 | return -1; 82 | break; 83 | } 84 | 85 | 86 | 87 | $query2->execute($query2args); 88 | $result = $query2->fetchAll(); 89 | foreach ($result as &$score) { 90 | $extID = $score["accountID"]; 91 | $query2 = $db->prepare("SELECT userName, userID, icon, color1, color2, iconType, special, extID, isBanned FROM users WHERE extID = :extID"); 92 | $query2->execute([':extID' => $extID]); 93 | $user = $query2->fetchAll(); 94 | $user = $user[0]; 95 | $time = date("d/m/Y G.i", $score["uploadDate"]); 96 | if($user["isBanned"]==0){ 97 | if($score["percent"] == 100){ 98 | $place = 1; 99 | }else if($score["percent"] > 75){ 100 | $place = 2; 101 | }else{ 102 | $place = 3; 103 | } 104 | echo "1:".$user["userName"].":2:".$user["userID"].":9:".$user["icon"].":10:".$user["color1"].":11:".$user["color2"].":14:".$user["iconType"].":15:".$user["special"].":16:".$user["extID"].":3:".$score["percent"].":6:".$place.":13:".$score["coins"].":42:".$time."|"; 105 | } 106 | } 107 | ?> -------------------------------------------------------------------------------- /include/scores/updateGDPSUserBan.php: -------------------------------------------------------------------------------- 1 | remove($_POST["userID"]); 11 | $accountID = $ep->remove($_POST["accountID"]); 12 | $gjp = $ep->remove($_POST["gjp"]); 13 | if($gjp != $GJPCheck->check($gjp,$id)){ 14 | $query = $db->prepare("SELECT accountID FROM accounts WHERE userName=:userName"); 15 | $query->execute([':userName' => $userName]); 16 | $accountID = $query->fetchColumn(); 17 | if($gs->checkPermission($accountID, "toolLeaderboardsban")){ 18 | exit("1"); 19 | /*if(!is_numeric($userID)){ 20 | exit("Invalid userID"); 21 | } 22 | $query = $db->prepare("UPDATE users SET isBanned = 1 WHERE userID = :id"); 23 | $query->execute([':id' => $userID]); 24 | if($query->rowCount() != 0){ 25 | echo "Banned succesfully."; 26 | }else{ 27 | echo "Ban failed."; 28 | } 29 | $query = $db->prepare("INSERT INTO modactions (type, value, value2, timestamp, account) 30 | VALUES ('15',:userID, '1', :timestamp,:account)"); 31 | $query->execute([':userID' => $userID, ':timestamp' => time(), ':account' => $accountID]);*/ 32 | }else{ 33 | exit("-1"); 34 | } 35 | }else{ 36 | echo "-1"; 37 | } 38 | }else{ 39 | echo '-1'; 40 | } 41 | ?> -------------------------------------------------------------------------------- /likeGJItem.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /likeGJItem19.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /likeGJItem20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /likeGJItem21.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /likeGJItem211.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rateGJDemon21.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rateGJStars20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rateGJStars211.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /readGJFriendRequest20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /removeGJFriend20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /reportGJLevel.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requestUserAccess.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /settings/dailyChests.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /settings/name.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /settings/reuploadAcc.php: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /settings/security.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /settings/songAdd.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /settings/topArtists.php: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /suggestGJStars20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/account/activate.php: -------------------------------------------------------------------------------- 1 | 11 |
12 |

Аккаунт активирован!

br> 13 |

Вы можете входить!

14 |
'; 15 | exit; 16 | } 17 | 18 | $tk = htmlspecialchars($_GET["token"]); 19 | if($tk != "") { 20 | $_SESSION["tk"] = $tk; 21 | echo ""; 22 | exit; 23 | } else { 24 | if($_SESSION["tk"]) { 25 | $query = $db->prepare("SELECT * FROM register WHERE token = :tk"); 26 | $query->execute([':tk' => $_SESSION["tk"]]); 27 | if ($query->rowCount() == 0) { 28 | invalid(); 29 | } 30 | } else { 31 | 32 | } 33 | } 34 | 35 | $cap = htmlspecialchars($_POST["cap"]); 36 | $tk = $_SESSION["tk"]; 37 | $query = $db->prepare("SELECT userName FROM register WHERE token = :tk"); 38 | $query->execute([':tk' => $tk]); 39 | $userName = $query->fetchColumn(); 40 | $query = $db->prepare("SELECT password FROM register WHERE token = :tk"); 41 | $query->execute([':tk' => $tk]); 42 | $password = $query->fetchColumn(); 43 | $query = $db->prepare("SELECT email FROM register WHERE token = :tk"); 44 | $query->execute([':tk' => $tk]); 45 | $email = $query->fetchColumn(); 46 | $query = $db->prepare("SELECT registerDate FROM register WHERE token = :tk"); 47 | $query->execute([':tk' => $tk]); 48 | $registerDate = $query->fetchColumn(); 49 | $query = $db->prepare("INSERT INTO accounts (userName, password, registerDate, email) VALUES (:userName, :password, :registerDate, :email)"); 50 | $query->execute([':userName' => $userName, ':password' => $password, ':email' => $email, ':registerDate' => $registerDate]); 51 | $query = $db->prepare("DELETE FROM register WHERE token = :tk"); 52 | $query->execute([':tk' => $tk]); 53 | success(); 54 | ?> 55 | -------------------------------------------------------------------------------- /tools/account/changePasswordNoSave.php: -------------------------------------------------------------------------------- 1 | WARNING: SAVE DATA IS LINKED TO YOUR PASSWORD, YOU MIGHT ESSENTIALLY BRICK YOUR LOAD FUNCTIONALITY BY USING THIS INSTEAD OF changePassword.php
2 | 3 | remove($_POST["userName"]); 14 | $oldpass = $_POST["oldpassword"]; 15 | $newpass = $_POST["newpassword"]; 16 | if($userName != "" AND $newpass != "" AND $oldpass != ""){ 17 | $generatePass = new generatePass(); 18 | $pass = $generatePass->isValidUsrname($userName, $oldpass); 19 | if ($pass == 1) { 20 | //creating pass hash 21 | $passhash = password_hash($newpass, PASSWORD_DEFAULT); 22 | $query = $db->prepare("UPDATE accounts SET password=:password, salt=:salt WHERE userName=:userName"); 23 | $query->execute([':password' => $passhash, ':userName' => $userName, ':salt' => $salt]); 24 | echo "Password changed. Go back to account management"; 25 | }else{ 26 | echo "Invalid old password or nonexistent account. Try again"; 27 | 28 | } 29 | }else{ 30 | echo '
Username:
Old password:
New password:
'; 31 | } 32 | ?> -------------------------------------------------------------------------------- /tools/account/changeUsername.php: -------------------------------------------------------------------------------- 1 | remove($_POST["userName"]); 8 | $newusr = $ep->remove($_POST["newusr"]); 9 | $password = $ep->remove($_POST["password"]); 10 | if($userName != "" AND $newusr != "" AND $password != ""){ 11 | $generatePass = new generatePass(); 12 | $pass = $generatePass->isValidUsrname($userName, $password); 13 | if ($pass == 1) { 14 | $query = $db->prepare("UPDATE accounts SET username=:newusr WHERE userName=:userName"); 15 | $query->execute([':newusr' => $newusr, ':userName' => $userName]); 16 | if($query->rowCount()==0){ 17 | echo "Invalid password or nonexistant account. Try again"; 18 | }else{ 19 | echo "Username changed. Go back to account management"; 20 | } 21 | }else{ 22 | echo "Invalid password or nonexistant account. Try again"; 23 | } 24 | }else{ 25 | echo '
Old username:
New username:
Password:
'; 26 | } 27 | ?> -------------------------------------------------------------------------------- /tools/account/reset.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT * FROM reset WHERE token = :tk"); 8 | $query->execute([':tk' => $tk]); 9 | if ($query->rowCount() > 0) { 10 | $query = $db->prepare("SELECT password FROM reset WHERE token = :tk"); 11 | $query->execute([':tk' => $tk]); 12 | $pass = $query->fetchColumn(); 13 | $query = $db->prepare("SELECT acc FROM reset WHERE token = :tk"); 14 | $query->execute([':tk' => $tk]); 15 | $acc = $query->fetchColumn(); 16 | $query = $db->prepare("UPDATE accounts SET password = :password WHERE accountID = :accID"); 17 | $query->execute([':accID' => $acc, ':password' => $pass]); 18 | $query = $db->prepare("DELETE FROM reset WHERE token = :tk"); 19 | $query->execute([':tk' => $tk]); 20 | echo "1"; 21 | } else { 22 | echo "-1"; 23 | } 24 | } else { 25 | echo "1"; 26 | } 27 | ?> 28 | -------------------------------------------------------------------------------- /tools/cron/autoban.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT COUNT(starDemon) FROM levels WHERE starDemon = 1"); 12 | $query->execute(); 13 | $demons = $demons + $query->fetchColumn(); 14 | 15 | $query = $db->prepare("SELECT * FROM dailyfeatures"); 16 | $query->execute(); 17 | $result = $query->fetchAll(); 18 | foreach($result as $a){ 19 | $querys = $db->prepare("SELECT starStars FROM levels WHERE levelID = ".$a["levelID"]); 20 | $querys->execute(); 21 | $stars = $stars + $querys->fetchColumn(); 22 | } 23 | 24 | $query = $db->prepare("SELECT SUM(stars) FROM mappacks"); 25 | $query->execute(); 26 | $stars = $stars + $query->fetchColumn(); 27 | 28 | $query = $db->prepare("SELECT SUM(starStars) FROM levels"); 29 | $query->execute(); 30 | $stars = $stars + $query->fetchColumn(); 31 | $query = $db->prepare("UPDATE users SET isBanned = 1 WHERE stars > $stars"); 32 | $query->execute(); 33 | 34 | $query = $db->prepare("SELECT SUM(coins) FROM mappacks"); 35 | $query->execute(); 36 | $coins = $coins + $query->fetchColumn(); 37 | 38 | $query = $db->prepare("SELECT SUM(coins) FROM levels"); 39 | $query->execute(); 40 | $pc = $query->fetchColumn(); 41 | 42 | 43 | $query = $db->prepare("SELECT * FROM gauntlets"); 44 | $query->execute(); 45 | $result = $query->fetchAll(); 46 | foreach($result as $a){ 47 | $querys = $db->prepare("SELECT starStars FROM levels WHERE levelID = ".$a["level1"]); 48 | $querys->execute(); 49 | $stars = $stars + $querys->fetchColumn(); 50 | } 51 | 52 | 53 | $query = $db->prepare("SELECT * FROM gauntlets"); 54 | $query->execute(); 55 | $result = $query->fetchAll(); 56 | foreach($result as $a){ 57 | $querys = $db->prepare("SELECT starStars FROM levels WHERE levelID = ".$a["level5"]); 58 | $querys->execute(); 59 | $stars = $stars + $querys->fetchColumn(); 60 | } 61 | 62 | $query = $db->prepare("SELECT * FROM gauntlets"); 63 | $query->execute(); 64 | $result = $query->fetchAll(); 65 | foreach($result as $a){ 66 | $querys = $db->prepare("SELECT starStars FROM levels WHERE levelID = ".$a["level4"]); 67 | $querys->execute(); 68 | $stars = $stars + $querys->fetchColumn(); 69 | } 70 | 71 | $query = $db->prepare("SELECT * FROM gauntlets"); 72 | $query->execute(); 73 | $result = $query->fetchAll(); 74 | foreach($result as $a){ 75 | $querys = $db->prepare("SELECT starStars FROM levels WHERE levelID = ".$a["level3"]); 76 | $querys->execute(); 77 | $stars = $stars + $querys->fetchColumn(); 78 | } 79 | 80 | $query = $db->prepare("SELECT * FROM gauntlets"); 81 | $query->execute(); 82 | $result = $query->fetchAll(); 83 | foreach($result as $a){ 84 | $querys = $db->prepare("SELECT starStars FROM levels WHERE levelID = ".$a["level2"]); 85 | $querys->execute(); 86 | $stars = $stars + $querys->fetchColumn(); 87 | } 88 | 89 | $query = $db->prepare("UPDATE users SET isBanned = 1 WHERE stars > :star OR coins > :coin OR userCoins > :pc"); 90 | $query->execute(array(":star" => $stars, ":coin" => $coins, ":pc" => $pc)); 91 | $query = $db->prepare("UPDATE users SET isBanned = 1 WHERE stars < 0 OR coins < 0 OR userCoins < 0"); 92 | $query->execute(); 93 | echo "1"; 94 | ob_flush(); 95 | flush(); 96 | ?> 97 | 98 | -------------------------------------------------------------------------------- /tools/cron/cron.php: -------------------------------------------------------------------------------- 1 | Cron 2 | 3 | 4 | 112 |

113 |

114 | -------------------------------------------------------------------------------- /tools/cron/fixcps.php: -------------------------------------------------------------------------------- 1 | prepare("update users 5 | set creatorPoints = ( 6 | select COUNT(*) 7 | from levels 8 | where levels.userID = users.userID AND starStars != 0 9 | ) + ( 10 | select COUNT(*) 11 | from levels 12 | where levels.userID = users.userID AND levels.starFeatured != 0 AND levels.starEpic = 0 13 | ) + ( 14 | select COUNT(*) 15 | from levels 16 | where levels.userID = users.userID AND levels.starEpic = 1 AND levels.starFeatured = 0 17 | ) + ( 18 | select COUNT(*) 19 | from levels 20 | where levels.userID = users.userID AND levels.starEpic = 1 AND levels.starFeatured = 0 21 | ) + ( 22 | select COUNT(*) 23 | from levels 24 | where levels.userID = users.userID AND levels.starEpic = 1 AND levels.starFeatured = 1 25 | ) + ( 26 | select COUNT(*) 27 | from levels 28 | where levels.userID = users.userID AND levels.starEpic = 1 AND levels.starFeatured = 1 29 | )"); 30 | $query->execute(); 31 | ?> 32 | 1 33 | -------------------------------------------------------------------------------- /tools/cron/fixlevels.php: -------------------------------------------------------------------------------- 1 | prepare("UPDATE levels SET starDemon = 0, starEpic = 0, starFeatured = 0, starCoins = 0 WHERE starStars < 1"); 5 | $query->execute(); 6 | ?> 7 | 1 8 | -------------------------------------------------------------------------------- /tools/cron/fixnames.php: -------------------------------------------------------------------------------- 1 | prepare("UPDATE users 12 | INNER JOIN accounts ON accounts.accountID = users.extID 13 | SET users.userName = accounts.userName 14 | WHERE users.extID REGEXP '^-?[0-9]+$' 15 | AND LENGTH(accounts.userName) <= 69"); 16 | $query->execute(); 17 | $query = $db->prepare("UPDATE users 18 | INNER JOIN accounts ON accounts.accountID = users.extID 19 | SET users.userName = 'Invalid Username' 20 | WHERE users.extID REGEXP '^-?[0-9]+$' 21 | AND LENGTH(accounts.userName) > 69"); 22 | $query->execute(); 23 | echo "1"; -------------------------------------------------------------------------------- /tools/cron/friendsLeaderboard.php: -------------------------------------------------------------------------------- 1 | $newtime){ 7 | $remaintime = time() - $cptime; 8 | $remaintime = 5 - $remaintime; 9 | $remainmins = floor($remaintime / 60); 10 | $remainsecs = $remainmins * 60; 11 | $remainsecs = $remaintime - $remainsecs; 12 | exit("Please wait $remainmins minutes and $remainsecs seconds before running ". basename($_SERVER['SCRIPT_NAME'])." again"); 13 | } 14 | } 15 | file_put_contents("../logs/fixfrndlog.txt",time()); 16 | set_time_limit(0); 17 | include "../../include/lib/connection.php"; 18 | $query = $db->prepare("UPDATE accounts 19 | LEFT JOIN 20 | ( 21 | SELECT a.person, (IFNULL(a.friends, 0) + IFNULL(b.friends, 0)) AS friends FROM ( 22 | SELECT count(*) as friends, person1 AS person FROM friendships GROUP BY(person1) 23 | ) AS a 24 | JOIN 25 | ( 26 | SELECT count(*) as friends, person2 AS person FROM friendships GROUP BY(person2) 27 | ) AS b ON a.person = b.person 28 | ) calculated 29 | ON accounts.accountID = calculated.person 30 | SET accounts.friendsCount = IFNULL(calculated.friends, 0)"); 31 | $query->execute(); 32 | echo "1"; 33 | ?> 34 | -------------------------------------------------------------------------------- /tools/cron/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | GDPS Tools [Cron] 10 | 11 | 12 |
13 |

Start Cron

14 |

15 |
16 | 17 | 18 | 19 | 127 | 128 | -------------------------------------------------------------------------------- /tools/cron/removeBlankLevels.php: -------------------------------------------------------------------------------- 1 | prepare("DELETE FROM users WHERE extID = ''"); 4 | $query->execute(); 5 | $query = $db->prepare("DELETE FROM songs WHERE download = ''"); 6 | $query->execute(); 7 | ob_flush(); 8 | flush(); 9 | 10 | $query = $db->prepare("UPDATE levels SET password = 0 WHERE password = 2"); 11 | $query->execute(); 12 | 13 | echo "1"; 14 | ob_flush(); 15 | flush(); 16 | ?> -------------------------------------------------------------------------------- /tools/cron/songsCount.php: -------------------------------------------------------------------------------- 1 | "; 8 | $query = $db->prepare("UPDATE songs 9 | LEFT JOIN 10 | ( 11 | SELECT count(*) AS levelsCount, songID FROM levels GROUP BY songID 12 | ) calculated 13 | ON calculated.songID = songs.ID 14 | SET songs.levelsCount = IFNULL(calculated.levelsCount, 0)"); 15 | $query->execute(); 16 | echo "Finished
"; 17 | ?> 18 | -------------------------------------------------------------------------------- /tools/index.php: -------------------------------------------------------------------------------- 1 | getCount("levels"); 8 | $usrs = $gs->getCount("users"); 9 | $com = $gs->getCount("levels"); 10 | $acc = $gs->getCount("acc"); 11 | ?> 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | <?php echo $gdpsname ?> Tools [IoCore] 20 | 21 | 22 |
23 |

Tools

24 |
25 |

Uploading

26 | Song Upload 27 | Level reupload 28 | Link GD Account 29 | Level to GD 30 | Cron 31 |
32 |
33 |

Stats

34 | 35 | 69 |
70 |
71 | 72 | -------------------------------------------------------------------------------- /tools/logs/cplog.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tools/logs/cronlastrun.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tools/logs/fixcpslog.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tools/logs/fixfrndlog.txt: -------------------------------------------------------------------------------- 1 | 1641073019 -------------------------------------------------------------------------------- /tools/logs/fixnameslog.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tools/logs/frndlog.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tools/logs/snglog.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tools/mod/addQuests.php: -------------------------------------------------------------------------------- 1 | remove($_POST["userName"]); 10 | $password = $ep->remove($_POST["password"]); 11 | $type = $ep->number($_POST["type"]); 12 | $amount = $ep->number($_POST["amount"]); 13 | $reward = $ep->number($_POST["reward"]); 14 | $name = $ep->remove($_POST["names"]); 15 | $generatePass = new generatePass(); 16 | $pass = $generatePass->isValidUsrname($userName, $password); 17 | if ($pass == 1) { 18 | $query = $db->prepare("SELECT accountID FROM accounts WHERE userName=:userName"); 19 | $query->execute([':userName' => $userName]); 20 | $accountID = $query->fetchColumn(); 21 | if($gs->checkPermission($accountID, "toolQuestsCreate") == false){ 22 | echo "This account doesn't have the permissions to access this tool. Try again"; 23 | }else{ 24 | if(!is_numeric($type) OR !is_numeric($amount) OR !is_numeric($reward) OR $type > 3){ 25 | exit("Type/Amount/Reward invalid"); 26 | } 27 | 28 | $query = $db->prepare("INSERT INTO quests (type, amount, reward, name) VALUES (:type,:amount,:reward,:name)"); 29 | $query->execute([':type' => $type, ':amount' => $amount, ':reward' => $reward, ':name' => $name]); 30 | $query = $db->prepare("INSERT INTO modactions (type, value, timestamp, account, value2, value3, value4) VALUES ('25',:value,:timestamp,:account,:amount,:reward,:name)"); 31 | $query->execute([':value' => $type, ':timestamp' => time(), ':account' => $accountID, ':amount' => $amount, ':reward' => $reward, ':name' => $name]); 32 | if($db->lastInsertId() < 3) { 33 | exit("Successfully added Quest! It's recommended that you should add a few more."); 34 | } else { 35 | exit("Successfully added Quest!"); 36 | } 37 | } 38 | }else{ 39 | echo "Invalid password or nonexistant account. Try again"; 40 | } 41 | }else{ 42 | echo ' 43 |
Username: 44 |
Password: 45 |
Quest Type: 50 |
Amount: (How many orbs/coins/stars you need to collect) 51 |
Reward: (How many Diamonds you get as a reward) 52 |
Quest Name: 53 |
'; 54 | } 55 | ?> -------------------------------------------------------------------------------- /tools/mod/index.php: -------------------------------------------------------------------------------- 1 | remove($_POST["userName"]); 14 | $password = $ep->remove($_POST["password"]); 15 | $generatePass = new generatePass(); 16 | 17 | $pass = $generatePass->isValidUsrname($userName, $password); 18 | if ($pass == 1) { 19 | $query = $db->prepare("SELECT accountID FROM accounts WHERE userName=:userName"); 20 | $query->execute([':userName' => $userName]); 21 | $accountID = $query->fetchColumn(); 22 | if ($query->rowCount()==0) { 23 | $log = "Invalid user/password. Try again."; 24 | } elseif ($gs->checkPermission($accountID, "toolSuggestlist")) { 25 | $_SESSION['user'] = true; 26 | header('Refresh: 0; url="https://woidzero.xyz/tps/database/tools/mod/panel.php"'); 27 | } else { 28 | $log = "You don't have permissions to view content on this page."; 29 | } 30 | } else { 31 | $log = "Invalid user/password. Try again."; 32 | } 33 | } 34 | ?> 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 |

Log-in

47 |
48 |

Login

49 |
50 | Username:
51 | Password:
52 | 53 |
54 |
55 |

56 |
57 |
58 |
59 | 60 | -------------------------------------------------------------------------------- /tools/mod/leaderboardsBan.php: -------------------------------------------------------------------------------- 1 | remove($_POST["userName"]); 10 | $password = $ep->remove($_POST["password"]); 11 | $userID = $ep->remove($_POST["userID"]); 12 | $generatePass = new generatePass(); 13 | $pass = $generatePass->isValidUsrname($userName, $password); 14 | if ($pass == 1) { 15 | $query = $db->prepare("SELECT accountID FROM accounts WHERE userName=:userName"); 16 | $query->execute([':userName' => $userName]); 17 | $accountID = $query->fetchColumn(); 18 | if($gs->checkPermission($accountID, "toolLeaderboardsban")){ 19 | if(!is_numeric($userID)){ 20 | exit("Invalid userID"); 21 | } 22 | $query = $db->prepare("UPDATE users SET isBanned = 1 WHERE userID = :id"); 23 | $query->execute([':id' => $userID]); 24 | if($query->rowCount() != 0){ 25 | echo "Banned succesfully."; 26 | }else{ 27 | echo "Ban failed."; 28 | } 29 | $query = $db->prepare("INSERT INTO modactions (type, value, value2, timestamp, account) 30 | VALUES ('15',:userID, '1', :timestamp,:account)"); 31 | $query->execute([':userID' => $userID, ':timestamp' => time(), ':account' => $accountID]); 32 | }else{ 33 | exit("You do not have the permission to do this action. Try again"); 34 | } 35 | }else{ 36 | echo "Invalid password or nonexistant account. Try again"; 37 | } 38 | }else{ 39 | echo '
Your Username: 40 |
Your Password: 41 |
Target UserID: 42 |
'; 43 | } 44 | ?> -------------------------------------------------------------------------------- /tools/mod/leaderboardsUnban.php: -------------------------------------------------------------------------------- 1 | remove($_POST["userName"]); 10 | $password = $ep->remove($_POST["password"]); 11 | $userID = $ep->remove($_POST["userID"]); 12 | $generatePass = new generatePass(); 13 | $pass = $generatePass->isValidUsrname($userName, $password); 14 | if ($pass == 1) { 15 | $query = $db->prepare("SELECT accountID FROM accounts WHERE userName=:userName"); 16 | $query->execute([':userName' => $userName]); 17 | $accountID = $query->fetchColumn(); 18 | if($gs->checkPermission($accountID, "toolLeaderboardsban")){ 19 | if(!is_numeric($userID)){ 20 | exit("Invalid userID"); 21 | } 22 | $query = $db->prepare("UPDATE users SET isBanned = 0 WHERE userID = :id"); 23 | $query->execute([':id' => $userID]); 24 | if($query->rowCount() != 0){ 25 | echo "Unbanned succesfully."; 26 | }else{ 27 | echo "Unban failed."; 28 | } 29 | $query = $db->prepare("INSERT INTO modactions (type, value, value2, timestamp, account) 30 | VALUES ('15',:userID, '0', :timestamp,:account)"); 31 | $query->execute([':userID' => $userID, ':timestamp' => time(), ':account' => $accountID]); 32 | }else{ 33 | exit("You do not have the permission to do this action. Try again"); 34 | } 35 | }else{ 36 | echo "Invalid password or nonexistant account. Try again"; 37 | } 38 | }else{ 39 | echo '
Your Username: 40 |
Your Password: 41 |
Target UserID: 42 |
'; 43 | } 44 | ?> -------------------------------------------------------------------------------- /tools/mod/packCreate.php: -------------------------------------------------------------------------------- 1 | remove($_POST["userName"]); 10 | $password = $ep->remove($_POST["password"]); 11 | $packName = $ep->remove($_POST["packName"]); 12 | $levels = $ep->remove($_POST["levels"]); 13 | $stars = $ep->remove($_POST["stars"]); 14 | $coins = $ep->remove($_POST["coins"]); 15 | $color = $ep->remove($_POST["color"]); 16 | $generatePass = new generatePass(); 17 | $pass = $generatePass->isValidUsrname($userName, $password); 18 | if ($pass == 1) { 19 | $query = $db->prepare("SELECT accountID FROM accounts WHERE userName=:userName"); 20 | $query->execute([':userName' => $userName]); 21 | $accountID = $query->fetchColumn(); 22 | if($gs->checkPermission($accountID, "toolPackcreate") == false){ 23 | echo "This account doesn't have the permissions to access this tool. Try again"; 24 | }else{ 25 | if(!is_numeric($stars) OR !is_numeric($coins) OR $stars > 10 OR $coins > 2){ 26 | exit("Invalid stars/coins value"); 27 | } 28 | if(strlen($color) != 6){ 29 | exit("Unknown color value"); 30 | } 31 | $rgb = hexdec(substr($color,0,2)). 32 | ",".hexdec(substr($color,2,2)). 33 | ",".hexdec(substr($color,4,2)); 34 | $lvlsarray = explode(",", $levels); 35 | foreach($lvlsarray AS &$level){ 36 | if(!is_numeric($level)){ 37 | exit("$level isn't a number"); 38 | } 39 | $query = $db->prepare("SELECT levelName FROM levels WHERE levelID=:levelID"); 40 | $query->execute([':levelID' => $level]); 41 | if($query->rowCount() == 0){ 42 | exit("Level #$level doesn't exist."); 43 | } 44 | $levelName = $query->fetchColumn(); 45 | $levelstring .= $levelName . ", "; 46 | } 47 | $levelstring = substr($levelstring,0,-2); 48 | $diff = 0; 49 | $diffname = "Auto"; 50 | switch($stars){ 51 | case 1: 52 | $diffname = "Auto"; 53 | $diff = 0; 54 | break; 55 | case 2: 56 | $diffname = "Easy"; 57 | $diff = 1; 58 | break; 59 | case 3: 60 | $diffname = "Normal"; 61 | $diff = 2; 62 | break; 63 | case 4: 64 | case 5: 65 | $diffname = "Hard"; 66 | $diff = 3; 67 | break; 68 | case 6: 69 | case 7: 70 | $diffname = "Harder"; 71 | $diff = 4; 72 | break; 73 | case 8: 74 | case 9: 75 | $diffname = "Insane"; 76 | $diff = 5; 77 | break; 78 | case 10: 79 | $diffname = "Demon"; 80 | $diff = 6; 81 | break; 82 | } 83 | echo "AccountID: $accountID
84 | Pack Name: $packName
85 | Levels: $levelstring ($levels)
86 | Difficulty: $diffname ($diff)
87 | Stars: $stars
88 | Coins: $coins
89 | RGB Color: $rgb"; 90 | $query = $db->prepare("INSERT INTO mappacks (name, levels, stars, coins, difficulty, rgbcolors) 91 | VALUES (:name,:levels,:stars,:coins,:difficulty,:rgbcolors)"); 92 | $query->execute([':name' => $packName, ':levels' => $levels, ':stars' => $stars, ':coins' => $coins, ':difficulty' => $diff, ':rgbcolors' => $rgb]); 93 | $query = $db->prepare("INSERT INTO modactions (type, value, timestamp, account, value2, value3, value4, value7) 94 | VALUES ('11',:value,:timestamp,:account,:levels, :stars, :coins, :rgb)"); 95 | $query->execute([':value' => $packName, ':timestamp' => time(), ':account' => $accountID, ':levels' => $levels, ':stars' => $stars, ':coins' => $coins, ':rgb' => $rgb]); 96 | } 97 | }else{ 98 | echo "Invalid password or nonexistant account. Try again"; 99 | } 100 | }else{ 101 | echo ' 102 |
Username: 103 |
Password: 104 |
Pack Name: 105 |
Level IDs: (separate by commas) 106 |
Stars: (max 10) 107 |
Coins: (max 2) 108 |
Color: 109 |
'; 110 | } 111 | ?> -------------------------------------------------------------------------------- /tools/mod/panel.php: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | Mod Panel 19 | 20 | 21 |
22 |

Mod Panel

23 |
24 |

Mod Tools

25 | Suggestions 26 |
27 |
28 | 29 | '; 30 | 31 | } else { 32 | echo "

You not logined."; 33 | } 34 | ?> -------------------------------------------------------------------------------- /tools/mod/revertLikes.php: -------------------------------------------------------------------------------- 1 | remove($_POST["userName"]); 10 | $password = $ep->remove($_POST["password"]); 11 | $levelID = $ep->remove($_POST["levelID"]); 12 | $timestamp = $ep->remove($_POST["timestamp"]); 13 | $generatePass = new generatePass(); 14 | $pass = $generatePass->isValidUsrname($userName, $password); 15 | 16 | if ($pass == 1) { 17 | $query = $db->prepare("SELECT accountID FROM accounts WHERE userName=:userName"); 18 | $query->execute([':userName' => $userName]); 19 | $accountID = $query->fetchColumn(); 20 | if($gs->checkPermission($accountID, "toolLeaderboardsban")){ //TODO: create a permission for this 21 | if(!is_numeric($levelID)) 22 | exit("Invalid level ID"); 23 | 24 | $query = $db->prepare("SELECT count(*) FROM actions WHERE value = :levelID AND type = 3 AND timestamp >= :timestamp"); 25 | $query->execute([':levelID' => $levelID, ':timestamp' => $timestamp]); 26 | $count = $query->fetchColumn(); 27 | 28 | $query = $db->prepare("UPDATE levels SET likes = likes + :count WHERE levelID = :levelID"); 29 | $query->execute([':levelID' => $levelID, ':count' => $count]); 30 | 31 | if($query->rowCount() != 0){ 32 | echo "Banned succesfully."; 33 | }else{ 34 | echo "Ban failed."; 35 | } 36 | 37 | $query = $db->prepare("INSERT INTO modactions (type, value, value2, value3, timestamp, account) 38 | VALUES ('17',:levelID, '1', :now,:account)"); 39 | $query->execute([':levelID' => $levelID,':timestamp' => $timestamp, ':now' => time(), ':account' => $accountID]); 40 | 41 | }else{ 42 | exit("You do not have the permission to do this action. Try again"); 43 | } 44 | }else{ 45 | echo "Invalid password or nonexistant account. Try again"; 46 | } 47 | }else{ 48 | echo '
Your Username: 49 |
Your Password: 50 |
Level ID: 51 |
Timestamp since: 52 |
'; 53 | } 54 | ?> -------------------------------------------------------------------------------- /tools/mod/suggestionList.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Mod Panel 14 | 15 | 16 | 17 |

Suggestions

18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | prepare("DELETE FROM `suggest` WHERE `suggest`.`ID` = :id"); 41 | $query->execute(array(':id' => $id)); 42 | return 1; 43 | } 44 | 45 | if (isset($_SESSION['user']) && $_SESSION['user'] == true) { 46 | $query = $db->prepare("SELECT ID,suggestBy,suggestLevelId,suggestDifficulty,suggestStars,suggestFeatured,suggestAuto,suggestDemon,timestamp FROM suggest ORDER BY timestamp DESC"); 47 | $query->execute(); 48 | $result = $query->fetchAll(); 49 | 50 | foreach ($result as &$sugg) { 51 | $suggestID = (int)$sugg['ID']; 52 | 53 | echo " 54 | 55 | 57 | 59 | 61 | 63 | 65 | 67 | "; 69 | } 70 | 71 | echo "
TimeSuggesterLevel IDDifficultyStarsFeaturedClose
".date("d/m/Y G:i", $sugg["timestamp"]). 56 | "".$gs->getAccountName($sugg["suggestBy"])." (".$sugg["suggestBy"].")". 58 | "".htmlspecialchars($sugg["suggestLevelId"],ENT_QUOTES). 60 | "".htmlspecialchars($gs->getDifficulty($sugg["suggestDifficulty"],$sugg["suggestAuto"],$sugg["suggestDemon"]), ENT_QUOTES). 62 | "".htmlspecialchars($sugg["suggestStars"],ENT_QUOTES). 64 | "".htmlspecialchars($sugg["suggestFeatured"],ENT_QUOTES). 66 | "Delete". 68 | "
"; 72 | 73 | if (isset($_GET['delete'])) { 74 | closeSuggestion($suggestID); 75 | header("Refresh: 0; url='https://woidzero.xyz/tps/database/tools/mod/suggestionList.php'"); 76 | $log = "Suggestion with id: ".$suggestID." was deleted."; 77 | } 78 | } else { 79 | echo "You not logined."; 80 | } 81 | ?> 82 | 83 |
84 |

85 |
86 | 87 | -------------------------------------------------------------------------------- /tools/mod/ui.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Open+Sans&display=swap'); 2 | 3 | html { 4 | box-sizing: border-box; 5 | } 6 | 7 | * { 8 | text-decoration: none; 9 | outline: none; 10 | box-sizing: border-box; 11 | transition: ease-in-out 0.2s; 12 | } 13 | 14 | 15 | body { 16 | background: #1e2124; 17 | font-family: 'Open Sans', sans-serif; 18 | } 19 | 20 | h1 { 21 | text-align: center; 22 | font-weight: 300; 23 | } 24 | 25 | table { 26 | display: block; 27 | } 28 | 29 | tr, td, tbody, tfoot { 30 | display: block; 31 | } 32 | 33 | thead { 34 | display: none; 35 | } 36 | 37 | tr { 38 | padding-bottom: 10px; 39 | } 40 | 41 | td { 42 | padding: 10px 10px 0; 43 | text-align: center; 44 | } 45 | td:before { 46 | content: attr(data-title); 47 | color: #7a91aa; 48 | text-transform: uppercase; 49 | font-size: 1.4rem; 50 | padding-right: 10px; 51 | display: block; 52 | } 53 | 54 | table { 55 | width: 100%; 56 | } 57 | 58 | th { 59 | text-align: left; 60 | font-weight: 700; 61 | } 62 | 63 | thead th { 64 | background-color: #202932; 65 | color: #fff; 66 | border: 1px solid #202932; 67 | } 68 | 69 | tfoot th { 70 | display: block; 71 | padding: 10px; 72 | text-align: center; 73 | color: #b8c4d2; 74 | } 75 | 76 | dl { 77 | margin: 0; 78 | padding: 0; 79 | } 80 | 81 | dt { 82 | font-size: 2.2rem; 83 | font-weight: 300; 84 | } 85 | 86 | dd { 87 | margin: 0 0 40px 0; 88 | font-size: 1.8rem; 89 | padding-bottom: 5px; 90 | border-bottom: 1px solid #ac2647; 91 | box-shadow: 0 1px 0 #c52c51; 92 | } 93 | 94 | @media (min-width: 460px) { 95 | td { 96 | text-align: left; 97 | } 98 | td:before { 99 | display: inline-block; 100 | text-align: right; 101 | width: 140px; 102 | } 103 | 104 | .select { 105 | padding-left: 160px; 106 | } 107 | } 108 | 109 | @media (min-width: 720px) { 110 | table { 111 | display: table; 112 | } 113 | 114 | tr { 115 | display: table-row; 116 | } 117 | 118 | td, th { 119 | display: table-cell; 120 | } 121 | 122 | tbody { 123 | display: table-row-group; 124 | } 125 | 126 | thead { 127 | display: table-header-group; 128 | } 129 | 130 | tfoot { 131 | display: table-footer-group; 132 | } 133 | 134 | td { 135 | border: 1px solid #28333f; 136 | } 137 | td:before { 138 | display: none; 139 | } 140 | 141 | td, th { 142 | padding: 10px; 143 | } 144 | 145 | tr:nth-child(2n+2) td { 146 | background-color: #242e39; 147 | } 148 | 149 | tfoot th { 150 | display: table-cell; 151 | } 152 | 153 | .select { 154 | padding: 10px; 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /tools/saveDecode.php: -------------------------------------------------------------------------------- 1 | remove($_GET["userName"]); 14 | $password = $_GET["password"]; 15 | $generatePass = new generatePass(); 16 | $pass = $generatePass->isValidUsrname($userName, $password); 17 | if ($pass == 1) { 18 | $query = $db->prepare("select accountID, saveData from accounts where userName = :userName"); 19 | $query->execute([':userName' => $userName]); 20 | $account = $query->fetch(); 21 | $accountID = $account["accountID"]; 22 | if(!is_numeric($accountID)){ 23 | exit("unknown account"); 24 | } 25 | if(!file_exists("../data/accounts/$accountID")){ 26 | $saveData = $account["saveData"]; 27 | if(substr($saveData,0,4) == "SDRz"){ 28 | $saveData = base64_decode($saveData); 29 | } 30 | }else{ 31 | $saveData = file_get_contents("../data/accounts/$accountID"); 32 | if(file_exists("../data/accounts/keys/$accountID")){ 33 | if(substr($saveData,0,3) != "H4s"){ 34 | $protected_key_encoded = file_get_contents("../data/accounts/keys/$accountID"); 35 | $protected_key = KeyProtectedByPassword::loadFromAsciiSafeString($protected_key_encoded); 36 | $user_key = $protected_key->unlockKey($password); 37 | try { 38 | $saveData = Crypto::decrypt($saveData, $user_key); 39 | } catch (Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException $ex) { 40 | exit("-2"); 41 | } 42 | } 43 | } 44 | } 45 | echo $saveData.";21;30;a;a"; 46 | }else{ 47 | echo "wrong pass"; 48 | } 49 | ?> -------------------------------------------------------------------------------- /tools/songAdd.php: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /tools/songs/index.php: -------------------------------------------------------------------------------- 1 | = 10485760) { 12 | $log = "Max file size is 10mb"; 13 | } else { 14 | $author_name = $_POST['authorname']; 15 | $song_name = $_POST['songname']; 16 | 17 | $songName = $author_name . " - " . $song_name; 18 | $url = str_replace(" ", "", $songName); 19 | 20 | move_uploaded_file($_FILES['filename']['tmp_name'], "song/$url.mp3"); 21 | 22 | $size = round($_FILES['filename']['size'] / 1024 / 1024, 2); 23 | $hash = hash_file('sha256', "song/$url.mp3"); 24 | 25 | $song = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."song/"; 26 | $cur = str_replace('upload.php', '', $song) . $url . ".mp3"; 27 | 28 | $query = $db->prepare("INSERT INTO songs (name, authorID, authorName, size, download, hash) 29 | VALUES (:name, '9', :author, :size, :download, :hash)"); 30 | $query->execute([':name' => $songName, ':download' => $cur, ':author' => $author_name, ':size' => $size, ':hash' => $hash]); 31 | 32 | $log = "Success! ID: ". $db->lastInsertId() .""; 33 | } 34 | } else { 35 | $log = "Provide a song name and an author name."; 36 | } 37 | } else { 38 | $log = "Error uploading file: ".$_FILES['filename']['error']; 39 | } 40 | } 41 | 42 | ?> 43 | 44 | 45 | 46 | 47 | 48 | Song Upload 49 | 50 | 51 | 52 |
53 |

Song Upload

54 |
55 |
56 |
57 |
58 | 59 |
60 |

61 | 62 |

63 |
64 | 65 | 66 | -------------------------------------------------------------------------------- /tools/songs/song/filler.txt: -------------------------------------------------------------------------------- 1 | empty file 2 | -------------------------------------------------------------------------------- /tools/stats/dailyTable.php: -------------------------------------------------------------------------------- 1 |

Daily Levels

2 | 3 | prepare("SELECT feaID, levelID, timestamp FROM dailyfeatures WHERE timestamp < :time ORDER BY feaID DESC"); 8 | $query->execute([':time' => time()]); 9 | $result = $query->fetchAll(); 10 | foreach($result as &$daily){ 11 | //basic daily info 12 | $feaID = $daily["feaID"]; 13 | $levelID = $daily["levelID"]; 14 | $time = $daily["timestamp"]; 15 | echo ""; 16 | //level name 17 | $query = $db->prepare("SELECT levelName, userID FROM levels WHERE levelID = :level"); 18 | $query->execute([':level' => $levelID]); 19 | $level = $query->fetch(); 20 | $levelName = $level["levelName"]; 21 | $userID = $level["userID"]; 22 | echo ""; 23 | //creator name 24 | $query = $db->prepare("SELECT userName FROM users WHERE userID = :userID"); 25 | $query->execute([':userID' => $userID]); 26 | $creator = $query->fetchColumn(); 27 | echo ""; 28 | //timestamp 29 | $time = date("d/m/Y H:i", $time); 30 | echo ""; 31 | } 32 | ?> 33 |
#IDNameCreatorTime
$feaID$levelID$levelName$creator$time
-------------------------------------------------------------------------------- /tools/stats/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/stats/modActions.php: -------------------------------------------------------------------------------- 1 |

Actions Count

2 | 3 | 4 | getAccountsWithPermission("toolModactions")); 10 | if($accounts == ""){ 11 | exit("Error: No accounts with the 'toolModactions' permission have been found"); 12 | } 13 | $query = $db->prepare("SELECT accountID, userName FROM accounts WHERE accountID IN ($accounts) ORDER BY userName ASC"); 14 | $query->execute(); 15 | $result = $query->fetchAll(); 16 | foreach($result as &$mod){ 17 | $query = $db->prepare("SELECT lastPlayed FROM users WHERE extID = :id"); 18 | $query->execute([':id' => $mod["accountID"]]); 19 | $time = date("d/m/Y G:i:s", $query->fetchColumn()); 20 | $query = $db->prepare("SELECT count(*) FROM modactions WHERE account = :id"); 21 | $query->execute([':id' => $mod["accountID"]]); 22 | $actionscount = $query->fetchColumn(); 23 | $query = $db->prepare("SELECT count(*) FROM modactions WHERE account = :id AND type = '1'"); 24 | $query->execute([':id' => $mod["accountID"]]); 25 | $lvlcount = $query->fetchColumn(); 26 | echo ""; 27 | } 28 | ?> 29 |
ModeratorCountLevels ratedLast time online
".$mod["userName"]."".$actionscount."".$lvlcount."".$time."
30 |

Actions Log

31 | 32 | prepare("SELECT * FROM modactions ORDER BY ID DESC"); 34 | $query->execute(); 35 | $result = $query->fetchAll(); 36 | foreach($result as &$action){ 37 | //detecting mod 38 | $account = $action["account"]; 39 | $query = $db->prepare("SELECT userName FROM accounts WHERE accountID = :id"); 40 | $query->execute([':id'=>$account]); 41 | $account = $query->fetchColumn(); 42 | //detecting action 43 | $value = $action["value"]; 44 | $value2 = $action["value2"]; 45 | switch($action["type"]){ 46 | case 1: 47 | $actionname = "Rated a level"; 48 | break; 49 | case 2: 50 | $actionname = "Featured change"; 51 | break; 52 | case 3: 53 | $actionname = "Coins verification state"; 54 | break; 55 | case 4: 56 | $actionname = "Epic change"; 57 | break; 58 | case 5: 59 | $actionname = "Set as daily feature"; 60 | if(is_numeric($value2)){ 61 | $value2 = date("d/m/Y G:i:s", $value2); 62 | } 63 | break; 64 | case 6: 65 | $actionname = "Deleted a level"; 66 | break; 67 | case 7: 68 | $actionname = "Creator change"; 69 | break; 70 | case 8: 71 | $actionname = "Renamed a level"; 72 | break; 73 | case 9: 74 | $actionname = "Changed level password"; 75 | break; 76 | case 10: 77 | $actionname = "Changed demon difficulty"; 78 | break; 79 | case 11: 80 | $actionname = "Shared CP"; 81 | break; 82 | case 12: 83 | $actionname = "Changed level publicity"; 84 | break; 85 | case 13: 86 | $actionname = "Changed level description"; 87 | break; 88 | case 15: 89 | $actionname = "Un/banned a user"; 90 | break; 91 | default: 92 | $actionname = $action["type"]; 93 | break; 94 | } 95 | if($action["type"] == 2 OR $action["type"] == 3 OR $action["type"] == 4 OR $action["type"] == 15){ 96 | if($action["value"] == 1){ 97 | $value = "True"; 98 | }else{ 99 | $value = "False"; 100 | } 101 | } 102 | if($action["type"] == 5 OR $action["type"] == 6){ 103 | $value = ""; 104 | } 105 | $time = date("d/m/Y G:i:s", $action["timestamp"]); 106 | if($action["type"] == 5 AND $action["value2"] > time()){ 107 | echo ""; 108 | }else{ 109 | echo ""; 110 | } 111 | 112 | } 113 | ?> 114 |
ModeratorActionValueValue2LevelIDTime
".$account."".$actionname."".$value."".$value2."future".$time."
".$account."".$actionname."".$value."".$value2."".$action["value3"]."".$time."
-------------------------------------------------------------------------------- /tools/stats/modsList.php: -------------------------------------------------------------------------------- 1 |

VIP List

2 | prepare("SELECT roleID, roleName FROM roles WHERE priority > 0 ORDER BY priority DESC"); 6 | $query->execute(); 7 | $result = $query->fetchAll(); 8 | foreach ($result as $role) { 9 | echo "

" . $role['roleName'] . "

"; 10 | $query2 = $db->prepare("SELECT users.userName, users.lastPlayed FROM roleassign INNER JOIN users ON roleassign.accountID = users.extID WHERE roleassign.roleID = :roleID"); 11 | $query2->execute([':roleID' => $role["roleID"]]); 12 | $account = $query2->fetchAll(); 13 | echo ''; 14 | foreach ($account as $user) { 15 | $time = date("d/m/Y G:i:s", $user["lastPlayed"]); 16 | $username = htmlspecialchars($user["userName"], ENT_QUOTES); 17 | echo ""; 18 | } 19 | echo "
UserLast Online
" . $username . "$time
"; 20 | } 21 | -------------------------------------------------------------------------------- /tools/stats/noLogIn.php: -------------------------------------------------------------------------------- 1 |

Unused Accounts

2 | 3 | prepare("SELECT accountID, userName, registerDate FROM accounts"); 11 | $query->execute(); 12 | $result = $query->fetchAll(); 13 | foreach($result as &$account){ 14 | $query = $db->prepare("SELECT count(*) FROM users WHERE extID = :accountID"); 15 | $query->execute([':accountID' => $account["accountID"]]); 16 | if($query->fetchColumn() == 0){ 17 | $register = date("d/m/Y G:i:s", $account["registerDate"]); 18 | echo ""; 19 | ob_flush(); 20 | flush(); 21 | $time = time() - 2592000; 22 | if($account["registerDate"] < $time){ 23 | echo ""; 24 | } 25 | echo ""; 26 | $x++; 27 | } 28 | } 29 | ?> 30 |
#IDNameRegistration date
$x".$account["accountID"] . "" . $account["userName"] . "$register1
-------------------------------------------------------------------------------- /tools/stats/packTable.php: -------------------------------------------------------------------------------- 1 |

MAP PACKS

2 | 3 | prepare("SELECT * FROM mappacks ORDER BY ID ASC"); 8 | $query->execute(); 9 | $result = $query->fetchAll(); 10 | foreach($result as &$pack){ 11 | $lvlarray = explode(",", $pack["levels"]); 12 | echo ""; 22 | } 23 | /* 24 | GAUNTLETS 25 | */ 26 | ?> 27 |
#IDMap PackStarsCoinsLevels
$x".$pack["ID"]."".htmlspecialchars($pack["name"],ENT_QUOTES)."".$pack["stars"]."".$pack["coins"].""; 13 | $x++; 14 | foreach($lvlarray as &$lvl){ 15 | echo $lvl . " - "; 16 | $query = $db->prepare("SELECT levelName FROM levels WHERE levelID = :levelID"); 17 | $query->execute([':levelID' => $lvl]); 18 | $levelName = $query->fetchColumn(); 19 | echo $levelName . ", "; 20 | } 21 | echo "
28 |

GAUNTLETS

29 | 30 | prepare("SELECT * FROM gauntlets ORDER BY ID ASC"); 34 | $query->execute(); 35 | $result = $query->fetchAll(); 36 | foreach($result as &$gauntlet){ 37 | $gauntletname = "Unknown"; 38 | switch($gauntlet["ID"]){ 39 | case 1: 40 | $gauntletname = "Fire"; 41 | break; 42 | case 2: 43 | $gauntletname = "Ice"; 44 | break; 45 | case 3: 46 | $gauntletname = "Poison"; 47 | break; 48 | case 4: 49 | $gauntletname = "Shadow"; 50 | break; 51 | case 5: 52 | $gauntletname = "Lava"; 53 | break; 54 | case 6: 55 | $gauntletname = "Bonus"; 56 | break; 57 | case 7: 58 | $gauntletname = "Chaos"; 59 | break; 60 | case 8: 61 | $gauntletname = "Demon"; 62 | break; 63 | case 9: 64 | $gauntletname = "Time"; 65 | break; 66 | case 10: 67 | $gauntletname = "Crystal"; 68 | break; 69 | case 11: 70 | $gauntletname = "Magic"; 71 | break; 72 | case 12: 73 | $gauntletname = "Spike"; 74 | break; 75 | case 13: 76 | $gauntletname = "Monster"; 77 | break; 78 | case 14: 79 | $gauntletname = "Doom"; 80 | break; 81 | case 15: 82 | $gauntletname = "Death"; 83 | break; 84 | 85 | } 86 | echo ""; 87 | for ($x = 1; $x < 6; $x++) { 88 | echo ""; 95 | } 96 | echo ""; 97 | } 98 | /* 99 | GAUNTLETS 100 | */ 101 | ?> 102 |
#NameLevel 1Level 2Level 3Level 4Level 5
".$gauntlet["ID"]."".$gauntletname.""; 89 | $lvl = $gauntlet["level".$x]; 90 | echo $lvl . " - "; 91 | $query = $db->prepare("SELECT levelName FROM levels WHERE levelID = :levelID"); 92 | $query->execute([':levelID' => $lvl]); 93 | $levelName = $query->fetchColumn(); 94 | echo "$levelName
-------------------------------------------------------------------------------- /tools/stats/reportList.php: -------------------------------------------------------------------------------- 1 | 2 | prepare("SELECT levelID FROM reports"); 7 | $query->execute(); 8 | $result = $query->fetchAll(); 9 | foreach($result as &$report){ 10 | if(!empty($array[$report["levelID"]])){ 11 | $array[$report["levelID"]]++; 12 | }else{ 13 | $array[$report["levelID"]] = 1; 14 | } 15 | } 16 | arsort($array); 17 | foreach($array as $id => $count){ 18 | echo ""; 19 | } 20 | ?> 21 |
LevelIDReported
".$id."".$count." times
-------------------------------------------------------------------------------- /tools/stats/songList.php: -------------------------------------------------------------------------------- 1 |
2 | Search: 3 |
Search Type: 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | number($_POST['type']); 23 | } else { 24 | $type = 2; 25 | } 26 | switch ($type) { 27 | case 1: 28 | $searchType = "name"; 29 | break; 30 | case 2: 31 | $searchType = "authorName"; 32 | break; 33 | default: 34 | $searchType = "name"; 35 | break; 36 | } 37 | if (isset($_POST['name']) == true) { 38 | $name = $ep->remove($_POST['name']); 39 | } else { 40 | $name = 'reupload'; 41 | } 42 | $query = $db->prepare("SELECT ID,name,authorName,size FROM songs WHERE " . $searchType . " LIKE CONCAT('%', :name, '%') ORDER BY ID DESC LIMIT 5000"); 43 | $query->execute([':name' => $name]); 44 | $result = $query->fetchAll(); 45 | foreach ($result as &$song) { 46 | echo ""; 47 | } 48 | ?> 49 |
IDSong NameSong AuthorSize
" . $song["ID"] . "" . htmlspecialchars($song["name"], ENT_QUOTES) . "" . $song['authorName'] . "" . $song['size'] . "mb
50 | -------------------------------------------------------------------------------- /tools/stats/stats.php: -------------------------------------------------------------------------------- 1 |

Levels

2 | 3 | 4 | prepare("SELECT count(*) FROM levels ".$params4." ".$params2); 9 | $query->execute(); 10 | $row = ""; 11 | $query = $db->prepare("SELECT count(*) FROM levels WHERE starStars = 0 ".$params." ".$params2); 12 | $query->execute(); 13 | $row .= ""; 14 | $query = $db->prepare("SELECT count(*) FROM levels WHERE starStars <> 0 ".$params." ".$params2); 15 | $query->execute(); 16 | $row .= ""; 17 | $query = $db->prepare("SELECT count(*) FROM levels WHERE starFeatured <> 0 ".$params." ".$params2); 18 | $query->execute(); 19 | $row .= ""; 20 | $query = $db->prepare("SELECT count(*) FROM levels WHERE starEpic <> 0 ".$params." ".$params2); 21 | $query->execute(); 22 | $row .= ""; 23 | return $row; 24 | } 25 | //error_reporting(0); 26 | echo genLvlRow("","","Total", ""); 27 | echo genLvlRow("AND","starDifficulty = 0 AND starDemon = 0 AND starAuto = 0 AND unlisted = 0", "N/A", "WHERE"); 28 | echo genLvlRow("AND","starAuto = 1 AND unlisted = 0", "Auto", "WHERE"); 29 | echo genLvlRow("AND","starDifficulty = 10 AND starDemon = 0 AND starAuto = 0 AND unlisted = 0", "Easy", "WHERE"); 30 | echo genLvlRow("AND","starDifficulty = 20 AND starDemon = 0 AND starAuto = 0 AND unlisted = 0", "Normal", "WHERE"); 31 | echo genLvlRow("AND","starDifficulty = 30 AND starDemon = 0 AND starAuto = 0 AND unlisted = 0", "Hard", "WHERE"); 32 | echo genLvlRow("AND","starDifficulty = 40 AND starDemon = 0 AND starAuto = 0 AND unlisted = 0", "Harder", "WHERE"); 33 | echo genLvlRow("AND","starDifficulty = 50 AND starDemon = 0 AND starAuto = 0 AND unlisted = 0", "Insane", "WHERE"); 34 | echo genLvlRow("AND","starDemon = 1", "Demon", "WHERE"); 35 | ?> 36 |
DifficultyTotalUnratedRatedFeaturedEpic
$params3".$query->fetchColumn()."".$query->fetchColumn()."".$query->fetchColumn()."".$query->fetchColumn()."".$query->fetchColumn()."
37 |

Demons

38 | 39 | 40 | 48 |
DifficultyTotalUnratedRatedFeaturedEpic
49 |

Accounts

50 | 51 | 52 | prepare("SELECT count(*) FROM users"); 54 | $query->execute(); 55 | $thing = $query->fetchColumn(); 56 | echo ""; 57 | $query = $db->prepare("SELECT count(*) FROM accounts"); 58 | $query->execute(); 59 | $thing = $query->fetchColumn(); 60 | echo ""; 61 | $sevendaysago = time() - 604800; 62 | $query = $db->prepare("SELECT count(*) FROM users WHERE lastPlayed > :lastPlayed"); 63 | $query->execute([':lastPlayed' => $sevendaysago]); 64 | $thing = $query->fetchColumn(); 65 | echo ""; 66 | ?> 67 |
TypeCount
Total$thing
Registered$thing
Active$thing
68 | -------------------------------------------------------------------------------- /tools/stats/suggestList.php: -------------------------------------------------------------------------------- 1 | remove($_POST["userName"]); 10 | $password = $ep->remove($_POST["password"]); 11 | $generatePass = new generatePass(); 12 | $pass = $generatePass->isValidUsrname($userName, $password); 13 | if ($pass == 1) { 14 | $query = $db->prepare("SELECT accountID FROM accounts WHERE userName=:userName"); 15 | $query->execute([':userName' => $userName]); 16 | $accountID = $query->fetchColumn(); 17 | if($query->rowCount()==0){ 18 | echo "Invalid account/password. Try again."; 19 | }else if($gs->checkPermission($accountID, "toolSuggestlist")){ 20 | $accountID = $query->fetchColumn(); 21 | $query = $db->prepare("SELECT suggestBy,suggestLevelId,suggestDifficulty,suggestStars,suggestFeatured,suggestAuto,suggestDemon,timestamp FROM suggest ORDER BY timestamp DESC"); 22 | $query->execute(); 23 | $result = $query->fetchAll(); 24 | echo ''; 25 | foreach($result as &$sugg){ 26 | echo ""; 27 | } 28 | echo "
TimeSuggested byLevel IDDifficultyStarsFeatured
".date("d/m/Y G:i", $sugg["timestamp"])."".$gs->getAccountName($sugg["suggestBy"])."(".$sugg["suggestBy"].")".htmlspecialchars($sugg["suggestLevelId"],ENT_QUOTES)."".htmlspecialchars($gs->getDifficulty($sugg["suggestDifficulty"],$sugg["suggestAuto"],$sugg["suggestDemon"]), ENT_QUOTES)."".htmlspecialchars($sugg["suggestStars"],ENT_QUOTES)."".htmlspecialchars($sugg["suggestFeatured"],ENT_QUOTES)."
"; 29 | }else{ 30 | echo "You don't have permissions to view content on this page. Try again.\n"; 31 | } 32 | }else{ 33 | echo "Invalid account/password. Try again."; 34 | } 35 | }else{ 36 | echo '
Username: 37 |
Password:
'; 38 | } 39 | ?> 40 | -------------------------------------------------------------------------------- /tools/stats/top24h.php: -------------------------------------------------------------------------------- 1 |

TOP LEADERBOARD PROGRESS

2 | 3 | prepare("SELECT * FROM actions WHERE type = '9' AND timestamp > :time"); 10 | $query->execute([':time' => $time]); 11 | $result = $query->fetchAll(); 12 | foreach($result as &$gain){ 13 | if(!empty($starsgain[$gain["account"]])){ 14 | $starsgain[$gain["account"]] += $gain["value"]; 15 | }else{ 16 | $starsgain[$gain["account"]] = $gain["value"]; 17 | } 18 | } 19 | arsort($starsgain); 20 | foreach ($starsgain as $userID => $stars){ 21 | $query = $db->prepare("SELECT userName, isBanned FROM users WHERE userID = :userID"); 22 | $query->execute([':userID' => $userID]); 23 | $userinfo = $query->fetchAll()[0]; 24 | $username = htmlspecialchars($userinfo["userName"], ENT_QUOTES); 25 | if($userinfo["isBanned"] == 0){ 26 | $x++; 27 | echo ""; 28 | } 29 | } 30 | ?> 31 |
#UserIDUserNameStars
$x$userID$username$stars
-------------------------------------------------------------------------------- /tools/stats/unlisted.php: -------------------------------------------------------------------------------- 1 | remove($_POST["userName"]); 8 | $password = $ep->remove($_POST["password"]); 9 | $generatePass = new generatePass(); 10 | $pass = $generatePass->isValidUsrname($userName, $password); 11 | if ($pass == 1) { 12 | $query = $db->prepare("SELECT accountID FROM accounts WHERE userName=:userName"); 13 | $query->execute([':userName' => $userName]); 14 | if($query->rowCount()==0){ 15 | echo "Invalid password or nonexistant account. Try again"; 16 | }else{ 17 | $accountID = $query->fetchColumn(); 18 | $query = $db->prepare("SELECT levelID, levelName FROM levels WHERE extID=:extID AND unlisted=1"); 19 | $query->execute([':extID' => $accountID]); 20 | $result = $query->fetchAll(); 21 | echo ''; 22 | foreach($result as &$level){ 23 | echo ""; 24 | } 25 | echo "
IDName
".$level["levelID"]."".$level["levelName"]."
"; 26 | } 27 | }else{ 28 | echo "Invalid password or nonexistant account. Try again"; 29 | } 30 | }else{ 31 | echo '
Username: 32 |
Password:
'; 33 | } 34 | ?> -------------------------------------------------------------------------------- /tools/stats/vipList.php: -------------------------------------------------------------------------------- 1 |

VIP List

2 | prepare("SELECT roleID, roleName FROM roles WHERE priority > 0 ORDER BY priority DESC"); 6 | $query->execute(); 7 | $result = $query->fetchAll(); 8 | foreach ($result as $role) { 9 | echo "

" . $role['roleName'] . "

"; 10 | $query2 = $db->prepare("SELECT users.userName, users.lastPlayed FROM roleassign INNER JOIN users ON roleassign.accountID = users.extID WHERE roleassign.roleID = :roleID"); 11 | $query2->execute([':roleID' => $role["roleID"]]); 12 | $account = $query2->fetchAll(); 13 | echo ''; 14 | foreach ($account as $user) { 15 | $time = date("d/m/Y G:i:s", $user["lastPlayed"]); 16 | $username = htmlspecialchars($user["userName"], ENT_QUOTES); 17 | echo ""; 18 | } 19 | echo "
UserLast Online
" . $username . "$time
"; 20 | } 21 | -------------------------------------------------------------------------------- /unblockGJUser20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /updateGJAccSettings20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /updateGJDesc20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /updateGJUserScore.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /updateGJUserScore19.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /updateGJUserScore20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /updateGJUserScore21.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /updateGJUserScore22.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uploadFriendRequest20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uploadGJAccComment20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uploadGJComment.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uploadGJComment19.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uploadGJComment20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uploadGJComment21.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uploadGJLevel.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uploadGJLevel19.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uploadGJLevel20.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uploadGJLevel21.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uploadGJMessage20.php: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------