mhmcr /mcsrv/checkserver.php

Language PHP Lines 34
MD5 Hash 1ed459d54106a346a425d8423ae67b3e Estimated Cost $728 (why?)
Repository https://bitbucket.org/mhell/mhmcr.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
	require_once('../system.php');
	$str = '';
	if (!empty($_GET['user']) and !empty($_GET['serverId'])) {
		$user     = mysql_real_escape_string($_GET['user']);
		$serverid = mysql_real_escape_string($_GET['serverId']);
		if (!preg_match("/^[a-zA-Z0-9_-]+$/", $user)) {
			$str = "Server Test [Bad symbols Login] ";
			echo "NO";
		} elseif (!preg_match("/^[a-z0-9_-]+$/", $serverid)) {
			$str = "Server Test [Bad symbols ServerId] ";
			echo "NO";
		} else {
			$result = mysql_query("SELECT ".$db['users']['username']." FROM ".$db['tables']['users']." WHERE ".$db['users']['username']."='$user' AND ".$db['users']['server']."='$serverid'");
			if (mysql_num_rows($result) == 1) {
				$user_login = new User($user, $db['users']['username']);
				$user_login->gameLoginConfirm();
				$str = "Server Test [Success]";
				echo "YES";
			} else {
				$str = "Server Test [User not found] User [$user] Server ID [$serverid]";
				echo "NO";
			}
		}
	} else {
		$str = "Server Test [GET parameter empty] ";
		if (empty($_GET['user']))
			$str .= "USER parameter is empty | ";
		if (empty($_GET['serverId']))
			$str .= "SERVERID parameter is empty";
		echo "NO";
	}
	vtxtlog($str);
?>
Back to Top