Skip to content
This repository has been archived by the owner on Apr 30, 2018. It is now read-only.

Commit

Permalink
Updated to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PolarWooolf committed May 7, 2015
2 parents 7e5fda5 + 78462e4 commit 2df2c58
Show file tree
Hide file tree
Showing 434 changed files with 61,945 additions and 17,442 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@

config.php
log.txt
upload/MineCraft/MinecraftSkins/
upload/MineCraft/MinecraftCloaks/
upload/MineCraft/tmp/skin_buffer/
upload/main.cfg.php
*log.txt
log.txt
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# webMCR

- **Author** : NC22 (modified by WorldsOfCubes Group)
- **Version** : 1.235
- **Version** : 2.0
- **Website** : [WorldsOfCubes.NET](http://WorldsOfCubes.NET)
- **Wiki** : [bitbucket.org/WorldsOfCubes/webmcrex/wiki](http://bitbucket.org/WorldsOfCubes/webmcrex/wiki)

Expand Down
2 changes: 1 addition & 1 deletion README_RUS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# webMCR

- **Автор** : NC22 (modified by WorldsOfCubes Group)
- **Версия** : 1.235
- **Версия** : 2.0
- **Сайт** : [WorldsOfCubes.NET](http://WorldsOfCubes.NET)
- **Вики** : [bitbucket.org/WorldsOfCubes/webmcrex/wiki](http://bitbucket.org/WorldsOfCubes/webmcrex/wiki)

Expand Down
34 changes: 31 additions & 3 deletions upload/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,44 @@ RewriteRule ^category/([^/]+)/?$ index.php?cid=$1 [L,NE]
RewriteRule ^list/([^/]+)/?$ index.php?l=$1 [L,NE]
RewriteRule ^control/([^/]+)/?$ index.php?mode=control&do=$1 [L,NE]

RewriteRule ^get/([^/]+)/?$ action.php?method=download&file=$1 [L,NE]

RewriteRule ^go/([^/]+)/?$ index.php?mode=$1 [L,NE]
RewriteRule ^go/options/([\w]+)/?$ index.php?mode=options&result=$1 [L]

RewriteRule ^go/warnings/([^/]+)/?$ index.php?mode=warnings&user=$1 [L]

RewriteRule ^go/banlist/([^/]+)/?$ index.php?mode=banlist&page=$1 [L,NE]

RewriteRule ^go/user/([^/]+)/?$ index.php?mode=user&page=$1 [L,NE]
RewriteRule ^go/user/search/([^/]+)/?$ index.php?mode=user&search=$1 [L,NE]
RewriteRule ^go/user/search/([^/]+)/([^/]+)/?$ index.php?mode=user&search=$1&do=$2 [L,NE]
RewriteRule ^go/user/profile/([^/]+)/?$ index.php?mode=user&name=$1 [L,NE]

RewriteRule ^go/users/([^/]+)/?$ index.php?mode=user&do=$1 [L,NE]
RewriteRule ^go/users/search/([^/]+)/?$ index.php?mode=user&search=$1 [L,NE]
RewriteRule ^go/users/search/([^/]+)/([^/]+)/?$ index.php?mode=user&search=$1&do=$2 [L,NE]
RewriteRule ^go/users/profile/([^/]+)/?$ index.php?mode=user&do=full&name=$1 [L,NE]

RewriteRule ^go/pm/([^/]+)/?$ index.php?mode=pm&do=$1 [L,NE]
RewriteRule ^go/pm/inbox/([^/]+)/?$ index.php?mode=pm&do=inbox&page=$1 [L,NE]
RewriteRule ^go/pm/outbox/([^/]+)/?$ index.php?mode=pm&do=outbox&page=$1 [L,NE]
RewriteRule ^go/pm/write/([^/]+)/?$ index.php?mode=pm&do=write&name=$1 [L,NE]
RewriteRule ^go/pm/delete/([^/]+)/?$ index.php?mode=pm&do=delete&id=$1 [L,NE]
RewriteRule ^go/pm/view/([^/]+)/?$ index.php?mode=pm&do=view&id=$1 [L,NE]

RewriteRule ^go/forum/([^/]+)/?$ index.php?mode=forum&id=$1 [L,NE]
RewriteRule ^go/forum/mainadd/([^/]+)/?$ index.php?mode=forum&do=mainadd&id=$1 [L,NE]
RewriteRule ^go/forum/view/([^/]+)/([^/]+)/?$ index.php?mode=forum&do=viewforum&id=$1&page=$2 [L,NE]
RewriteRule ^go/forum/add/([^/]+)/?$ index.php?mode=forum&do=add&id=$1 [L,NE]
RewriteRule ^go/forum/view/topic/([^/]+)/([^/]+)/?$ index.php?mode=forum&do=viewtopic&id=$1&page=$2 [L,NE]
RewriteRule ^go/forum/edit/([^/]+)/?$ index.php?mode=forum&do=edit&id=$1 [L,NE]

RewriteRule ^get/([^/]+)/?$ action.php?method=download&file=$1 [L,NE]

RewriteRule ^authenticate$ MineCraft/auth16x.php [L]
RewriteRule ^invalidate$ MineCraft/invalidate16x.php [L]
RewriteRule ^refresh$ MineCraft/refresh16x.php [L]
RewriteRule ^game/joinserver.jsp MineCraft/joinserver.php [L,NE]
RewriteRule ^joinserver.jsp MineCraft/joinserver.php [L,NE]
RewriteRule ^checkserver.jsp MineCraft/checkserver.php [L,NE]

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
Expand Down
55 changes: 28 additions & 27 deletions upload/MineCraft/checkserver.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
<?php

require('../system.php');

if (empty($_GET['user']) or empty($_GET['serverId'])) {
vtxtlog("[checkserver.php] checkserver process [GET parameter empty] [ ".((empty($_GET['user']))? 'LOGIN ':'').((empty($_GET['serverId']))? 'SERVERID ':'')."]");
exit('NO');
vtxtlog("[checkserver.php] checkserver process [GET parameter empty] [ ".((empty($_GET['user'])) ? 'LOGIN ' : '').((empty($_GET['serverId'])) ? 'SERVERID ' : '')."]");
exit('NO');
}
loadTool('user.class.php');
$db = new DB();
$db->connect('checkserver');

$user = $_GET['user'];
$serverid = $_GET['serverId'];

if (!preg_match("/^[a-zA-Z0-9_-]+$/", $user) or !preg_match("/^[a-z0-9_-]+$/", $serverid)) {

vtxtlog("[checkserver.php] error checkserver process [info login ".$user." serverid ".$serverid."]");
exit('NO');
}
loadTool('user.class.php');
BDConnect('checkserver');

$user = $_GET['user'];
$serverid = $_GET['serverId'];

if (!preg_match("/^[a-zA-Z0-9_-]+$/", $user) or
!preg_match("/^[a-z0-9_-]+$/", $serverid)) {

vtxtlog("[checkserver.php] error checkserver process [info login ".$user." serverid ".$serverid."]");
exit('NO');
}

$result = BD("SELECT `{$bd_users['login']}` FROM {$bd_names['users']} WHERE `{$bd_users['login']}`='".TextBase::SQLSafe($user)."' AND `{$bd_users['server']}`='".TextBase::SQLSafe($serverid)."'");

if( mysql_num_rows($result) == 1 ){

$user_login = new User($user,$bd_users['login']);
$user_login->gameLoginConfirm();
vtxtlog("[checkserver.php] Server Test [Success]");
exit('YES');
}

vtxtlog("[checkserver.php] [User not found] User [$user] Server ID [$serverid]");
exit('NO');

$result = $db->execute("SELECT `{$bd_users['login']}` FROM {$bd_names['users']} WHERE `{$bd_users['login']}`='".$db->safe($user)."' AND `{$bd_users['server']}`='".$db->safe($serverid)."'");

if ($db->num_rows($result) == 1) {

$user_login = new User($user, $bd_users['login']);
$user_login->gameLoginConfirm();
vtxtlog("[checkserver.php] Server Test [Success]");
exit('YES');
}

vtxtlog("[checkserver.php] [User not found] User [$user] Server ID [$serverid]");
exit('NO');
?>
86 changes: 44 additions & 42 deletions upload/MineCraft/connect.php
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
<?php
if(!defined('INCLUDE_CHECK')) die("You don't have permissions to run this");
/* Метод хеширования пароля для интеграции с различними плагинами/сайтами/cms/форумами
'hash_md5' - md5 хеширование
'hash_authme' - интеграция с плагином AuthMe
'hash_cauth' - интеграция с плагином Cauth
'hash_xauth' - интеграция с плагином xAuth
'hash_joomla' - интеграция с Joomla (v1.6- v1.7)
'hash_ipb' - интеграция с IPB
'hash_xenforo' - интеграция с XenForo
'hash_wordpress' - интеграция с WordPress
'hash_vbulletin' - интеграция с vBulletin
'hash_dle' - интеграция с DLE
'hash_drupal' - интеграция с Drupal (v.7)
'hash_launcher' - интеграция с лаунчером sashok724 (Регистрация через лаунчер)
*/
require('../system.php');
BDConnect('auth');
$crypt = 'hash_md5';

$db_host = $config['db_host']; // Ip-адрес MySQL
$db_port = $config['db_port']; // Порт базы данных
$db_user = $config['db_login']; // Пользователь базы данных
$db_pass = $config['db_passw']; // Пароль базы данных
$db_database = $config['db_name']; //База данных

$db_table = $bd_names['users']; //Таблица с пользователями
$db_group = $bd_users['group']; //Для webmcr (минификс)
$db_columnId = $bd_users['id']; //Колонка с ID пользователей
$db_columnUser = $bd_users['login']; //Колонка с именами пользователей
$db_columnPass = $bd_users['password']; //Колонка с паролями пользователей
$db_tableOther = 'xf_user_authenticate'; //Дополнительная таблица для XenForo, не трогайте
$db_columnSesId = $bd_users['session']; //Колонка с сессиями пользователей, не трогайте
$db_columnServer = $bd_users['server']; //Колонка с серверами пользователей, не трогайтe
$db_columnSalt = 'members_pass_salt'; //Настраивается для IPB и vBulletin: , IPB - members_pass_salt, vBulletin - salt
$db_columnIp = $bd_users['ip']; //Колонка с IP пользователей

$db_columnDatareg = $bd_users['ctime']; // Колонка даты регистрации
$db_columnMail = $bd_users['email']; // Колонка mail

$masterversion = sqlConfigGet('launcher-version'); //Мастер-версия лаунчера
$protectionKey = sqlConfigGet('protection-key'); //Ключ защиты сессии. Никому его не говорите.
if (!defined('INCLUDE_CHECK'))
die("You don't have permissions to run this");
/* Метод хеширования пароля для интеграции с различними плагинами/сайтами/cms/форумами
'hash_md5' - md5 хеширование
'hash_authme' - интеграция с плагином AuthMe
'hash_cauth' - интеграция с плагином Cauth
'hash_xauth' - интеграция с плагином xAuth
'hash_joomla' - интеграция с Joomla (v1.6- v1.7)
'hash_ipb' - интеграция с IPB
'hash_xenforo' - интеграция с XenForo
'hash_wordpress' - интеграция с WordPress
'hash_vbulletin' - интеграция с vBulletin
'hash_dle' - интеграция с DLE
'hash_drupal' - интеграция с Drupal (v.7)
'hash_launcher' - интеграция с лаунчером sashok724 (Регистрация через лаунчер)
*/
require('../system.php');
$db = new DB();
$db->connect('auth');
$crypt = 'hash_md5';

$usecheck = true; //Можно ли использовать регистрацию в лаунчере
$db_host = $config['db_host']; // Ip-адрес MySQL
$db_port = $config['db_port']; // Порт базы данных
$db_user = $config['db_login']; // Пользователь базы данных
$db_pass = $config['db_passw']; // Пароль базы данных
$db_database = $config['db_name']; //База данных

$db_table = $bd_names['users']; //Таблица с пользователями
$db_group = $bd_users['group']; //Для webmcr (минификс)
$db_columnId = $bd_users['id']; //Колонка с ID пользователей
$db_columnUser = $bd_users['login']; //Колонка с именами пользователей
$db_columnPass = $bd_users['password']; //Колонка с паролями пользователей
$db_tableOther = 'xf_user_authenticate'; //Дополнительная таблица для XenForo, не трогайте
$db_columnSesId = $bd_users['session']; //Колонка с сессиями пользователей, не трогайте
$db_columnServer = $bd_users['server']; //Колонка с серверами пользователей, не трогайтe
$db_columnSalt = 'members_pass_salt'; //Настраивается для IPB и vBulletin: , IPB - members_pass_salt, vBulletin - salt
$db_columnIp = $bd_users['ip']; //Колонка с IP пользователей

$db_columnDatareg = $bd_users['ctime']; // Колонка даты регистрации
$db_columnMail = $bd_users['email']; // Колонка mail

$masterversion = sqlConfigGet('launcher-version'); //Мастер-версия лаунчера
$protectionKey = sqlConfigGet('protection-key'); //Ключ защиты сессии. Никому его не говорите.

$usecheck = true; //Можно ли использовать регистрацию в лаунчере
?>
41 changes: 20 additions & 21 deletions upload/MineCraft/h.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
<?php
error_reporting(0);
define('INCLUDE_CHECK',true);
include ("connect.php");
@$user = mysql_real_escape_string($_GET['username']);
@$serverid = mysql_real_escape_string($_GET['serverId']);

if (!preg_match("/^[a-zA-Z0-9_-]+$/", $user) || !preg_match("/^[a-zA-Z0-9_-]+$/", $serverid)){
error_reporting(0);
define('INCLUDE_CHECK', true);
include("connect.php");
@$user = $db->safe($_GET['username']);
@$serverid = $db->safe($_GET['serverId']);

if (!preg_match("/^[a-zA-Z0-9_-]+$/", $user) || !preg_match("/^[a-zA-Z0-9_-]+$/", $serverid)) {

echo '{"error":"Bad login","errorMessage":"Bad login"}';

echo '{"error":"Bad login","errorMessage":"Bad login"}';

exit;
}
}

$query = $db->execute("Select $db_columnUser From $db_table Where $db_columnUser='$user'") or die ("Ошибка");
$row = $db->fetch_assoc($query);
$realUser = $row[$db_columnUser];

$query = mysql_query("Select $db_columnUser From $db_table Where $db_columnUser='$user'") or die ("Ошибка");
$row = mysql_fetch_assoc($query);
$realUser = $row[$db_columnUser];
if ($user !== $realUser) {
exit ('{"error":"Bad login","errorMessage":"Bad login"}');
}

if ($user !== $realUser)
{
exit ('{"error":"Bad login","errorMessage":"Bad login"}');
}

$result = mysql_query("Select $db_columnUser From $db_table Where $db_columnUser='$user' And $db_columnServer='$serverid'") or die (mysql_error());
$result = $db->execute("Select $db_columnUser From $db_table Where $db_columnUser='$user' And $db_columnServer='$serverid'") or die ($db->error());

if(mysql_num_rows($result) == 1) echo '{"id":"ok"}';
else echo '{"error":"Bad login","errorMessage":"Bad login"}';
if ($db->num_rows($result) == 1)
echo '{"id":"ok"}'; else echo '{"error":"Bad login","errorMessage":"Bad login"}';
?>
56 changes: 27 additions & 29 deletions upload/MineCraft/j.php
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
<?php
define('INCLUDE_CHECK',true);
define('INCLUDE_CHECK', true);
include("connect.php");
//include("loger.php");
if (($_SERVER['REQUEST_METHOD'] == 'POST' ) && (stripos($_SERVER["CONTENT_TYPE"], "application/json") === 0)) {
$json = json_decode($HTTP_RAW_POST_DATA);

if (($_SERVER['REQUEST_METHOD'] == 'POST') && (stripos($_SERVER["CONTENT_TYPE"], "application/json") === 0)) {
$json = json_decode($HTTP_RAW_POST_DATA);
} else {

}

@$aT = $json->accessToken; @$sP = @$json->selectedProfile; @$sI = $json->serverId;
@$user = mysql_real_escape_string($aT);
@$sessionid = mysql_real_escape_string($sP);
@$serverid = mysql_real_escape_string($sI);
@$aT = $json->accessToken;
@$sP = @$json->selectedProfile;
@$sI = $json->serverId;
@$user = $db->safe($aT);
@$sessionid = $db->safe($sP);
@$serverid = $db->safe($sI);
//$logger->WriteLine($user.' '.$sessionid.' '.$serverid);

if (!preg_match("/^[a-zA-Z0-9_-]+$/", $user) || !preg_match("/^[a-zA-Z0-9:_-]+$/", $sessionid) || !preg_match("/^[a-zA-Z0-9_-]+$/", $serverid)){
if (!preg_match("/^[a-zA-Z0-9_-]+$/", $user) || !preg_match("/^[a-zA-Z0-9:_-]+$/", $sessionid) || !preg_match("/^[a-zA-Z0-9_-]+$/", $serverid)) {

echo '{"error":"Bad login","errorMessage":"Bad login"}';
exit;
echo '{"error":"Bad login","errorMessage":"Bad login"}';
exit;
}

$query = mysql_query("Select $db_columnUser From $db_table Where $db_columnUser='$user'") or die ("Ошибка");
$row = mysql_fetch_assoc($query);
$realUser = $row[$db_columnUser];

if ($user !== $realUser)
{
exit ('{"error":"Bad login","errorMessage":"Bad login"}');
}

$result = mysql_query("Select $db_columnUser From $db_table Where $db_columnSesId='$sessionid' And $db_columnUser='$user' And $db_columnServer='$serverid'") or die ("Ошибка");
if(mysql_num_rows($result) == 1) echo '{"id":"ok"}';
else
{
$result = mysql_query("Update $db_table SET $db_columnServer='$serverid' Where $db_columnSesId='$sessionid' And $db_columnUser='$user'") or die ("Ошибка");
if(mysql_affected_rows() == 1) echo '{"id":"ok"}';
else echo '{"error":"Bad login","errorMessage":"Bad login"}';
}
$query = $db->execute("Select $db_columnUser From $db_table Where $db_columnUser='$user'") or die ("Ошибка");
$row = $db->fetch_assoc($query);
$realUser = $row[$db_columnUser];

if ($user !== $realUser) {
exit ('{"error":"Bad login","errorMessage":"Bad login"}');
}

$result = $db->execute("Select $db_columnUser From $db_table Where $db_columnSesId='$sessionid' And $db_columnUser='$user' And $db_columnServer='$serverid'") or die ("Ошибка");
if ($db->num_rows($result) == 1)
echo '{"id":"ok"}'; else {
$result = $db->execute("Update $db_table SET $db_columnServer='$serverid' Where $db_columnSesId='$sessionid' And $db_columnUser='$user'") or die ("Ошибка");
if ($db->affected_rows() == 1)
echo '{"id":"ok"}'; else echo '{"error":"Bad login","errorMessage":"Bad login"}';
}
?>
Loading

0 comments on commit 2df2c58

Please sign in to comment.