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

Commit

Permalink
Merge branch 'master' into DEV
Browse files Browse the repository at this point in the history
  • Loading branch information
PolarWooolf committed Oct 8, 2016
2 parents e239f1e + 3d9230e commit c1e3200
Show file tree
Hide file tree
Showing 128 changed files with 2,347 additions and 2,003 deletions.
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** : 2.1
- **Version** : 2.5
- **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)
- **Версия** : 2.1
- **Версия** : 2.5
- **Сайт** : [WorldsOfCubes.NET](http://WorldsOfCubes.NET)
- **Вики** : [bitbucket.org/WorldsOfCubes/webmcrex/wiki](http://bitbucket.org/WorldsOfCubes/webmcrex/wiki)

Expand Down
4 changes: 3 additions & 1 deletion upload/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ 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 ^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]
Expand Down Expand Up @@ -55,6 +54,9 @@ 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 ^go/(.*)/$ index.php?mode=$1 [L,NE]
RewriteRule ^go/(.*)$ index.php?mode=$1 [L,NE]

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

RewriteRule ^authenticate$ MineCraft/auth16x.php [L]
Expand Down
16 changes: 8 additions & 8 deletions upload/ik/status.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ function ikSign($params, $ikKey) {
}


$kassaId = trim($_REQUEST['ik_co_id']);
$paymentId = trim(strip_tags($_REQUEST['ik_pm_no']));
$summ = intval($_REQUEST['ik_am']);
$paySystem = trim($_REQUEST['ik_pw_via']);
$payStatus = trim($_REQUEST['ik_inv_st']);
$sign = trim($_REQUEST['ik_sign']);
$ik_payment_timestamp = trim($_REQUEST['ik_inv_prc']);
$kassaId = trim($_POST['ik_co_id']);
$paymentId = trim(strip_tags($_POST['ik_pm_no']));
$summ = intval($_POST['ik_am']);
$paySystem = trim($_POST['ik_pw_via']);
$payStatus = trim($_POST['ik_inv_st']);
$sign = trim($_POST['ik_sign']);
$ik_payment_timestamp = trim($_POST['ik_inv_prc']);
$secretKey = $donate['ik_secret_key'];
// тестирование
if ($donate['ik_testing'] and ($paySystem == "test_interkassa_test_xts")) {
Expand All @@ -38,7 +38,7 @@ function ikSign($params, $ikKey) {

if ($kassaId != $donate['ik_shop_id'])
exit("Неверный ID кассы");
if ($sign != ikSign($_REQUEST, $secretKey)) {
if ($sign != ikSign($_POST, $secretKey)) {
Logs::write($ik_payment_timestamp."\tНеверная подпись: $sign $summ ");
exit("Bad sign");
}
Expand Down
113 changes: 66 additions & 47 deletions upload/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@
MCRAuth::userLoad();


function GetRandomAdvice() {
function GetRandomAdvice()
{
return ($quotes = @file(View::Get('sovet.txt'))) ? $quotes[rand(0, sizeof($quotes) - 1)] : "Советов нет";
}

$addition_events = '';
$content_main = '';
$content_side = '';
$content_js = '';
function LoadTinyMCE() {
function LoadTinyMCE()
{
global $addition_events, $content_js;

if (!file_exists(MCR_ROOT.'instruments/tiny_mce/tinymce.min.js'))
if (!file_exists(MCR_ROOT . 'instruments/tiny_mce/tinymce.min.js'))
return false;

$tmce = 'tinymce.init({';
Expand All @@ -34,17 +36,18 @@ function LoadTinyMCE() {
$tmce .= '});';

$addition_events .= $tmce;
$content_js .= '<script type="text/javascript" src="'.BASE_URL.'instruments/tiny_mce/tinymce.min.js"></script>';
$content_js .= '<script type="text/javascript" src="' . BASE_URL . 'instruments/tiny_mce/tinymce.min.js"></script>';

return true;
}

function InitJS() {
function InitJS()
{
global $addition_events;

$init_js = "var pbm; var way_style = '".DEF_STYLE_URL."'; var cur_style = '".View::GetURL()."'; var base_url = '".BASE_URL."';";
$init_js .= "window.onload = function () { mcr_init(); $('.stt').tooltip(); $('.spp').popover(); $('#datepicker').datepicker(); ".$addition_events." } ";
return '<script type="text/javascript">'.$init_js.'</script>';
$init_js = "var pbm; var way_style = '" . DEF_STYLE_URL . "'; var cur_style = '" . View::GetURL() . "'; var base_url = '" . BASE_URL . "';";
$init_js .= "window.onload = function () { mcr_init(); $('.stt').tooltip(); $('.spp').popover(); $('#datepicker').datepicker(); " . $addition_events . " } ";
return '<script type="text/javascript">' . $init_js . '</script>';
}

$content_advice = GetRandomAdvice();
Expand Down Expand Up @@ -83,11 +86,13 @@ function InitJS() {
echo $html_page;
exit;
}
function accss_deny() {
function accss_deny()
{
show_error('accsess_denied', 'Доступ запрещен');
}

function show_error($html, $page) {
function show_error($html, $page)
{
global $config, $content_js, $content_advice, $content_side, $user, $db;
if (!empty($user)) {
$player = $user->name();
Expand All @@ -105,7 +110,7 @@ function show_error($html, $page) {
$content_menu = $menu->Show();
$content_js .= InitJS();
$mode = 'denied';
$content_main = View::ShowStaticPage($html.'.html');
$content_main = View::ShowStaticPage($html . '.html');
include('./location/side.php');
ob_start();
include View::Get('index.html');
Expand All @@ -119,7 +124,6 @@ function show_error($html, $page) {

$menu = new Menu();


$mode = $config['s_dpage'];

if (isset($_GET['id']) and !isset($_GET['mode']))
Expand All @@ -132,43 +136,58 @@ function show_error($html, $page) {
$mode = $config['s_dpage'];
if ($mode == 'users')
$mode = 'user';
if((!isset($config['debug']) or !$config['debug']) and is_dir(MCR_ROOT.'install')){
if ((!isset($config['debug']) or !$config['debug']) and is_dir(MCR_ROOT . 'install')) {
$content_main = View::ShowStaticPage('remove_install.html', 'other/install/');
$page = lng('REMOVE_INSTALL_FOLDER');
} else
switch ($mode) {
case 'start':
$page = 'Начать игру';
$content_main = View::ShowStaticPage('start_game.html');
break;
case 'register':
case 'restorepassword':
case 'news':
include('./location/news.php');
break;
case 'news_full':
include('./location/news_full.php');
break;
case 'options':
include('./location/options.php');
break;
case 'news_add':
include('./location/news_add.php');
break;
case 'control':
include('./location/admin.php');
break;
default:
if (!preg_match("/^[a-zA-Z0-9_-]+$/", $mode) or !file_exists(MCR_ROOT.'/location/'.$mode.'.php'))
$mode = "404";

include(MCR_ROOT.'/location/'.$mode.'.php');
break;
}
switch ($mode) {
case 'start':
$page = 'Начать игру';
$content_main = View::ShowStaticPage('start_game.html');
break;
case 'register':
case 'restorepassword':
case 'news':
include('./location/news.php');
break;
case 'news_full':
include('./location/news_full.php');
break;
case 'options':
include('./location/options.php');
break;
case 'news_add':
include('./location/news_add.php');
break;
case 'control':
include('./location/admin.php');
break;
default:
if (!file_exists(MCR_ROOT . '/location/' . $mode . '.php')) {
$statpage = $db->execute("SELECT `pages`.*, `{$bd_names['users']}`.`{$bd_users['login']}` as name FROM `{$bd_names['users']}`, `pages` WHERE `url`='{$db->safe($mode)}' AND `{$bd_names['users']}`.`{$bd_users['id']}`=`pages`.`author`");
if ($statpage and $db->num_rows($statpage) == 1) {
$mode = 'statpage';
$statpage = $db->fetch_array($statpage);
ob_start();
include View::Get('statpage.html', 'other/');
$content_main = ob_get_clean();
$menu->SetItemActive($statpage['menu_item']);
$page = $statpage['title'];
} else $mode = "404";
}
if ($mode != 'statpage' && !preg_match("/^[a-zA-Z0-9_-]+$/", $mode)) $mode = "404";
if ($mode != 'statpage') include(MCR_ROOT . '/location/' . $mode . '.php');
break;
}
if ($user and !$user->pass_set()) {
ob_start();
include View::Get('wocpassunset.html', 'other/');
$content_main = ob_get_clean().$content_main;
$content_main = ob_get_clean() . $content_main;
}
if ($user and $user->lvl() >= 15 and !webMCRex::checkVersion()) {
ob_start();
include View::Get('new_ver_availible.html', 'other/');
$content_main = ob_get_clean() . $content_main;
}
$content_menu = $menu->Show();
include('./location/side.php');
Expand All @@ -184,11 +203,11 @@ function show_error($html, $page) {
//$parser = new TemplateParser();
//$html_page = $parser->parse($html_page);
//echo $html_page;
if(isset($config['debug']) and $config['debug']) {
echo (memory_get_usage() - $mem_start)/1024 . "КБ памяти использовано";
echo "\n<br />SQL запросов сделано: ".$queries."\r\n";
if (isset($config['debug']) and $config['debug']) {
echo (memory_get_usage() - $mem_start) / 1024 . "КБ памяти использовано";
echo "\n<br />SQL запросов сделано: " . $queries . "\r\n";
$timer_end = microtime();
$timer_total = round($timer_end - $timer_start, 7);
echo "\n<br />Страница сгенерирована за ".$timer_total." секунд\r\n";
echo "\n<br />Страница сгенерирована за " . $timer_total . " секунд\r\n";
}
?>
1 change: 1 addition & 0 deletions upload/install/CMS/config/config_usual.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
'install' => true,
'p_logic' => 'usual',
'smtp' => false,
'cache_on' => true,
/* action limiter */

'action_log' => false,
Expand Down
Loading

0 comments on commit c1e3200

Please sign in to comment.