| Server IP : 85.158.181.41 / Your IP : 216.73.217.12 Web Server : Apache System : Linux cloud9-vm129 6.1.178+1-ph #ph SMP PREEMPT_DYNAMIC Wed Jul 29 09:00:54 UTC 2026 x86_64 User : moncbefd ( 1024) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/moncbefd/www.moneta.at/admin/includes/modules/ |
Upload File : |
<?php
/* --------------------------------------------------------------
security_check.php 2018-10-09
Gambio GmbH
http://www.gambio.de
Copyright (c) 2018 Gambio GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
based on:
(c) 2003 nextcommerce (security_check.php,v 1.2 2003/08/23); www.nextcommerce.org
(c) 2003 XT-Commerce - community made shopping http://www.xt-commerce.com ($Id: security_check.php 1221 2005-09-20 16:44:09Z mz $)
Released under the GNU General Public License
--------------------------------------------------------------*/
defined('_VALID_XTC') or die('Direct Access to this location is not allowed.');
$securityCheckFile = new SecurityCheckCache($_SERVER['HTTP_USER_AGENT']);
try {
$securityCheckNecessary = $securityCheckFile->validCacheFileExists() === false;
} catch (Exception $exception) {
$securityCheckNecessary = true;
}
if ($securityCheckNecessary === false) {
return;
}
$file_warning = '';
$obsolete_warning = '';
$configurationStorage = CronjobServiceFactory::createCronjobConfigurationStorage();
$shouldReadonlyList = null;
$notWritableList = null;
if($configurationStorage->get('CheckPermissions', 'active'))
{
$dataCache = DataCache::get_instance();
$shouldReadonlyList = $dataCache->get_persistent_data('should-readonly-list');
$notWritableList = $dataCache->get_persistent_data('not-writable-list');
// create cache, if not exits
if($shouldReadonlyList === null)
{
$shouldReadonlyList = SecurityCheck::getInvalidPermissionsNonWritableList();
$dataCache->write_persistent_data('should-readonly-list', $shouldReadonlyList);
}
// create cache, if not exits
if($notWritableList === null)
{
$notWritableList = SecurityCheck::getInvalidPermissionsWritableList();
$dataCache->write_persistent_data('not-writable-list', $notWritableList);
}
}
else
{
$dataCache = DataCache::get_instance();
$lastPermissionsCheck = $dataCache->get_persistent_data('last-permissions-check');
if($lastPermissionsCheck === null)
{
$lastPermissionsCheck = new DateTime();
$dataCache->write_persistent_data('last-permissions-check', $lastPermissionsCheck);
}
$now = new DateTime();
if($lastPermissionsCheck <= $now->modify('-12 hour'))
{
$shouldReadonlyList = $dataCache->get_persistent_data('should-readonly-list');
$notWritableList = $dataCache->get_persistent_data('not-writable-list');
// create cache, if not exits
if($shouldReadonlyList === null)
{
$shouldReadonlyList = SecurityCheck::getInvalidPermissionsNonWritableList();
$dataCache->write_persistent_data('should-readonly-list', $shouldReadonlyList);
}
// create cache, if not exits
if($notWritableList === null)
{
$notWritableList = SecurityCheck::getInvalidPermissionsWritableList();
$dataCache->write_persistent_data('not-writable-list', $notWritableList);
}
}
}
SecurityCheck::checkNonWritableList($messageStack, $shouldReadonlyList);
SecurityCheck::checkWritableList($messageStack, $notWritableList);
SecurityCheck::checkHtaccessVersion($messageStack);
if(ini_get('register_globals'))
{
$messageStack->add(TEXT_REGISTER_GLOBAL, 'error');
}
// check if robots.txt obsolete
require_once(DIR_FS_CATALOG . 'gm/inc/get_robots.php');
$check_robots_result = check_robots(DIR_WS_CATALOG);
if(!$check_robots_result)
{
$obsolete_warning .= '<br>' . HTTP_SERVER . '/robots.txt - <a href="' . DIR_WS_ADMIN
. 'robots_download.php">download robots.txt</a>';
}
// if any file obsolete
if($obsolete_warning != '')
{
$messageStack->add(TEXT_OBSOLETE_WARNING . '<b>' . $obsolete_warning . '</b>', 'error');
}
// memory_limit to low
if($t_memory_limit_ok === false && ini_get('memory_limit') !== '-1')
{
$messageStack->add(sprintf(TEXT_MEMORY_LIMIT_WARNING, $t_memory_limit), 'error');
}
$payment_query = xtc_db_query("SELECT * FROM " . TABLE_CONFIGURATION . "
WHERE
configuration_key = 'MODULE_PAYMENT_INSTALLED'");
$payment_modules_result = xtc_db_fetch_array($payment_query);
$payment_modules = [];
if(!empty($payment_modules_result['configuration_value']))
{
$payment_modules = array_flip(explode(';', $payment_modules_result['configuration_value']));
}
if(array_key_exists('gambio_hub.php', $payment_modules))
{
unset($payment_modules['gambio_hub.php']);
}
if(!count($payment_modules)
&& (!defined('MODULE_PAYMENT_GAMBIO_HUB_STATUS') || MODULE_PAYMENT_GAMBIO_HUB_STATUS !== 'True'))
{
$messageStack->add(sprintf(TEXT_PAYMENT_ERROR, xtc_href_link('admin.php', 'do=HubConfiguration/PaymentMethods')), 'warning');
}
$shipping_query = xtc_db_query("SELECT * FROM " . TABLE_CONFIGURATION . "
WHERE
configuration_key = 'MODULE_SHIPPING_INSTALLED' AND
configuration_value = ''");
if(xtc_db_num_rows($shipping_query))
{
$messageStack->add(sprintf(TEXT_SHIPPING_ERROR, xtc_href_link('modules.php', 'set=shipping')), 'warning');
}
PayPalDeprecatedCheck::ppDeprecatedCheck($messageStack);
$securityCheckFile->storeCacheFile();