core8.1.php
Shared decode - view only
27.1 KB
Original Size
4.7 KB
Decoded Size
PHP 8.1
PHP Version
13.0.2
ionCube Version
core8.1.php
<?php
require_once './start.php';
\GameCMS\Foundation\Router::skipBadUrl();
global $host;
global $full_site_host;
global $license_file;
global $temp_license_file;
if (!file_exists($license_file)) {
die('Файл лицензии не обнаружен');
}
$license_code = trim(file_get_contents($license_file));
if (empty($license_code)) {
die('Файл лицензии пуст');
}
$gamma = '';
$length = strlen(base64_decode($license_code));
while (strlen($gamma) < $length) {
$gamma .= substr(pack('H*', sha1('VGSOG2JF82JV94KVSJ3PLM14AZVQ1P' . $gamma . 'BSE5PV4BK58ANVS23JG3O5VJSQ19WJ')), 0, $length > 100 ? 8 : 2);
}
$licenseParts = explode('|', base64_decode($license_code) ^ $gamma);
if (empty($licenseParts[0]) || empty($licenseParts[1]) || empty($licenseParts[2]) || empty($licenseParts[3]) || empty($licenseParts[4])) {
die('Некорректный файл лицензии');
}
if ($licenseParts[2] != getenv($licenseParts[3] . $licenseParts[4])) {
die('Лицензия невалидна');
}
if (!file_exists($temp_license_file)) {
@file_put_contents($temp_license_file, '');
}
if (!is_writable($temp_license_file)) {
die('Нет доступа к записи на файл "' . $temp_license_file . '"');
}
$tempCode = trim(file_get_contents($temp_license_file));
$correctTempCode = md5(date('Y-m-d'));
if (empty($tempCode) || $tempCode != $correctTempCode) {
@file_get_contents('https://gamecms.ru/api-engine.php', false, @stream_context_create(['http' => ['timeout' => @getGameCMSApiTimeout(), 'method' => 'POST', 'header' => 'x-gamecms-client-request: 1', 'content' => @http_build_query(['license' => $license_code, 'action' => 'check'])]]));
file_put_contents($temp_license_file, $correctTempCode);
}
unset($license_code);
unset($tempCode);
unset($licenseParts);
unset($correctTempCode);
$nowTime = time();
$inactiveTime = configs()->inactive_time;
$inactiveUsers = pdo()->query("SELECT user_id FROM users__online WHERE ($nowTime-time)>$inactiveTime")->fetchAll();
foreach ($inactiveUsers as $inactiveUser) {
\GameCMS\Foundation\Users::setLastActivity($inactiveUser['user_id'], date('Y-m-d H:i:s', $nowTime - $inactiveTime));
}
pdo()->exec("DELETE FROM users__online WHERE ($nowTime-time)>$inactiveTime");
$adminsService = new \GameCMS\Services\AdminsService();
$adminsService->removeExpiredAdmins();
if (configs()->date < date('Y-m-d')) {
dell_old_users();
$STH = pdo()->prepare('UPDATE config SET date=:date LIMIT 1');
$STH->execute(['date' => date('Y-m-d')]);
truncateTable('last_online');
$adminsService->notyAdminsAboutExpire();
}
unset($adminsService);
$modulesFiles = '';
$modules = pdo()->query("SELECT * FROM modules WHERE active='1'")->fetchAll();
if (isset($modules[0]['id'])) {
$i = 0;
} else {
$auth_api = configsSecondary();
$vk_groups = explode(',', configs()->vk_group_id);
$vk_admins = explode(',', configs()->vk_admin_id);
$main_admins = explode(',', configsSecondary()->admins_ids);
[$page, $error] = \GameCMS\Foundation\Router::getPage();
if ($error) {
show_error_page();
}
if (!\GameCMS\Foundation\Router::authCheck()) {
show_error_page('not_auth');
}
if (!\GameCMS\Foundation\Router::accessCheck()) {
show_error_page('not_allowed');
}
if ($page->type == 1) {
$tplDir = $_SERVER['DOCUMENT_ROOT'] . '/templates/' . get_template() . '/tpl/';
} else {
$tplDir = $_SERVER['DOCUMENT_ROOT'] . '/templates/admin/tpl/';
}
$tpl = new Template($tplDir);
$tpl->files = $modulesFiles;
require_once $_SERVER['DOCUMENT_ROOT'] . '/' . $page->file;
if ($page->type != 2) {
$gamecmsCopyright = '';
if (configs()->copyright_key != strtoupper(md5('Order!' . $host . 'cop_O_yr_F_ig_F_ht!'))) {
if (strripos(file_get_contents($tpl->dir . 'bottom.tpl'), '{gamecms_copyright}') === false) {
die('Не найден тег копирайта <b>{gamecms_copyright}</b> в bottom.tpl');
}
$gamecmsCopyright = '<div id="copyright"><br>Работает на <a title="Сайт работает на движке GameCMS" href="https://gamecms.ru/" target="_blank">GameCMS</a></div>';
}
$tpl->load_template('bottom.tpl');
$tpl->set('{gamecms_copyright}', $gamecmsCopyright);
$tpl->compile('content');
$tpl->clear();
}
$tpl->set('{content}', $tpl->result['content'], false);
$tpl->load_template('main.tpl');
$tpl->compile('main');
$tpl->show($tpl->result['main']);
$tpl->global_clear();
die();
}
while ($i < count($modules)) {
$hash = strtoupper(substr(strrev(md5($host . $modules[$i]['name'])), 0, 10));
if ($modules[$i]['client_key'] == 'YDHGABATAMKESPCQMP9S' || substr($modules[$i]['client_key'], 0, 10) == $hash) {
$modulesFiles .= $modules[$i]['files'] . "\n";
}
++$i;
}
unset($modules);
Need to decode your own files?
DecodePHP supports IonCube 10-15 with PHP 7.1, 7.2, 7.3, 7.4, 8.1, 8.2, 8.3, and 8.4
Get Started Free