From: Roland Häder Date: Tue, 16 Sep 2008 08:55:47 +0000 (+0000) Subject: Security line in all includes changed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=963e55ca1ea79e255f235e359cde9f7862191dc5;p=mailer.git Security line in all includes changed --- diff --git a/.gitattributes b/.gitattributes index d79865ca93..12f352f3c8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -225,6 +225,7 @@ inc/loader/load_cache-config.php -text inc/loader/load_cache-modreg.php -text inc/loader/load_cache-refdepths.php -text inc/loader/load_cache-refsystem.php -text +inc/loader/load_cache-them.php -text inc/mails/.htaccess -text inc/mails/_mails.php -text inc/mails/beg_mails.php -text @@ -370,12 +371,9 @@ inc/modules/admin/what-overview.php -text inc/modules/admin/what-payments.php -text inc/modules/admin/what-refbanner.php -text inc/modules/admin/what-repair_amenu.php -text -inc/modules/admin/what-repair_amnu.php -text inc/modules/admin/what-repair_cats.php -text inc/modules/admin/what-repair_gmenu.php -text -inc/modules/admin/what-repair_gmnu.php -text inc/modules/admin/what-repair_mmenu.php -text -inc/modules/admin/what-repair_mmnu.php -text inc/modules/admin/what-send_bonus.php -text inc/modules/admin/what-send_newsletter.php -text inc/modules/admin/what-stats_mods.php -text diff --git a/inc/autopurge.php b/inc/autopurge.php index c01be28363..f3b1af8477 100644 --- a/inc/autopurge.php +++ b/inc/autopurge.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // END - if diff --git a/inc/autopurge/purge- b/inc/autopurge/purge- index 7c830194c2..ff9a9afdc2 100644 --- a/inc/autopurge/purge- +++ b/inc/autopurge/purge- @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // END - if diff --git a/inc/autopurge/purge-general.php b/inc/autopurge/purge-general.php index 95a88e9a7b..3ee13256e9 100644 --- a/inc/autopurge/purge-general.php +++ b/inc/autopurge/purge-general.php @@ -33,7 +33,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/autopurge/purge-inact.php b/inc/autopurge/purge-inact.php index ee36736c00..053148b5e5 100644 --- a/inc/autopurge/purge-inact.php +++ b/inc/autopurge/purge-inact.php @@ -32,16 +32,16 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} +} // END - if // Abort if autopurge is not active or disabled by admin if ((!EXT_IS_ACTIVE("autopurge")) || ($_CONFIG['auto_purge_active'] == "N")) { // Abort here return false; -} +} // END - if // Shall I look for inactive accounts and autopurge inactive accounts? if ($_CONFIG['ap_inactive'] == "Y") { diff --git a/inc/autopurge/purge-mails.php b/inc/autopurge/purge-mails.php index ccedb84110..6d49f08fab 100644 --- a/inc/autopurge/purge-mails.php +++ b/inc/autopurge/purge-mails.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // END - if diff --git a/inc/autopurge/purge-tsks.php b/inc/autopurge/purge-tsks.php index e862111a45..a2a9038b12 100644 --- a/inc/autopurge/purge-tsks.php +++ b/inc/autopurge/purge-tsks.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // END - if diff --git a/inc/autopurge/purge-unconfirmed.php b/inc/autopurge/purge-unconfirmed.php index dd6c7fedee..65219b2d73 100644 --- a/inc/autopurge/purge-unconfirmed.php +++ b/inc/autopurge/purge-unconfirmed.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // END - if diff --git a/inc/check-reset.php b/inc/check-reset.php index 0f13b5ff84..65a01d2998 100644 --- a/inc/check-reset.php +++ b/inc/check-reset.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/databases.php b/inc/databases.php index 4084010844..a6509b16ac 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -114,7 +113,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "335"); +define('CURR_SVN_REVISION', "336"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index f09301c9b4..0109f4e0e4 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/db/lib.php b/inc/db/lib.php index 5d9a30891e..7578d60770 100644 --- a/inc/db/lib.php +++ b/inc/db/lib.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/doubler_send.php b/inc/doubler_send.php index 1fe8475e0f..782af6b03d 100644 --- a/inc/doubler_send.php +++ b/inc/doubler_send.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions.php b/inc/extensions.php index c7d794ada4..969d861709 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false) { @@ -200,6 +200,9 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false) // Update task management ADMIN_SOLVE_TASK($id); + // @TODO This causes the whole (!) menu cache being purged + CACHE_PURGE_ADMIN_MENU(); + // In normal mode return a true on success $ret = true; @@ -302,6 +305,9 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) { if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy(); if ($cacheInstance->cache_file("mod_reg", true)) $cacheInstance->cache_destroy(); if ($cacheInstance->cache_file("config", true)) $cacheInstance->cache_destroy(); + + // @TODO This causes the whole (!) menu cache being purged + CACHE_PURGE_ADMIN_MENU(); } // END - if // Is this the sql_patches? diff --git a/inc/extensions/ext- b/inc/extensions/ext- index ebada93095..4b23438fb2 100644 --- a/inc/extensions/ext- +++ b/inc/extensions/ext- @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-active.php b/inc/extensions/ext-active.php index 7ede8afbbd..3891b61ff2 100644 --- a/inc/extensions/ext-active.php +++ b/inc/extensions/ext-active.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index 89d634fb7a..45963b297d 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-admintheme1.php b/inc/extensions/ext-admintheme1.php index 53c0a64387..1118d05192 100644 --- a/inc/extensions/ext-admintheme1.php +++ b/inc/extensions/ext-admintheme1.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-admintheme_default.php b/inc/extensions/ext-admintheme_default.php index 97517cc383..9d997f8874 100644 --- a/inc/extensions/ext-admintheme_default.php +++ b/inc/extensions/ext-admintheme_default.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-autopurge.php b/inc/extensions/ext-autopurge.php index 6a8ee9dcd3..39631aef9d 100644 --- a/inc/extensions/ext-autopurge.php +++ b/inc/extensions/ext-autopurge.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-bank.php b/inc/extensions/ext-bank.php index 0d9a836402..79605267d8 100644 --- a/inc/extensions/ext-bank.php +++ b/inc/extensions/ext-bank.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php index d9d4a9a23c..e50d0aeb6a 100644 --- a/inc/extensions/ext-beg.php +++ b/inc/extensions/ext-beg.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-birthday.php b/inc/extensions/ext-birthday.php index 1893fec46f..293531b5ca 100644 --- a/inc/extensions/ext-birthday.php +++ b/inc/extensions/ext-birthday.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index c7985b1a27..caff4d6560 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -52,7 +51,7 @@ switch ($EXT_LOAD_MODE) case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called) // SQL commands to run $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu VALUES (NULL,'email','send_bonus','Bonusmail senden',5,'Versenden Sie hier Bonus-Mails an alle Mitglieder oder nur an alle aus einer Kategorie. Es spielt keine Rolle, wie viele Mails bereits versendet worden, Sie können hier immer senden.')"; - $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu VALUES (NULL,'main','bonus','Bonuspunkte',7,'Y','Y', '', 0)"; + $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu VALUES (NULL,'main','bonus','Bonuspunkte',7,'Y','Y','', 0)"; $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_bonus"; $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_bonus ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php index bf11d0da1f..e7177b682a 100644 --- a/inc/extensions/ext-cache.php +++ b/inc/extensions/ext-cache.php @@ -33,20 +33,19 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // Version number -$EXT_VERSION = "0.1.7"; +$EXT_VERSION = "0.1.8"; // Auto-set extension version if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION; // Version history array (add more with , "0.1" and so on) -$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7"); +$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8"); switch ($EXT_LOAD_MODE) { @@ -177,6 +176,13 @@ case "update": // Update an extension // Update notes (these will be set as task text!) $UPDATE_NOTES = "CSS-Klassenname gefixt in Templates."; break; + + case "0.1.8": // SQL queries for v0.1.8 + $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD cache_theme ENUM('Y', 'N') NOT NULL DEFAULT 'Y'"; + + // Update notes (these will be set as task text!) + $UPDATE_NOTES = "Daten von installierten Themes werden nun gecacht."; + break; } break; @@ -185,8 +191,7 @@ default: // Do stuff when extension is loaded if ($cacheMode != "init") { // Initialize cache system only when it's needed $cacheInstance = new mxchange_cache($_CONFIG['cache_update'], PATH."inc/".$_CONFIG['cache_path'], $_CONFIG['cache_tested']); - if ($cacheInstance->ret != "done") - { + if ($cacheInstance->ret != "done") { // Failed to initialize cache sustem ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_CANNOT_INITIALIZE); } diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php index 10af68b4f7..33b40947d5 100644 --- a/inc/extensions/ext-country.php +++ b/inc/extensions/ext-country.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-demo.php b/inc/extensions/ext-demo.php index 264b3aba70..916b0ad196 100644 --- a/inc/extensions/ext-demo.php +++ b/inc/extensions/ext-demo.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index 7839778c9b..e4126862d7 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index 30c04ad8ee..7b6c0aeb7e 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-html_mail.php b/inc/extensions/ext-html_mail.php index 6ffd774e15..3669fb8fc4 100644 --- a/inc/extensions/ext-html_mail.php +++ b/inc/extensions/ext-html_mail.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-mailid.php b/inc/extensions/ext-mailid.php index b1bf0842e3..4848fd75d1 100644 --- a/inc/extensions/ext-mailid.php +++ b/inc/extensions/ext-mailid.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-maintenance.php b/inc/extensions/ext-maintenance.php index 6609192764..dbb32a3116 100644 --- a/inc/extensions/ext-maintenance.php +++ b/inc/extensions/ext-maintenance.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-mediadata.php b/inc/extensions/ext-mediadata.php index ab2cc1c989..e9d21a7cd3 100644 --- a/inc/extensions/ext-mediadata.php +++ b/inc/extensions/ext-mediadata.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-mods.php b/inc/extensions/ext-mods.php index 885eb87445..417b987976 100644 --- a/inc/extensions/ext-mods.php +++ b/inc/extensions/ext-mods.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-mydata.php b/inc/extensions/ext-mydata.php index 389258d83e..0eaf6a2191 100644 --- a/inc/extensions/ext-mydata.php +++ b/inc/extensions/ext-mydata.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index 331f0853ee..c46af9d16b 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-nickname.php b/inc/extensions/ext-nickname.php index a174948a47..a5ec734bf7 100644 --- a/inc/extensions/ext-nickname.php +++ b/inc/extensions/ext-nickname.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -199,7 +198,7 @@ PRIMARY KEY(id) break; default: // Do stuff when extension is loaded - // DEPRECATED WAY - PLEASE REWRITE IT + // @TODO|@DEPRECATED Please rewrite these constants, LOAD_CONFIG() is no more needed in extensions $dummy = LOAD_CONFIG(); define('__NICKNAME_LANG_CHARS', $dummy['nickname_chars']); define('__NICKNAME_LENGTH' , $dummy['nickname_len']); diff --git a/inc/extensions/ext-online.php b/inc/extensions/ext-online.php index b08ea40e94..92e91571e6 100644 --- a/inc/extensions/ext-online.php +++ b/inc/extensions/ext-online.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-optimize.php b/inc/extensions/ext-optimize.php index fe54048880..00a3528220 100644 --- a/inc/extensions/ext-optimize.php +++ b/inc/extensions/ext-optimize.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index bed01eaf14..537f7b36cd 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-other.php b/inc/extensions/ext-other.php index 1c7fc2bff0..c365f2cf55 100644 --- a/inc/extensions/ext-other.php +++ b/inc/extensions/ext-other.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-payout.php b/inc/extensions/ext-payout.php index 6f7b2d7163..dfaf38b4b9 100644 --- a/inc/extensions/ext-payout.php +++ b/inc/extensions/ext-payout.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-primera.php b/inc/extensions/ext-primera.php index 631f96e5a6..e8fdb16d5a 100644 --- a/inc/extensions/ext-primera.php +++ b/inc/extensions/ext-primera.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-profile.php b/inc/extensions/ext-profile.php index 6173b778f1..42c499227e 100644 --- a/inc/extensions/ext-profile.php +++ b/inc/extensions/ext-profile.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php index e5406153ff..6b62de5e83 100644 --- a/inc/extensions/ext-rallye.php +++ b/inc/extensions/ext-rallye.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-register.php b/inc/extensions/ext-register.php index 1d510b728d..d334f152bd 100644 --- a/inc/extensions/ext-register.php +++ b/inc/extensions/ext-register.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-repair.php b/inc/extensions/ext-repair.php index d5b141f351..95d5801787 100644 --- a/inc/extensions/ext-repair.php +++ b/inc/extensions/ext-repair.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-rewrite.php b/inc/extensions/ext-rewrite.php index 28c623aa44..3c21b41f6f 100644 --- a/inc/extensions/ext-rewrite.php +++ b/inc/extensions/ext-rewrite.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-safe.php b/inc/extensions/ext-safe.php index 8fb3f79e94..4a02e0f4e8 100644 --- a/inc/extensions/ext-safe.php +++ b/inc/extensions/ext-safe.php @@ -33,7 +33,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index 35abe65905..3e816331c7 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -31,8 +31,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 33dc3c9836..d354faa54c 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-support.php b/inc/extensions/ext-support.php index d7ae7b2853..ccfe197467 100644 --- a/inc/extensions/ext-support.php +++ b/inc/extensions/ext-support.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 0376697a70..5930c2714c 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-task.php b/inc/extensions/ext-task.php index 8583b07370..c2d909b568 100644 --- a/inc/extensions/ext-task.php +++ b/inc/extensions/ext-task.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-theme.php b/inc/extensions/ext-theme.php index 8c4e31d2ff..471721f032 100644 --- a/inc/extensions/ext-theme.php +++ b/inc/extensions/ext-theme.php @@ -32,20 +32,19 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // Version number -$EXT_VERSION = "0.0.6"; +$EXT_VERSION = "0.0.7"; // Auto-set extension version if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION; // Version history array (add more with , "0.1" and so on) -$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6"); +$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7"); switch ($EXT_LOAD_MODE) { @@ -101,6 +100,13 @@ case "update": // Update an extension // Update notes (these will be set as task text!) $UPDATE_NOTES = "Variablen-Handling skriptglobal geändert."; break; + + case "0.0.7": // SQL queries for v0.0.7 + $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes ADD theme_name VARCHAR(255) NOT NULL DEFAULT ''"; + + // Update notes (these will be set as task text!) + $UPDATE_NOTES = "Designname (von Menschen lesbar) hinzugefügt."; + break; } break; diff --git a/inc/extensions/ext-top10.php b/inc/extensions/ext-top10.php index 71de163105..0cabb42e52 100644 --- a/inc/extensions/ext-top10.php +++ b/inc/extensions/ext-top10.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index 13a10276b5..d4d7573366 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index 3aa099c5fe..f482060374 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-wernis.php b/inc/extensions/ext-wernis.php index e1f5bdd5c1..b0e59c5721 100644 --- a/inc/extensions/ext-wernis.php +++ b/inc/extensions/ext-wernis.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/extensions/ext-yoomedia.php b/inc/extensions/ext-yoomedia.php index 6dc9287dd3..a38bd27bc3 100644 --- a/inc/extensions/ext-yoomedia.php +++ b/inc/extensions/ext-yoomedia.php @@ -33,8 +33,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/fatal_errors.php b/inc/fatal_errors.php index 05959f4e26..96a7d8539e 100644 --- a/inc/fatal_errors.php +++ b/inc/fatal_errors.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/footer.php b/inc/footer.php index aca9c6e0eb..ed888b4469 100644 --- a/inc/footer.php +++ b/inc/footer.php @@ -35,11 +35,14 @@ global $link, $frame, $CSS, $header; // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // END - if +// @TODO Workaround for css.php +if (!isset($footer)) $footer = 0; + if (($footer != "1") && ($footer != "2") && ($CSS != "1")) { // Output the generated HTML code or do nothing in direct-mode if (!empty($FATAL[0])) { diff --git a/inc/functions.php b/inc/functions.php index 4733b66422..44fdf95282 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } @@ -213,11 +213,13 @@ function LOAD_TEMPLATE($template, $return=false, $content="") { if (empty($GLOBALS['refid'])) $GLOBALS['refid'] = 0; $REFID = $GLOBALS['refid']; - // DEPRECATED!!! + // @DEPRECATED Try to remove this if() block if ($template == "member_support_form") { // Support request of a member $result = SQL_QUERY_ESC("SELECT gender, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); + + // @TODO Merge this data into $content list($gender, $surname, $family, $email) = SQL_FETCHROW($result); // Translate gender @@ -2496,7 +2498,7 @@ function REBUILD_CACHE ($cache, $inc="") { // Shall I remove the cache file? if ((EXT_IS_ACTIVE("cache")) && (is_object($cacheInstance))) { // Rebuild cache - if ($cacheInstance->cache_file("admins", true)) { + if ($cacheInstance->cache_file($cache, true)) { // Destroy it $cacheInstance->cache_destroy(); diff --git a/inc/gen_mediadata.php b/inc/gen_mediadata.php index 07a0b4f44c..66d5a4d8f0 100644 --- a/inc/gen_mediadata.php +++ b/inc/gen_mediadata.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/gen_sql_patches.php b/inc/gen_sql_patches.php index 45e7a626c3..0903d68470 100644 --- a/inc/gen_sql_patches.php +++ b/inc/gen_sql_patches.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/header.php b/inc/header.php index b64cebb75e..8f2d54deae 100644 --- a/inc/header.php +++ b/inc/header.php @@ -34,7 +34,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/install-inc.php b/inc/install-inc.php index b07d9fef35..55eb350f4f 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -36,7 +36,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language.php b/inc/language.php index 93da8d9ca9..fc7f73c1b7 100644 --- a/inc/language.php +++ b/inc/language.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/language/en.php b/inc/language/en.php index 35616be652..7cad73b730 100644 --- a/inc/language/en.php +++ b/inc/language/en.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index 8e254a61e5..b77ee5259a 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -178,7 +177,7 @@ function ADMINS_CHANGE_ADMIN_ACCOUNT($POST) { global $cacheInstance; // Begin the update - $cacheInstance_UPDATE = 0; + $cache_update = 0; foreach ($POST['login'] as $id => $login) { // Secure ID number $id = bigintval($id); @@ -186,7 +185,7 @@ function ADMINS_CHANGE_ADMIN_ACCOUNT($POST) { // When both passwords match update admin account if ($POST['pass1'][$id] == $POST['pass2'][$id]) { // Save only when both passwords are the same (also when they are empty) - $ADD = ""; $cacheInstance_UPDATE = "1"; + $ADD = ""; $cache_update = "1"; // Generate hash $hash = generateHash($POST['pass1'][$id]); @@ -255,6 +254,9 @@ WHERE id=%s LIMIT 1", ), __FILE__, __LINE__); } + // Purge cache + CACHE_PURGE_ADMIN_MENU($id); + // Admin account saved $MSG = ADMIN_ACCOUNT_SAVED; } else { @@ -269,7 +271,7 @@ WHERE id=%s LIMIT 1", } // Remove cache file - if ((EXT_IS_ACTIVE("cache")) && ($cacheInstance_UPDATE == "1")) { + if ((EXT_IS_ACTIVE("cache")) && ($cache_update == "1")) { if ($cacheInstance->cache_file("admins", true)) $cacheInstance->cache_destroy(); } } @@ -291,8 +293,8 @@ function ADMINS_EDIT_ADMIN_ACCOUNTS ($POST) { SQL_FREERESULT($result); // Prepare some more data for the template - $content['sw'] = $SW; - $content['id'] = $id; + $content['sw'] = $SW; + $content['id'] = $id; // Shall we allow changing default ACL? if ($content['mode'] == "allow") { @@ -362,7 +364,7 @@ function ADMINS_DELETE_ADMIN_ACCOUNTS ($POST) { // Remove the given accounts function ADMINS_REMOVE_ADMIN_ACCOUNTS ($POST) { // Begin removal - $cacheInstance_UPDATE = 0; + $cache_update = 0; foreach ($POST['sel'] as $id => $del) { // Secure ID number $id = bigintval($id); @@ -377,12 +379,14 @@ function ADMINS_REMOVE_ADMIN_ACCOUNTS ($POST) { $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1", array($id), __FILE__, __LINE__); - $cacheInstance_UPDATE = "1"; + // Purge cache + CACHE_PURGE_ADMIN_MENU($id); + $cache_update = "1"; } } // Remove cache if cache system is activated - if ((EXT_IS_ACTIVE("cache")) && ($cacheInstance_UPDATE == "1")) { + if ((EXT_IS_ACTIVE("cache")) && ($cache_update == "1")) { if ($cacheInstance->cache_file("admins", true)) $cacheInstance->cache_destroy(); } } diff --git a/inc/libs/autopurge_functions.php b/inc/libs/autopurge_functions.php index 1b20a242ea..7305ba5d4f 100644 --- a/inc/libs/autopurge_functions.php +++ b/inc/libs/autopurge_functions.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index ea963dd66c..bde8c4836c 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // This function must be run *BEFORE* a link is removed from table 'mxchange_user_links' ! function BONUS_ADD_TURBO_POINTS($mid, $uid, $type) { diff --git a/inc/libs/cache_functions.php b/inc/libs/cache_functions.php index e8f750bee8..81b65c436b 100644 --- a/inc/libs/cache_functions.php +++ b/inc/libs/cache_functions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Caching class class mxchange_cache { @@ -155,7 +155,10 @@ class mxchange_cache if (($k == "ext_keep") && ($v == "Y")) { $cacheArray['active_extensions'][$data['ext_name']] = $v; } // END - if - } // END - if + } elseif (is_array($v)) { + // Serialize and BASE64-encode the array + $v = base64_encode(serialize($v)); + } // Write cache line to file @fwrite($this->cache_pointer, $this->add_raw_row($k, $v)); diff --git a/inc/libs/country_functions.php b/inc/libs/country_functions.php index be8658bd2a..6f31bb5102 100644 --- a/inc/libs/country_functions.php +++ b/inc/libs/country_functions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // function COUNTRY_GENERATE_INFO($ID) { diff --git a/inc/libs/doubler_functions.php b/inc/libs/doubler_functions.php index 7137020b47..3c44736a4c 100644 --- a/inc/libs/doubler_functions.php +++ b/inc/libs/doubler_functions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // function DOUBLER_GENERATE_TABLE($uid="0", $done='N', $ref='N', $sort="ASC") { diff --git a/inc/libs/holiday_functions.php b/inc/libs/holiday_functions.php index d155341c3c..61ce6ab204 100644 --- a/inc/libs/holiday_functions.php +++ b/inc/libs/holiday_functions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // function HOLIDAY_STOP_HOLIDAYS() { diff --git a/inc/libs/html_mail_functions.php b/inc/libs/html_mail_functions.php index f45f68d4e9..18419e3aa7 100644 --- a/inc/libs/html_mail_functions.php +++ b/inc/libs/html_mail_functions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // function HTML_ADD_VALID_TAGS() { diff --git a/inc/libs/mediadata_functions.php b/inc/libs/mediadata_functions.php index 9257c2919c..f367203b5d 100644 --- a/inc/libs/mediadata_functions.php +++ b/inc/libs/mediadata_functions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // function MEDIA_UPDATE_ENTRY($keys_array, $mode, $value) { diff --git a/inc/libs/newsletter_functions.php b/inc/libs/newsletter_functions.php index 5dcf9d87e2..2a1553a3fc 100644 --- a/inc/libs/newsletter_functions.php +++ b/inc/libs/newsletter_functions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // function NL_ADD_VALID_TAGS() { diff --git a/inc/libs/nickname_functions.php b/inc/libs/nickname_functions.php index 899d98b6fe..fde09eadf9 100644 --- a/inc/libs/nickname_functions.php +++ b/inc/libs/nickname_functions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // function NICKNAME_IS_ACTIVE($uidNick) { diff --git a/inc/libs/optimize_functions.php b/inc/libs/optimize_functions.php index b4f4a742fb..cefbd46fa4 100644 --- a/inc/libs/optimize_functions.php +++ b/inc/libs/optimize_functions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // // Part taken from admin optimize module of PHPNuke (http://www.phpnuke.org) // diff --git a/inc/libs/order_functions.php b/inc/libs/order_functions.php index 92e10a574e..50cde4274d 100644 --- a/inc/libs/order_functions.php +++ b/inc/libs/order_functions.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/libs/payout_functions.php b/inc/libs/payout_functions.php index 8b8f8ba03d..95d03c0f6e 100644 --- a/inc/libs/payout_functions.php +++ b/inc/libs/payout_functions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // function PAYOUT_OUTPUT_PAYOUT_LIST($points) { diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index f5e88c4dc1..94485d633e 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // function RALLYE_AUTOSTART_RALLYES($result) { diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php index 4ae9dba3ba..f3c140674a 100644 --- a/inc/libs/register_functions.php +++ b/inc/libs/register_functions.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/libs/rewrite_functions.php b/inc/libs/rewrite_functions.php index 22e14f9b07..13f9a3b486 100644 --- a/inc/libs/rewrite_functions.php +++ b/inc/libs/rewrite_functions.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/libs/security_functions.php b/inc/libs/security_functions.php index 363bca731c..d1ec3e990f 100644 --- a/inc/libs/security_functions.php +++ b/inc/libs/security_functions.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index e9df50e78b..4ae38518e0 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -31,11 +31,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } + // function SPONSOR_HANDLE_SPONSOR(&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_STATUS=false) { diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 3ca9d415d7..7df9fd5b81 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 94fb9b9c7d..6497d3c917 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -32,10 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // // The advanced overview shows detailed informations to your exchange script: // - Unconfirmed / locked accounts diff --git a/inc/libs/transfer_functions.php b/inc/libs/transfer_functions.php index be51924369..9b3020f118 100644 --- a/inc/libs/transfer_functions.php +++ b/inc/libs/transfer_functions.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // function TRANSFER_AUTPPURGE($max, $age) { diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 9c42fb28a2..7304579282 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/libs/wernis_functions.php b/inc/libs/wernis_functions.php index 64bcddf27d..4e05960e9a 100644 --- a/inc/libs/wernis_functions.php +++ b/inc/libs/wernis_functions.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/load_cache.php b/inc/load_cache.php index c63d92561a..f97f04d471 100644 --- a/inc/load_cache.php +++ b/inc/load_cache.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/load_extensions.php b/inc/load_extensions.php index d6ef7eb1be..21fdf5ee5a 100644 --- a/inc/load_extensions.php +++ b/inc/load_extensions.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -293,12 +292,12 @@ if (!empty($DEL[0])) { // Remove extensions from two tables: extension registry and tasks table foreach ($DEL as $name) { // First remove entry from extensions table - $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1", - array($name), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1", + array($name), __FILE__, __LINE__); // Remove (maybe?) found tasks (main task and possible updates - $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE subject LIKE '[%s:] %' AND (task_type='EXTENSION' OR task_type='EXTENSION_UPDATE')", - array($name), __FILE__, __LINE__); + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_task_system WHERE subject LIKE '[%s:] %' AND (task_type='EXTENSION' OR task_type='EXTENSION_UPDATE')", + array($name), __FILE__, __LINE__); } // END - foreach // I think it's not neccessary to run the optimization function here diff --git a/inc/loader/load_cache-admin.php b/inc/loader/load_cache-admin.php index 06689b6b81..9210709caa 100644 --- a/inc/loader/load_cache-admin.php +++ b/inc/loader/load_cache-admin.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // END - if @@ -123,6 +123,9 @@ ORDER BY login", __FILE__, __LINE__); // Free memory SQL_FREERESULT($result_admins); + // Close cache + $cacheInstance->cache_close(); + // Reload the cache require(__FILE__); } @@ -137,33 +140,15 @@ if (GET_EXT_VERSION("admins") >= "0.3") { // Load referral system from cache global $cacheArray; $cacheArray['admin_acls'] = $cacheInstance->cache_load(); - - // Valid cache file - $CNT = 0; - foreach ($cacheArray['admin_acls'] as $k => $array) { - $CNT += count($array); - } // END - foreach - - // When there is a period (.) in the result this test will fail and so the cache file is - // damaged/corrupted - if (count($cacheArray['admin_acls']) > 0) { - $TEST = "failed"; - if (count($cacheArray['admin_acls']) > 0 ) $TEST = ($CNT / (count($cacheArray['admin_acls']))); - if ($TEST != bigintval($TEST)) { - // Cache file is corrupted! - $cacheInstance->cache_destroy(); - unset($cacheArray['admin_acls']); - } // END - if - } // END - if } elseif (($_CONFIG['cache_acls'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here $cacheInstance->cache_init("ADMINS_ACLS"); // Load all modules and their data $result = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM "._MYSQL_PREFIX."_admins_acls ORDER BY admin_id, action_menu, what_menu", __FILE__, __LINE__); - while ($DATA = SQL_FETCHARRAY($result)) { + while ($data = SQL_FETCHARRAY($result)) { // Add row to cache file - $cacheInstance->add_row($DATA); + $cacheInstance->add_row($data); } // END - while // Free memory diff --git a/inc/loader/load_cache-config.php b/inc/loader/load_cache-config.php index d4f1f91f14..8139855b7f 100644 --- a/inc/loader/load_cache-config.php +++ b/inc/loader/load_cache-config.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -42,43 +42,23 @@ if ($cacheInstance->cache_file("config", true) == true) { // Load config from cache global $cacheArray; $cacheArrayConfig = $cacheInstance->cache_load(); - - // Valid cache file - $CNT = 0; $newCache = array(); - foreach ($cacheArrayConfig as $key => $array) { - foreach ($array as $key2 => $value) { - $newCache[$key2][$key] = $value; - } - $CNT += count($array); - } - - // Overwrite the config with the cache version - $cacheArray['config'] = $newCache; - unset($newCache); - - // When there is a period (.) in the result this test will fail and so the cache file is - // damaged/corrupted - $TEST = "failed"; - if (count($cacheArray['config']) > 0 ) $TEST = ($CNT / (count($cacheArray['config']))); - if ($TEST != bigintval($TEST)) { - // Cache file is corrupted! - $cacheInstance->cache_destroy(); - unset($cacheArray['config']); - } } elseif (($_CONFIG['cache_config'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here $cacheInstance->cache_init("CONFIG"); // Load all modules and their data $result = SQL_QUERY("SELECT * FROM "._MYSQL_PREFIX."_config ORDER BY config", __FILE__, __LINE__); - while ($DATA = SQL_FETCHARRAY($result)) { + while ($data = SQL_FETCHARRAY($result)) { // Add row to cache file - $cacheInstance->add_row($DATA); - } + $cacheInstance->add_row($data); + } // END - while // Free memory SQL_FREERESULT($result); + // Close the cache + $cacheInstance->cache_close(); + // Reload the cache require(__FILE__); } diff --git a/inc/loader/load_cache-modreg.php b/inc/loader/load_cache-modreg.php index 8e42ddae46..ed6797493d 100644 --- a/inc/loader/load_cache-modreg.php +++ b/inc/loader/load_cache-modreg.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -43,43 +43,27 @@ if ($cacheInstance->cache_file("mod_reg", true) == true) { global $cacheArray; $cacheArray['modules'] = $cacheInstance->cache_load(); - // Valid cache file - $CNT = 0; - foreach ($cacheArray['modules'] as $k => $array) { - $CNT += count($array); - } - - // When there is a period (.) in the result this test will fail and so the cache file is - // damaged/corrupted - $TEST = "failed"; - if (count($cacheArray['modules']) > 0 ) $TEST = ($CNT / (count($cacheArray['modules']))); - if ($TEST != bigintval($TEST)) { - // Cache file is corrupted! - $cacheInstance->cache_destroy(); - unset($cacheArray['modules']); - } else { - // Rewrite module cache - $modArray = $cacheArray['modules']; - foreach ($modArray['module'] as $key => $mod) { - $cacheArray['modules']['id'][$mod] = $modArray['id'][$key]; - unset($cacheArray['modules']['id'][$key]); - $cacheArray['modules']['title'][$mod] = $modArray['title'][$key]; - unset($cacheArray['modules']['title'][$key]); - $cacheArray['modules']['locked'][$mod] = $modArray['locked'][$key]; - unset($cacheArray['modules']['locked'][$key]); - $cacheArray['modules']['hidden'][$mod] = $modArray['hidden'][$key]; - unset($cacheArray['modules']['hidden'][$key]); - $cacheArray['modules']['admin_only'][$mod] = $modArray['admin_only'][$key]; - unset($cacheArray['modules']['admin_only'][$key]); - $cacheArray['modules']['mem_only'][$mod] = $modArray['mem_only'][$key]; - unset($cacheArray['modules']['mem_only'][$key]); - if (isset($cacheArray['modules']['has_menu'][$key])) { - $cacheArray['modules']['has_menu'][$mod] = $modArray['has_menu'][$key]; - unset($cacheArray['modules']['has_menu'][$key]); - } // END - if - } - unset($modArray); - } + // Rewrite module cache + $modArray = $cacheArray['modules']; + foreach ($modArray['module'] as $key => $mod) { + $cacheArray['modules']['id'][$mod] = $modArray['id'][$key]; + unset($cacheArray['modules']['id'][$key]); + $cacheArray['modules']['title'][$mod] = $modArray['title'][$key]; + unset($cacheArray['modules']['title'][$key]); + $cacheArray['modules']['locked'][$mod] = $modArray['locked'][$key]; + unset($cacheArray['modules']['locked'][$key]); + $cacheArray['modules']['hidden'][$mod] = $modArray['hidden'][$key]; + unset($cacheArray['modules']['hidden'][$key]); + $cacheArray['modules']['admin_only'][$mod] = $modArray['admin_only'][$key]; + unset($cacheArray['modules']['admin_only'][$key]); + $cacheArray['modules']['mem_only'][$mod] = $modArray['mem_only'][$key]; + unset($cacheArray['modules']['mem_only'][$key]); + if (isset($cacheArray['modules']['has_menu'][$key])) { + $cacheArray['modules']['has_menu'][$mod] = $modArray['has_menu'][$key]; + unset($cacheArray['modules']['has_menu'][$key]); + } // END - if + } // END - foreach + unset($modArray); } elseif (($_CONFIG['cache_modreg'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here $cacheInstance->cache_init("MODULES"); @@ -94,14 +78,19 @@ FROM "._MYSQL_PREFIX."_mod_reg ORDER BY id", __FILE__, __LINE__); $result = SQL_QUERY("SELECT id, module, title, locked, hidden, admin_only, title, mem_only FROM "._MYSQL_PREFIX."_mod_reg ORDER BY id", __FILE__, __LINE__); } - while ($DATA = SQL_FETCHARRAY($result)) { + + // Cache all data + while ($data = SQL_FETCHARRAY($result)) { // Add row to cache file - $cacheInstance->add_row($DATA); - } + $cacheInstance->add_row($data); + } // END - while // Free memory SQL_FREERESULT($result); + // Close the cache + $cacheInstance->cache_close(); + // Reload the cache require(__FILE__); } diff --git a/inc/loader/load_cache-refdepths.php b/inc/loader/load_cache-refdepths.php index 28da4a7d4a..7d8c1aaa37 100644 --- a/inc/loader/load_cache-refdepths.php +++ b/inc/loader/load_cache-refdepths.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -42,36 +42,23 @@ if ($cacheInstance->cache_file("refdepths", true) == true) { // Load referral system from cache global $cacheArray; $cacheArray['ref_depths'] = $cacheInstance->cache_load(); - - // Valid cache file - $CNT = 0; - foreach ($cacheArray['ref_depths'] as $k => $array) { - $CNT += count($array); - } - - // When there is a period (.) in the result this test will fail and so the cache file is - // damaged/corrupted - $TEST = "failed"; - if (count($cacheArray['ref_depths']) > 0 ) $TEST = ($CNT / (count($cacheArray['ref_depths']))); - if ($TEST != bigintval($TEST)) { - // Cache file is corrupted! - $cacheInstance->cache_destroy(); - unset($cacheArray['ref_depths']); - } } elseif (($_CONFIG['cache_refdepth'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here $cacheInstance->cache_init("REFDEPTHS"); // Load all modules and their data $result = SQL_QUERY("SELECT id, level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__); - while ($DATA = SQL_FETCHARRAY($result)) { + while ($data = SQL_FETCHARRAY($result)) { // Add row to cache file - $cacheInstance->add_row($DATA); - } + $cacheInstance->add_row($data); + } // END - while // Free memory SQL_FREERESULT($result); + // Close the cache + $cacheInstance->cache_close(); + // Reload the cache require(__FILE__); } diff --git a/inc/loader/load_cache-refsystem.php b/inc/loader/load_cache-refsystem.php index bb903d18f3..ec9b0f5e86 100644 --- a/inc/loader/load_cache-refsystem.php +++ b/inc/loader/load_cache-refsystem.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -42,28 +42,23 @@ if ($cacheInstance->cache_file("refsystem", true) == true) { // Load referral system from cache global $cacheArray; $cacheArray['ref_system'] = $cacheInstance->cache_load(); - - // Valid cache file - $CNT = 0; - foreach ($cacheArray['ref_system'] as $k => $array) { - $CNT += count($array); - } - - // We now ignore empty cache here } elseif (($_CONFIG['cache_refsys'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here $cacheInstance->cache_init("refsystem"); // Load all modules and their data $result = SQL_QUERY("SELECT id, userid, level, counter FROM "._MYSQL_PREFIX."_refsystem ORDER BY userid, level", __FILE__, __LINE__); - while ($DATA = SQL_FETCHARRAY($result)) { + while ($data = SQL_FETCHARRAY($result)) { // Add row to cache file - $cacheInstance->add_row($DATA); - } + $cacheInstance->add_row($data); + } // END - while // Free memory SQL_FREERESULT($result); + // Close the cache + $cacheInstance->cache_close(); + // Reload the cache require(__FILE__); } diff --git a/inc/loader/load_cache-them.php b/inc/loader/load_cache-them.php new file mode 100644 index 0000000000..2a6e181a16 --- /dev/null +++ b/inc/loader/load_cache-them.php @@ -0,0 +1,90 @@ +cache_file("themes", true) == true) { + // Load referral system from cache + global $cacheArray; + $cache = $cacheInstance->cache_load(); + + // Restructure the array + $cacheArray['themes'] = array(); + foreach ($cache as $key => $data) { + // Skip "theme_path" because we don't need to rebuild it + if ($key == "theme_path") { + // Add entries with id + foreach ($data as $id => $entry) { + $cacheArray['themes']['theme_path'][$cache['id'][$id]] = $entry; + } // END - foreach + } else { + // Add all themes with theme name as array index + foreach ($data as $id => $entry) { + $cacheArray['themes'][$key][$cache['theme_path'][$id]] = $entry; + } // END - foreach + } + } // END - if + + // Remove dummy array + unset($cache); +} elseif (($_CONFIG['cache_refsys'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { + // Create cache file here + $cacheInstance->cache_init("themes"); + + // Load all themes and their data + $result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver, theme_name FROM "._MYSQL_PREFIX."_themes ORDER BY id", __FILE__, __LINE__); + while ($data = SQL_FETCHARRAY($result)) { + // Add row to cache file + $cacheInstance->add_row($data); + } // END - while + + // Free memory + SQL_FREERESULT($result); + + // Close the cache + $cacheInstance->cache_close(); + + // Reload the cache + require(__FILE__); +} + +// Close file +$cacheInstance->cache_close(); + +// +?> diff --git a/inc/mails/_mails.php b/inc/mails/_mails.php index f8cf83096f..2032d04786 100644 --- a/inc/mails/_mails.php +++ b/inc/mails/_mails.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, ""); return; } diff --git a/inc/mails/beg_mails.php b/inc/mails/beg_mails.php index ca5adfa470..d6206350ae 100644 --- a/inc/mails/beg_mails.php +++ b/inc/mails/beg_mails.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg"); return; } diff --git a/inc/mails/birthday_mails.php b/inc/mails/birthday_mails.php index 0d3e2ef4a2..f28852b62b 100644 --- a/inc/mails/birthday_mails.php +++ b/inc/mails/birthday_mails.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("birthday")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("birthday")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "birthday"); return; } diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index 44ab9f5717..bbcaa83e47 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus"); return; } diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 7e809cf2e1..367a96cbe9 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action- b/inc/modules/admin/action- index 75268e3a1b..81a2fcad9a 100644 --- a/inc/modules/admin/action- +++ b/inc/modules/admin/action- @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-admins.php b/inc/modules/admin/action-admins.php index 95c4b724b2..41ddf38a15 100644 --- a/inc/modules/admin/action-admins.php +++ b/inc/modules/admin/action-admins.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-bank.php b/inc/modules/admin/action-bank.php index 7d20e4039b..6bd915d001 100644 --- a/inc/modules/admin/action-bank.php +++ b/inc/modules/admin/action-bank.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-country.php b/inc/modules/admin/action-country.php index 8b70025d53..b78e4783b0 100644 --- a/inc/modules/admin/action-country.php +++ b/inc/modules/admin/action-country.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-doubler.php b/inc/modules/admin/action-doubler.php index a08f335778..2906a36e18 100644 --- a/inc/modules/admin/action-doubler.php +++ b/inc/modules/admin/action-doubler.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-email.php b/inc/modules/admin/action-email.php index 808abc2d70..3c2d83513e 100644 --- a/inc/modules/admin/action-email.php +++ b/inc/modules/admin/action-email.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-holiday.php b/inc/modules/admin/action-holiday.php index 056d423583..23a589444e 100644 --- a/inc/modules/admin/action-holiday.php +++ b/inc/modules/admin/action-holiday.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-login.php b/inc/modules/admin/action-login.php index a7377d80fa..9e7aed0ab0 100644 --- a/inc/modules/admin/action-login.php +++ b/inc/modules/admin/action-login.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-logout.php b/inc/modules/admin/action-logout.php index 387820995f..2658ae6291 100644 --- a/inc/modules/admin/action-logout.php +++ b/inc/modules/admin/action-logout.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-menu.php b/inc/modules/admin/action-menu.php index 9b5f8a35c4..4eb92e2966 100644 --- a/inc/modules/admin/action-menu.php +++ b/inc/modules/admin/action-menu.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-misc.php b/inc/modules/admin/action-misc.php index 48222b8e63..e05467eb80 100644 --- a/inc/modules/admin/action-misc.php +++ b/inc/modules/admin/action-misc.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-mods.php b/inc/modules/admin/action-mods.php index 1ae0aae9ff..6ce43d0164 100644 --- a/inc/modules/admin/action-mods.php +++ b/inc/modules/admin/action-mods.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-newsletter.php b/inc/modules/admin/action-newsletter.php index 8d36f0b911..edfbc80e97 100644 --- a/inc/modules/admin/action-newsletter.php +++ b/inc/modules/admin/action-newsletter.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-payouts.php b/inc/modules/admin/action-payouts.php index 436253e508..3f1c2aa47d 100644 --- a/inc/modules/admin/action-payouts.php +++ b/inc/modules/admin/action-payouts.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-primera.php b/inc/modules/admin/action-primera.php index 3ede03c63e..d310efdf4c 100644 --- a/inc/modules/admin/action-primera.php +++ b/inc/modules/admin/action-primera.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-rallye.php b/inc/modules/admin/action-rallye.php index fd4dc22f31..c09a5b9097 100644 --- a/inc/modules/admin/action-rallye.php +++ b/inc/modules/admin/action-rallye.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-repair.php b/inc/modules/admin/action-repair.php index 4ae98f8af4..cee773a524 100644 --- a/inc/modules/admin/action-repair.php +++ b/inc/modules/admin/action-repair.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-setup.php b/inc/modules/admin/action-setup.php index f9b44e6b0b..df957341fe 100644 --- a/inc/modules/admin/action-setup.php +++ b/inc/modules/admin/action-setup.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-sponsor.php b/inc/modules/admin/action-sponsor.php index 58b58b5edf..459607d7b7 100644 --- a/inc/modules/admin/action-sponsor.php +++ b/inc/modules/admin/action-sponsor.php @@ -31,8 +31,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/admin/action-stats.php b/inc/modules/admin/action-stats.php index 7422f6c613..76c3ddf5fd 100644 --- a/inc/modules/admin/action-stats.php +++ b/inc/modules/admin/action-stats.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-surfbar.php b/inc/modules/admin/action-surfbar.php index e322bef5d2..c9eff8b4c3 100644 --- a/inc/modules/admin/action-surfbar.php +++ b/inc/modules/admin/action-surfbar.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-task.php b/inc/modules/admin/action-task.php index 832c40a582..5c61f44d8f 100644 --- a/inc/modules/admin/action-task.php +++ b/inc/modules/admin/action-task.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!EXT_IS_ACTIVE("task")) { diff --git a/inc/modules/admin/action-theme.php b/inc/modules/admin/action-theme.php index 527b6126fe..f923105a5c 100644 --- a/inc/modules/admin/action-theme.php +++ b/inc/modules/admin/action-theme.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-transfer.php b/inc/modules/admin/action-transfer.php index c832f82dab..2462908e26 100644 --- a/inc/modules/admin/action-transfer.php +++ b/inc/modules/admin/action-transfer.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-user.php b/inc/modules/admin/action-user.php index 01f87a7aee..1cc7270823 100644 --- a/inc/modules/admin/action-user.php +++ b/inc/modules/admin/action-user.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/action-wernis.php b/inc/modules/admin/action-wernis.php index e528e044b2..18e55d0e90 100644 --- a/inc/modules/admin/action-wernis.php +++ b/inc/modules/admin/action-wernis.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index a0700817fe..8060c156aa 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -390,18 +389,43 @@ LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__); LOAD_TEMPLATE("admin_main_footer"); } // -function ADD_ADMIN_MENU($act, $wht,$return=false) -{ - global $menuDesription, $menuTitle; +function ADD_ADMIN_MENU($act, $wht, $return=false) { + global $menuDesription, $menuTitle, $cacheInstance; + + // Init variables $SUB = false; + $OUT = ""; // Menu descriptions $menuDesription = array(); $menuTitle = array(); + // Is there a cache instance? + if (is_object($cacheInstance)) { + // Create cache name + $cacheName = "admin_".$act."_".$wht."_".GET_LANGUAGE()."_".strtolower(get_session('admin_login')); + + // Is that cache there? + if ($cacheInstance->cache_file($cacheName, true)) { + // Then load it + $data = $cacheInstance->cache_load(); + + // Extract all parts + $OUT = base64_decode($data['output'][0]); + $menuTitle = unserialize(base64_decode($data['title'][0])); + $menuDescription = unserialize(base64_decode($data['descr'][0])); + + // Return or output content? + if ($return) { + return $OUT; + } else { + OUTPUT_HTML($OUT); + } + } // END - if + } // END - if + // Build main menu $result_main = SQL_QUERY("SELECT action, title, descr FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) ORDER BY sort, id DESC", __FILE__, __LINE__); - $OUT = ""; if (SQL_NUMROWS($result_main) > 0) { $OUT = " @@ -422,13 +446,13 @@ function ADD_ADMIN_MENU($act, $wht,$return=false) if (!$SUB) { // Insert compiled menu title and description - $menuTitle[$menu] = $title; + $menuTitle[$menu] = $title; $menuDesription[$menu] = $descr; } $OUT .= "
 · "; - if (($menu == $act) && (empty($wht))) + if (($menu == $act) && (empty($wht))) { $OUT .= ""; } @@ -437,7 +461,7 @@ function ADD_ADMIN_MENU($act, $wht,$return=false) $OUT .= "["; } $OUT .= $title; - if (($menu == $act) && (empty($wht))) + if (($menu == $act) && (empty($wht))) { $OUT .= ""; } @@ -457,24 +481,19 @@ function ADD_ADMIN_MENU($act, $wht,$return=false)   \n"; - while (list($wht_sub, $title_what, $desc_what) = SQL_FETCHROW($result_what)) - { + while (list($wht_sub, $title_what, $desc_what) = SQL_FETCHROW($result_what)) { // Filename $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $wht_sub); - if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) - { + if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) { $ACL = ADMINS_CHECK_ACL("", $wht_sub); - } - else - { + } else { // ACL is "allow"... hmmm $ACL = true; } $readable = FILE_READABLE($INC); - if ($ACL) - { + if ($ACL) { // Insert compiled title and description - $menuTitle[$wht_sub] = $title_what; + $menuTitle[$wht_sub] = $title_what; $menuDesription[$wht_sub] = $desc_what; $OUT .= " diff --git a/inc/modules/admin/what-config_register2.php b/inc/modules/admin/what-config_register2.php index 019b860812..32a9a79df6 100644 --- a/inc/modules/admin/what-config_register2.php +++ b/inc/modules/admin/what-config_register2.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_rewrite.php b/inc/modules/admin/what-config_rewrite.php index d1384b3a93..777ce50e4e 100644 --- a/inc/modules/admin/what-config_rewrite.php +++ b/inc/modules/admin/what-config_rewrite.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_secure.php b/inc/modules/admin/what-config_secure.php index bde6c556e2..6b69b6df56 100644 --- a/inc/modules/admin/what-config_secure.php +++ b/inc/modules/admin/what-config_secure.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_sponsor.php b/inc/modules/admin/what-config_sponsor.php index 70a64890fc..59dd718f32 100644 --- a/inc/modules/admin/what-config_sponsor.php +++ b/inc/modules/admin/what-config_sponsor.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_stats.php b/inc/modules/admin/what-config_stats.php index a82febbef7..e550e2454e 100644 --- a/inc/modules/admin/what-config_stats.php +++ b/inc/modules/admin/what-config_stats.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_surfbar.php b/inc/modules/admin/what-config_surfbar.php index e4a40f8023..d844d99e6b 100644 --- a/inc/modules/admin/what-config_surfbar.php +++ b/inc/modules/admin/what-config_surfbar.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_title.php b/inc/modules/admin/what-config_title.php index 85cf02ca94..c4c97606c4 100644 --- a/inc/modules/admin/what-config_title.php +++ b/inc/modules/admin/what-config_title.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_top10.php b/inc/modules/admin/what-config_top10.php index 507f8a1a51..9977a7f329 100644 --- a/inc/modules/admin/what-config_top10.php +++ b/inc/modules/admin/what-config_top10.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_transfer.php b/inc/modules/admin/what-config_transfer.php index 8368e7060e..5e947fd406 100644 --- a/inc/modules/admin/what-config_transfer.php +++ b/inc/modules/admin/what-config_transfer.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_user.php b/inc/modules/admin/what-config_user.php index dd108a8f46..be7a72cb4e 100644 --- a/inc/modules/admin/what-config_user.php +++ b/inc/modules/admin/what-config_user.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_wernis.php b/inc/modules/admin/what-config_wernis.php index c5478c8ce7..313868b86a 100644 --- a/inc/modules/admin/what-config_wernis.php +++ b/inc/modules/admin/what-config_wernis.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-del_email.php b/inc/modules/admin/what-del_email.php index 183410103e..35ad5a9ab9 100644 --- a/inc/modules/admin/what-del_email.php +++ b/inc/modules/admin/what-del_email.php @@ -35,7 +35,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-del_holiday.php b/inc/modules/admin/what-del_holiday.php index 5f0ce83e9b..42d9c9e3a2 100644 --- a/inc/modules/admin/what-del_holiday.php +++ b/inc/modules/admin/what-del_holiday.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-del_sponsor.php b/inc/modules/admin/what-del_sponsor.php index 119fa08aac..ee6b104af7 100644 --- a/inc/modules/admin/what-del_sponsor.php +++ b/inc/modules/admin/what-del_sponsor.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/admin/what-del_task.php b/inc/modules/admin/what-del_task.php index c04777e4e9..9eaf84c8db 100644 --- a/inc/modules/admin/what-del_task.php +++ b/inc/modules/admin/what-del_task.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!EXT_IS_ACTIVE("task")) { diff --git a/inc/modules/admin/what-del_user.php b/inc/modules/admin/what-del_user.php index f95a9035ea..0ffb8df50b 100644 --- a/inc/modules/admin/what-del_user.php +++ b/inc/modules/admin/what-del_user.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-edit_emails.php b/inc/modules/admin/what-edit_emails.php index 2a5e855162..2921842372 100644 --- a/inc/modules/admin/what-edit_emails.php +++ b/inc/modules/admin/what-edit_emails.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-edit_sponsor.php b/inc/modules/admin/what-edit_sponsor.php index 7526f9537d..c80ba74830 100644 --- a/inc/modules/admin/what-edit_sponsor.php +++ b/inc/modules/admin/what-edit_sponsor.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/admin/what-edit_user.php b/inc/modules/admin/what-edit_user.php index a4be4f6398..882d71394a 100644 --- a/inc/modules/admin/what-edit_user.php +++ b/inc/modules/admin/what-edit_user.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-email_archiv.php b/inc/modules/admin/what-email_archiv.php index 7ec5a8febd..449109d574 100644 --- a/inc/modules/admin/what-email_archiv.php +++ b/inc/modules/admin/what-email_archiv.php @@ -35,11 +35,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-email_details.php b/inc/modules/admin/what-email_details.php index 41dc91d065..14eccfe180 100644 --- a/inc/modules/admin/what-email_details.php +++ b/inc/modules/admin/what-email_details.php @@ -42,8 +42,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-email_stats.php b/inc/modules/admin/what-email_stats.php index 316322b1a1..7adb7a30d1 100644 --- a/inc/modules/admin/what-email_stats.php +++ b/inc/modules/admin/what-email_stats.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-extensions.php b/inc/modules/admin/what-extensions.php index 7e54be815e..a8181f2999 100644 --- a/inc/modules/admin/what-extensions.php +++ b/inc/modules/admin/what-extensions.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -72,7 +72,7 @@ if (!empty($_GET['reg_ext'])) { // Change settings like CSS file load if (isset($_POST['modify'])) { // Change entries - $cacheInstance_UPDATE = 0; + $cache_update = 0; foreach ($_POST['sel'] as $id => $sel) { // Secure ID $id = bigintval($id); @@ -197,7 +197,7 @@ if (!empty($_GET['reg_ext'])) { $do = "delete"; } elseif ((isset($_POST['remove'])) && ($SEL > 0) && (!IS_DEMO())) { // Remove extensions from DB (you have to delete all files manually!) - $cacheInstance_UPDATE = 0; + $cache_update = 0; foreach ($_POST['sel'] as $id => $active) { // Secure ID number $id = bigintval($id); @@ -297,7 +297,7 @@ case "register": // Register new extension SQL_FREERESULT($result); // Disable cache update by default - $cacheInstance_UPDATE = 0; + $cache_update = 0; if (!empty($subj)) { // Extract extension's name from subject... $ext_name = trim(substr($subj, 1, strpos($subj, ":") - 1)); diff --git a/inc/modules/admin/what-guest_add.php b/inc/modules/admin/what-guest_add.php index 43b83fa339..a671024710 100644 --- a/inc/modules/admin/what-guest_add.php +++ b/inc/modules/admin/what-guest_add.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-guestedit.php b/inc/modules/admin/what-guestedit.php index 60241a0712..b7ee2ea99a 100644 --- a/inc/modules/admin/what-guestedit.php +++ b/inc/modules/admin/what-guestedit.php @@ -32,19 +32,18 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); // Do we edit/delete/change main menus or sub menus? $AND = "what = ''"; $SUB = ""; -if (!empty($_GET['sub'])) -{ +if (!empty($_GET['sub'])) { $AND = sprintf("action='%s'", SQL_ESCAPE($_GET['sub'])); $SUB = SQL_ESCAPE($_GET['sub']); } diff --git a/inc/modules/admin/what-holiday_list.php b/inc/modules/admin/what-holiday_list.php index 56eda7d5e3..8682a2bbff 100644 --- a/inc/modules/admin/what-holiday_list.php +++ b/inc/modules/admin/what-holiday_list.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-holiday_remove.php b/inc/modules/admin/what-holiday_remove.php index cb8a7a43a3..1fa8487333 100644 --- a/inc/modules/admin/what-holiday_remove.php +++ b/inc/modules/admin/what-holiday_remove.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-list_autopurge.php b/inc/modules/admin/what-list_autopurge.php index d7f47b8de8..3d6ef10b7a 100644 --- a/inc/modules/admin/what-list_autopurge.php +++ b/inc/modules/admin/what-list_autopurge.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-list_bank_package.php b/inc/modules/admin/what-list_bank_package.php index 6888e9b4a7..8fc083f792 100644 --- a/inc/modules/admin/what-list_bank_package.php +++ b/inc/modules/admin/what-list_bank_package.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // END - if diff --git a/inc/modules/admin/what-list_beg.php b/inc/modules/admin/what-list_beg.php index 3fbf81c9ac..338c8d7d67 100644 --- a/inc/modules/admin/what-list_beg.php +++ b/inc/modules/admin/what-list_beg.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-list_bonus.php b/inc/modules/admin/what-list_bonus.php index ff592210f5..274ec1999c 100644 --- a/inc/modules/admin/what-list_bonus.php +++ b/inc/modules/admin/what-list_bonus.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-list_cats.php b/inc/modules/admin/what-list_cats.php index b01d71320c..863f1f6020 100644 --- a/inc/modules/admin/what-list_cats.php +++ b/inc/modules/admin/what-list_cats.php @@ -33,11 +33,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-list_country.php b/inc/modules/admin/what-list_country.php index f0c8457997..4ff4155f42 100644 --- a/inc/modules/admin/what-list_country.php +++ b/inc/modules/admin/what-list_country.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-list_doubler.php b/inc/modules/admin/what-list_doubler.php index d9f373aa2f..0d49da2005 100644 --- a/inc/modules/admin/what-list_doubler.php +++ b/inc/modules/admin/what-list_doubler.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-list_holiday.php b/inc/modules/admin/what-list_holiday.php index 013e97ca47..6ad367aac8 100644 --- a/inc/modules/admin/what-list_holiday.php +++ b/inc/modules/admin/what-list_holiday.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-list_links.php b/inc/modules/admin/what-list_links.php index ba73c72236..77e5571a20 100644 --- a/inc/modules/admin/what-list_links.php +++ b/inc/modules/admin/what-list_links.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!EXT_IS_ACTIVE("mailid")) { diff --git a/inc/modules/admin/what-list_newsletter.php b/inc/modules/admin/what-list_newsletter.php index 0c668e8387..ae6054fcbc 100644 --- a/inc/modules/admin/what-list_newsletter.php +++ b/inc/modules/admin/what-list_newsletter.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-list_norefs.php b/inc/modules/admin/what-list_norefs.php index e3f2c1567c..83ea7425ce 100644 --- a/inc/modules/admin/what-list_norefs.php +++ b/inc/modules/admin/what-list_norefs.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("user")) || (GET_EXT_VERSION("user") == "")) { diff --git a/inc/modules/admin/what-list_payouts.php b/inc/modules/admin/what-list_payouts.php index e266a79928..0b29fda668 100644 --- a/inc/modules/admin/what-list_payouts.php +++ b/inc/modules/admin/what-list_payouts.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-list_primera.php b/inc/modules/admin/what-list_primera.php index d7ce0d66ca..3f7af733a2 100644 --- a/inc/modules/admin/what-list_primera.php +++ b/inc/modules/admin/what-list_primera.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-list_rallyes.php b/inc/modules/admin/what-list_rallyes.php index 4438870eee..ea81f49ffc 100644 --- a/inc/modules/admin/what-list_rallyes.php +++ b/inc/modules/admin/what-list_rallyes.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-list_refs.php b/inc/modules/admin/what-list_refs.php index 35b5f3b6ac..9cb4932e9c 100644 --- a/inc/modules/admin/what-list_refs.php +++ b/inc/modules/admin/what-list_refs.php @@ -38,10 +38,9 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; - require($INC); +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { + $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; + require($INC); } // Add description as navigation point diff --git a/inc/modules/admin/what-list_sponsor.php b/inc/modules/admin/what-list_sponsor.php index 8791734a39..5671077128 100644 --- a/inc/modules/admin/what-list_sponsor.php +++ b/inc/modules/admin/what-list_sponsor.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/admin/what-list_sponsor_pay.php b/inc/modules/admin/what-list_sponsor_pay.php index e6c83b7045..884cb24adb 100644 --- a/inc/modules/admin/what-list_sponsor_pay.php +++ b/inc/modules/admin/what-list_sponsor_pay.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/admin/what-list_sponsor_pays.php b/inc/modules/admin/what-list_sponsor_pays.php index fe961dc14f..b696ee532a 100644 --- a/inc/modules/admin/what-list_sponsor_pays.php +++ b/inc/modules/admin/what-list_sponsor_pays.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/admin/what-list_surfbar_urls.php b/inc/modules/admin/what-list_surfbar_urls.php index 2bf0cf53b3..67a6ce9797 100644 --- a/inc/modules/admin/what-list_surfbar_urls.php +++ b/inc/modules/admin/what-list_surfbar_urls.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // END - if diff --git a/inc/modules/admin/what-list_task.php b/inc/modules/admin/what-list_task.php index 110dab5a88..9eb983342f 100644 --- a/inc/modules/admin/what-list_task.php +++ b/inc/modules/admin/what-list_task.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!EXT_IS_ACTIVE("task")) { diff --git a/inc/modules/admin/what-list_unconfirmed.php b/inc/modules/admin/what-list_unconfirmed.php index 729cbe8bd8..5b7b11dcfe 100644 --- a/inc/modules/admin/what-list_unconfirmed.php +++ b/inc/modules/admin/what-list_unconfirmed.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!EXT_IS_ACTIVE("mailid")) { diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php index ccce2b0a2c..95845f42ab 100644 --- a/inc/modules/admin/what-list_user.php +++ b/inc/modules/admin/what-list_user.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("user")) || (GET_EXT_VERSION("user") == "")) { diff --git a/inc/modules/admin/what-list_wernis.php b/inc/modules/admin/what-list_wernis.php index 277c4581a0..ac0f53bc9a 100644 --- a/inc/modules/admin/what-list_wernis.php +++ b/inc/modules/admin/what-list_wernis.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-lock_sponsor.php b/inc/modules/admin/what-lock_sponsor.php index 816878d364..c1aa1cbadd 100644 --- a/inc/modules/admin/what-lock_sponsor.php +++ b/inc/modules/admin/what-lock_sponsor.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/admin/what-lock_user.php b/inc/modules/admin/what-lock_user.php index 09f08635be..590f03a4a0 100644 --- a/inc/modules/admin/what-lock_user.php +++ b/inc/modules/admin/what-lock_user.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-logs.php b/inc/modules/admin/what-logs.php index 55d0bb06e3..ff9c943614 100644 --- a/inc/modules/admin/what-logs.php +++ b/inc/modules/admin/what-logs.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-maintenance.php b/inc/modules/admin/what-maintenance.php index e2d3e6a9b8..30477e2cd4 100644 --- a/inc/modules/admin/what-maintenance.php +++ b/inc/modules/admin/what-maintenance.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-mem_add.php b/inc/modules/admin/what-mem_add.php index 8c90ff9847..99fc355d90 100644 --- a/inc/modules/admin/what-mem_add.php +++ b/inc/modules/admin/what-mem_add.php @@ -33,11 +33,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add desciption as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-memedit.php b/inc/modules/admin/what-memedit.php index b9b8546a57..f14b121913 100644 --- a/inc/modules/admin/what-memedit.php +++ b/inc/modules/admin/what-memedit.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-optimize.php b/inc/modules/admin/what-optimize.php index 2c88f2a89a..e11b68ba38 100644 --- a/inc/modules/admin/what-optimize.php +++ b/inc/modules/admin/what-optimize.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-overview.php b/inc/modules/admin/what-overview.php index 93a1b4b18f..1efd917188 100644 --- a/inc/modules/admin/what-overview.php +++ b/inc/modules/admin/what-overview.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-payments.php b/inc/modules/admin/what-payments.php index 372032b16d..fae04f5a98 100644 --- a/inc/modules/admin/what-payments.php +++ b/inc/modules/admin/what-payments.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-refbanner.php b/inc/modules/admin/what-refbanner.php index 93a3f9ee9e..e5765afd7c 100644 --- a/inc/modules/admin/what-refbanner.php +++ b/inc/modules/admin/what-refbanner.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-repair_amenu.php b/inc/modules/admin/what-repair_amenu.php index 399570831c..b9479f4e21 100644 --- a/inc/modules/admin/what-repair_amenu.php +++ b/inc/modules/admin/what-repair_amenu.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); @@ -44,8 +44,7 @@ $ACTIONS = array(); // First fix all main menus (what="")... $result_fix = SQL_QUERY("SELECT id, action FROM "._MYSQL_PREFIX."_admin_menu WHERE (what='' OR what IS NULL) AND action != 'logout' ORDER BY sort ASC", __FILE__, __LINE__); $cnt = 0; $REP = 0; -while(list($id, $act) = SQL_FETCHROW($result_fix)) -{ +while(list($id, $act) = SQL_FETCHROW($result_fix)) { // Store act value for later usage in sorting sub menus $ACTIONS[] = $act; @@ -56,6 +55,7 @@ while(list($id, $act) = SQL_FETCHROW($result_fix)) // Count one up $cnt++; } + // Set logout weight to 999 $result_sort = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='999' WHERE act='logout' AND (what='' OR what IS NULL) LIMIT 1", __FILE__, __LINE__); @@ -75,6 +75,9 @@ foreach ($ACTIONS as $act) } } +// @TODO This causes the whole (!) menu cache being rebuilded +CACHE_PURGE_ADMIN_MENU(); + // Repair finished LOAD_TEMPLATE("admin_settings_saved", false, "".ADMIN_REPAIR_ENTRIES_FIXED_1.$REP.ADMIN_REPAIR_ENTRIES_FIXED_2.""); diff --git a/inc/modules/admin/what-repair_amnu.php b/inc/modules/admin/what-repair_amnu.php deleted file mode 100644 index eeb47245f8..0000000000 --- a/inc/modules/admin/what-repair_amnu.php +++ /dev/null @@ -1,92 +0,0 @@ -".ADMIN_REPAIR_ENTRIES_FIXED_1.$REP.ADMIN_REPAIR_ENTRIES_FIXED_2.""); - -// -?> diff --git a/inc/modules/admin/what-repair_cats.php b/inc/modules/admin/what-repair_cats.php index aee12756a9..5ad1350cc0 100644 --- a/inc/modules/admin/what-repair_cats.php +++ b/inc/modules/admin/what-repair_cats.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-repair_gmenu.php b/inc/modules/admin/what-repair_gmenu.php index 1eb582f32d..df8138112f 100644 --- a/inc/modules/admin/what-repair_gmenu.php +++ b/inc/modules/admin/what-repair_gmenu.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-repair_gmnu.php b/inc/modules/admin/what-repair_gmnu.php deleted file mode 100644 index 6353330c87..0000000000 --- a/inc/modules/admin/what-repair_gmnu.php +++ /dev/null @@ -1,93 +0,0 @@ -".ADMIN_REPAIR_ENTRIES_FIXED_1.$REP.ADMIN_REPAIR_ENTRIES_FIXED_2.""); - -// -?> diff --git a/inc/modules/admin/what-repair_mmenu.php b/inc/modules/admin/what-repair_mmenu.php index 320d3c49b3..5049c2654d 100644 --- a/inc/modules/admin/what-repair_mmenu.php +++ b/inc/modules/admin/what-repair_mmenu.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-repair_mmnu.php b/inc/modules/admin/what-repair_mmnu.php deleted file mode 100644 index 4e042f9812..0000000000 --- a/inc/modules/admin/what-repair_mmnu.php +++ /dev/null @@ -1,92 +0,0 @@ -".ADMIN_REPAIR_ENTRIES_FIXED_1.$REP.ADMIN_REPAIR_ENTRIES_FIXED_2.""); - -// -?> diff --git a/inc/modules/admin/what-send_bonus.php b/inc/modules/admin/what-send_bonus.php index 799d606969..0cf3502a62 100644 --- a/inc/modules/admin/what-send_bonus.php +++ b/inc/modules/admin/what-send_bonus.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!EXT_IS_ACTIVE("order")) { diff --git a/inc/modules/admin/what-send_newsletter.php b/inc/modules/admin/what-send_newsletter.php index 5f90fd230c..35b7e5eba6 100644 --- a/inc/modules/admin/what-send_newsletter.php +++ b/inc/modules/admin/what-send_newsletter.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-stats_mods.php b/inc/modules/admin/what-stats_mods.php index 5351690086..fc69db6d3e 100644 --- a/inc/modules/admin/what-stats_mods.php +++ b/inc/modules/admin/what-stats_mods.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-sub_points.php b/inc/modules/admin/what-sub_points.php index 587abec41e..c6de834363 100644 --- a/inc/modules/admin/what-sub_points.php +++ b/inc/modules/admin/what-sub_points.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-surfbar_stats.php b/inc/modules/admin/what-surfbar_stats.php index 3bc8f9f407..0ed0f4dbd3 100644 --- a/inc/modules/admin/what-surfbar_stats.php +++ b/inc/modules/admin/what-surfbar_stats.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-theme_check.php b/inc/modules/admin/what-theme_check.php index b3368dd779..1c9d7f0684 100644 --- a/inc/modules/admin/what-theme_check.php +++ b/inc/modules/admin/what-theme_check.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); @@ -64,22 +64,17 @@ if (($response[sizeof($response) - 1] == "[EOF]") && ($response[0] != "[EOF]")) // Get count of theme_check for validation $count = trim($response[sizeof($response) - 2]); - foreach ($response as $idx => $value) - { + foreach ($response as $idx => $value) { $value = str_replace("\n", "", $value); $ver = ""; // Leave loop when data is invalid or EOF? - if ((substr($value, 0, 6) == "theme-") && (substr($value, -4) == ".zip")) - { + if ((substr($value, 0, 6) == "theme-") && (substr($value, -4) == ".zip")) { $name = substr($value, 6, -4); $file = sprintf("%sthemes/%s/theme.php", PATH, $name); - $ver = trim(substr($response[$idx + 3], 4)); + $ver = trim(substr($response[$idx + 3], 4)); // Load version - $result = SQL_QUERY_ESC("SELECT theme_ver FROM "._MYSQL_PREFIX."_themes WHERE theme_path='%s' LIMIT 1", - array($name), __FILE__, __LINE__); - list($cver) = SQL_FETCHROW($result); - if (empty($cver)) $cver = "-.-"; + $cver = THEME_GET_VERSION($name); // Is the extension already installed or not? if (((SQL_NUMROWS($result) == 0) && (!FILE_READABLE($file))) || ($ver != $cver)) { diff --git a/inc/modules/admin/what-theme_edit.php b/inc/modules/admin/what-theme_edit.php index 71a9296528..747957986a 100644 --- a/inc/modules/admin/what-theme_edit.php +++ b/inc/modules/admin/what-theme_edit.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -40,8 +40,6 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); -global $currTheme; - // Check for selected themes $SEL = 0; if (!empty($_POST['sel'])) $SEL = SELECTION_COUNT($_POST['sel']); @@ -65,7 +63,13 @@ if ($SEL > 0) { } // Run SQL command? - if (!empty($SQL)) $result = SQL_QUERY($SQL, __FILE__, __LINE__); + if (!empty($SQL)) { + // Run it + $result = SQL_QUERY($SQL, __FILE__, __LINE__); + + // Rebuild cache + REBUILD_CACHE("themes", "them"); + } } // Output generated? @@ -78,6 +82,7 @@ if ($SEL > 0) { set_session("mxchange_theme", $POST['default_theme']); // Set it in config and current theme as well + global $currTheme; $currTheme = $POST['default_theme']; $_CONFIG['default_theme'] = $POST['default_theme']; @@ -90,17 +95,17 @@ $THEME_MODE = "test"; // Generate output lines for the template $OUT = ""; $SW = 2; -$result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver FROM "._MYSQL_PREFIX."_themes ORDER BY theme_path", __FILE__, __LINE__); +$result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver, theme_name FROM "._MYSQL_PREFIX."_themes ORDER BY theme_path", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { - while(list($id, $unix, $active, $ver) = SQL_FETCHROW($result)) + while(list($id, $unix, $active, $ver, $name) = SQL_FETCHROW($result)) { // Load theme in test mode require(PATH."theme/".$unix."/theme.php"); // Is the loaded theme name != current theme name? $LINK = $unix; - if ($unix != $currTheme) $LINK = "".$unix.""; + if ($unix != GET_CURR_THEME()) $LINK = "".$unix.""; // Prepare data for the row template $content = array( @@ -108,7 +113,7 @@ if (SQL_NUMROWS($result) > 0) 'id' => $id, 'active' => $active, 'link' => $LINK, - 'name' => $THEME_NAME, + 'name' => $name, 'is_act' => TRANSLATE_YESNO($active), 'email' => "".$THEME_AUTHOR."", 'url_link' => DEREFERER($THEME_URL), diff --git a/inc/modules/admin/what-theme_import.php b/inc/modules/admin/what-theme_import.php index ff47824ed7..027223f087 100644 --- a/inc/modules/admin/what-theme_import.php +++ b/inc/modules/admin/what-theme_import.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -45,12 +44,9 @@ ADD_DESCR("admin", basename(__FILE__)); $THEME_MODE = "test"; // Import selected theme if not present -if (!empty($_POST['theme'])) -{ - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_themes WHERE theme_path='%s' LIMIT 1", - array($_POST['theme']), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 0) - { +if (!empty($_POST['theme'])) { + // Check if theme is there + if (!THEME_CHECK_EXIST($_POST['theme'])) { // Import theme $file = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme'])); if (FILE_READABLE($file)) { @@ -58,18 +54,20 @@ if (!empty($_POST['theme'])) include($file); // Register it ith the exchange - $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_themes (theme_path, theme_active, theme_ver) -VALUES ('%s', 'N', '%s')", - array($_POST['theme'], $THEME_VERSION), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_themes (theme_path, theme_active, theme_ver, theme_name) +VALUES ('%s', 'N', '%s', '%s')", + array($_POST['theme'], $THEME_VERSION, $THEME_NAME), __FILE__, __LINE__); + + // Destroy cache + REBUILD_CACHE("themes", "them"); + + // Prepare message $msg = ADMIN_THEME_IMPORTED_1.$_POST['theme'].ADMIN_THEME_IMPORTED_2; } else { // Include file not found! $msg = ADMIN_THEME_INC_404_1.$_POST['theme'].ADMIN_THEME_INC_404_2; } } else { - // Free memory - SQL_FREERESULT($result); - // Theme already imported $msg = ADMIN_THEME_ALREADY_1.$_POST['theme'].ADMIN_THEME_ALREADY_2; } @@ -77,7 +75,7 @@ VALUES ('%s', 'N', '%s')", // Output message LOAD_TEMPLATE("admin_settings_saved", false, $msg); OUTPUT_HTML("
"); -} +} // END - if // Initialize array $THEMES = array( @@ -120,12 +118,7 @@ array_pk_sort($THEMES, array("theme_name")); $OUT = ""; $SW = 2; foreach ($THEMES['theme_unix'] as $key => $unix) { // Check if current theme is already imported or not - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_themes WHERE theme_path='%s' LIMIT 1", - array($unix), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) { - // Free memory - SQL_FREERESULT($result); - + if (THEME_CHECK_EXIST($unix)) { // Already installed $FOUND = "".ADMIN_THEME_ALREADY_INSTALLED.""; } else { @@ -151,17 +144,19 @@ foreach ($THEMES['theme_unix'] as $key => $unix) { ".$FOUND." \n"; + + // Switch color $SW = 3 - $SW; } if (empty($OUT)) { - // No themes found??? + // No themes found??? $OUT .= "\n"; -} +} // END - if define('__THEME_LIST', $OUT); // Load template diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php index 1d79858caa..1d68063407 100644 --- a/inc/modules/admin/what-unlock_emails.php +++ b/inc/modules/admin/what-unlock_emails.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-unlock_sponsor.php b/inc/modules/admin/what-unlock_sponsor.php index 6d75d912f9..c919881b83 100644 --- a/inc/modules/admin/what-unlock_sponsor.php +++ b/inc/modules/admin/what-unlock_sponsor.php @@ -21,7 +21,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/admin/what-unlock_surfbar_urls.php b/inc/modules/admin/what-unlock_surfbar_urls.php index 96fcf6a8a1..707d238077 100644 --- a/inc/modules/admin/what-unlock_surfbar_urls.php +++ b/inc/modules/admin/what-unlock_surfbar_urls.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // END - if diff --git a/inc/modules/admin/what-updates.php b/inc/modules/admin/what-updates.php index 4bf1d60f1d..e6fd292ee9 100644 --- a/inc/modules/admin/what-updates.php +++ b/inc/modules/admin/what-updates.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-usage.php b/inc/modules/admin/what-usage.php index b40a921541..9fcbcaaeb4 100644 --- a/inc/modules/admin/what-usage.php +++ b/inc/modules/admin/what-usage.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-user_contct.php b/inc/modules/admin/what-user_contct.php index ef1104eda2..190d17c8d6 100644 --- a/inc/modules/admin/what-user_contct.php +++ b/inc/modules/admin/what-user_contct.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-user_online.php b/inc/modules/admin/what-user_online.php index 9d8546575f..f1f7727ea4 100644 --- a/inc/modules/admin/what-user_online.php +++ b/inc/modules/admin/what-user_online.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-usr_online.php b/inc/modules/admin/what-usr_online.php index 3a2a30b51f..6ec2f99a50 100644 --- a/inc/modules/admin/what-usr_online.php +++ b/inc/modules/admin/what-usr_online.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/chk_login.php b/inc/modules/chk_login.php index 88bc2e0bb6..d8d36986d4 100644 --- a/inc/modules/chk_login.php +++ b/inc/modules/chk_login.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/frametester.php b/inc/modules/frametester.php index c73bec9636..29a36a5067 100644 --- a/inc/modules/frametester.php +++ b/inc/modules/frametester.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/guest/action- b/inc/modules/guest/action- index 2c6d438a15..11943809dd 100644 --- a/inc/modules/guest/action- +++ b/inc/modules/guest/action- @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/guest/action-admin.php b/inc/modules/guest/action-admin.php index 94dbca97ce..68567e02b2 100644 --- a/inc/modules/guest/action-admin.php +++ b/inc/modules/guest/action-admin.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/guest/action-main.php b/inc/modules/guest/action-main.php index e4f4562c8f..854a7d896f 100644 --- a/inc/modules/guest/action-main.php +++ b/inc/modules/guest/action-main.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/guest/action-members.php b/inc/modules/guest/action-members.php index 3a3b270e6e..32dd12b65d 100644 --- a/inc/modules/guest/action-members.php +++ b/inc/modules/guest/action-members.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/guest/action-online.php b/inc/modules/guest/action-online.php index 01d79180fe..b8a82c3573 100644 --- a/inc/modules/guest/action-online.php +++ b/inc/modules/guest/action-online.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!EXT_IS_ACTIVE("online")) { diff --git a/inc/modules/guest/action-sponsor.php b/inc/modules/guest/action-sponsor.php index 70c3f925e7..4f7c9b526e 100644 --- a/inc/modules/guest/action-sponsor.php +++ b/inc/modules/guest/action-sponsor.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/guest/action-themes.php b/inc/modules/guest/action-themes.php index aedec8bacd..a94178bff6 100644 --- a/inc/modules/guest/action-themes.php +++ b/inc/modules/guest/action-themes.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -53,8 +53,7 @@ if ($num_themes > 1) { $OUT = THEME_SELECTION_BOX("index", $act, $GLOBALS['what'], $result_themes); } elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0))) { // If there's only one just print it's name - global $THEME_NAME; - define('__THEME_NAME', $THEME_NAME); + define('__THEME_NAME', GET_CURR_THEME_NAME()); $OUT = LOAD_TEMPLATE("theme_one", true); } elseif (IS_ADMIN()) { // If there is no theme installed and there's an admin notify him! diff --git a/inc/modules/guest/what- b/inc/modules/guest/what- index 8c2b7d2f2b..0b024b4842 100644 --- a/inc/modules/guest/what- +++ b/inc/modules/guest/what- @@ -21,7 +21,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/guest/what-active.php b/inc/modules/guest/what-active.php index 99838f8d9c..443593282f 100644 --- a/inc/modules/guest/what-active.php +++ b/inc/modules/guest/what-active.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("active")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("active")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "active"); return; } diff --git a/inc/modules/guest/what-admin.php b/inc/modules/guest/what-admin.php index 44d43a8b43..f8a4af5769 100644 --- a/inc/modules/guest/what-admin.php +++ b/inc/modules/guest/what-admin.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/guest/what-agb.php b/inc/modules/guest/what-agb.php index abe4c547b4..e802710b7d 100644 --- a/inc/modules/guest/what-agb.php +++ b/inc/modules/guest/what-agb.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/guest/what-beg.php b/inc/modules/guest/what-beg.php index 0340496b2b..8182886066 100644 --- a/inc/modules/guest/what-beg.php +++ b/inc/modules/guest/what-beg.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) { diff --git a/inc/modules/guest/what-confirm.php b/inc/modules/guest/what-confirm.php index bb273a74d5..7d554b5f3d 100644 --- a/inc/modules/guest/what-confirm.php +++ b/inc/modules/guest/what-confirm.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("guest", basename(__FILE__)); diff --git a/inc/modules/guest/what-doubler.php b/inc/modules/guest/what-doubler.php index a37f04a8a6..869703b1e2 100644 --- a/inc/modules/guest/what-doubler.php +++ b/inc/modules/guest/what-doubler.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("doubler")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("doubler")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "doubler"); return; } diff --git a/inc/modules/guest/what-impressum.php b/inc/modules/guest/what-impressum.php index 88a3c464d5..b0ae9cf886 100644 --- a/inc/modules/guest/what-impressum.php +++ b/inc/modules/guest/what-impressum.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/guest/what-infos.php b/inc/modules/guest/what-infos.php index c3ff099700..ae5be50026 100644 --- a/inc/modules/guest/what-infos.php +++ b/inc/modules/guest/what-infos.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index 34c9180f27..ad2c106e3a 100644 --- a/inc/modules/guest/what-login.php +++ b/inc/modules/guest/what-login.php @@ -33,7 +33,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/guest/what-mediadata.php b/inc/modules/guest/what-mediadata.php index e73614e2f4..5ca5596aff 100644 --- a/inc/modules/guest/what-mediadata.php +++ b/inc/modules/guest/what-mediadata.php @@ -35,7 +35,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!EXT_IS_ACTIVE("mediadata")) { diff --git a/inc/modules/guest/what-rallyes.php b/inc/modules/guest/what-rallyes.php index e9d62de682..336ff02cdc 100644 --- a/inc/modules/guest/what-rallyes.php +++ b/inc/modules/guest/what-rallyes.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("rallye")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("rallye")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "rallye"); return; } diff --git a/inc/modules/guest/what-register.php b/inc/modules/guest/what-register.php index 1223294e8a..f06e9ee66f 100644 --- a/inc/modules/guest/what-register.php +++ b/inc/modules/guest/what-register.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("register"))) { diff --git a/inc/modules/guest/what-sponsor_agb.php b/inc/modules/guest/what-sponsor_agb.php index 54d1dd6700..b85642c7c9 100644 --- a/inc/modules/guest/what-sponsor_agb.php +++ b/inc/modules/guest/what-sponsor_agb.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/guest/what-sponsor_infos.php b/inc/modules/guest/what-sponsor_infos.php index a47c9567da..7e0f927854 100644 --- a/inc/modules/guest/what-sponsor_infos.php +++ b/inc/modules/guest/what-sponsor_infos.php @@ -31,8 +31,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/guest/what-sponsor_login.php b/inc/modules/guest/what-sponsor_login.php index 0a8b505de5..c28f50026c 100644 --- a/inc/modules/guest/what-sponsor_login.php +++ b/inc/modules/guest/what-sponsor_login.php @@ -31,8 +31,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/guest/what-sponsor_reg.php b/inc/modules/guest/what-sponsor_reg.php index bed8a6149f..3ca14f12ad 100644 --- a/inc/modules/guest/what-sponsor_reg.php +++ b/inc/modules/guest/what-sponsor_reg.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/guest/what-stats.php b/inc/modules/guest/what-stats.php index 19225380c0..73833a016b 100644 --- a/inc/modules/guest/what-stats.php +++ b/inc/modules/guest/what-stats.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/guest/what-top10.php b/inc/modules/guest/what-top10.php index 996324f3fe..56ef74b37d 100644 --- a/inc/modules/guest/what-top10.php +++ b/inc/modules/guest/what-top10.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("top10")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("top10")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "top10"); return; } diff --git a/inc/modules/guest/what-welcome.php b/inc/modules/guest/what-welcome.php index 2013b6e711..c8e885c4a0 100644 --- a/inc/modules/guest/what-welcome.php +++ b/inc/modules/guest/what-welcome.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/guest/what-wernis_portal.php b/inc/modules/guest/what-wernis_portal.php index c48232b0b3..5c82e8d187 100644 --- a/inc/modules/guest/what-wernis_portal.php +++ b/inc/modules/guest/what-wernis_portal.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/index.php b/inc/modules/index.php index 366c6d16c7..bbd6072b98 100644 --- a/inc/modules/index.php +++ b/inc/modules/index.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!EXT_IS_ACTIVE("sql_patches", true)) { diff --git a/inc/modules/loader.php b/inc/modules/loader.php index 368b613789..88a9aa7ead 100644 --- a/inc/modules/loader.php +++ b/inc/modules/loader.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/login.php b/inc/modules/login.php index 3ccd65f92b..9ca58e5f02 100644 --- a/inc/modules/login.php +++ b/inc/modules/login.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { diff --git a/inc/modules/member/action- b/inc/modules/member/action- index b16433423e..93cd7421a3 100644 --- a/inc/modules/member/action- +++ b/inc/modules/member/action- @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_LOGGED_IN()) { diff --git a/inc/modules/member/action-account.php b/inc/modules/member/action-account.php index 020d647461..6924b13e81 100644 --- a/inc/modules/member/action-account.php +++ b/inc/modules/member/action-account.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ($BLOCK_MODE) -{ +} elseif ($BLOCK_MODE) { // Block mode detected return; } diff --git a/inc/modules/member/action-bank.php b/inc/modules/member/action-bank.php index 73d7587ba5..c8496564fd 100644 --- a/inc/modules/member/action-bank.php +++ b/inc/modules/member/action-bank.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ($BLOCK_MODE) -{ +} elseif ($BLOCK_MODE) { // Block mode detected return; } diff --git a/inc/modules/member/action-extras.php b/inc/modules/member/action-extras.php index a410af8add..dfcacbc7f8 100644 --- a/inc/modules/member/action-extras.php +++ b/inc/modules/member/action-extras.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ($BLOCK_MODE) -{ +} elseif ($BLOCK_MODE) { // Block mode detected return; } diff --git a/inc/modules/member/action-logout.php b/inc/modules/member/action-logout.php index bd6a3a157b..03e2bca2e6 100644 --- a/inc/modules/member/action-logout.php +++ b/inc/modules/member/action-logout.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ($BLOCK_MODE) -{ +} elseif ($BLOCK_MODE) { // Block mode detected return; } diff --git a/inc/modules/member/action-main.php b/inc/modules/member/action-main.php index 0bee4c93d7..2538018531 100644 --- a/inc/modules/member/action-main.php +++ b/inc/modules/member/action-main.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ($BLOCK_MODE) -{ +} elseif ($BLOCK_MODE) { // Block mode detected return; } diff --git a/inc/modules/member/action-order.php b/inc/modules/member/action-order.php index 5276096f42..2a42cbfbff 100644 --- a/inc/modules/member/action-order.php +++ b/inc/modules/member/action-order.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ($BLOCK_MODE) -{ +} elseif ($BLOCK_MODE) { // Block mode detected return; } diff --git a/inc/modules/member/action-rals.php b/inc/modules/member/action-rals.php index 5c92acf49a..8ae25e70d8 100644 --- a/inc/modules/member/action-rals.php +++ b/inc/modules/member/action-rals.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ($BLOCK_MODE) -{ +} elseif ($BLOCK_MODE) { // Block mode detected return; } diff --git a/inc/modules/member/action-stats.php b/inc/modules/member/action-stats.php index 4c53e79aad..93777ec447 100644 --- a/inc/modules/member/action-stats.php +++ b/inc/modules/member/action-stats.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ($BLOCK_MODE) -{ +} elseif ($BLOCK_MODE) { // Block mode detected return; } diff --git a/inc/modules/member/action-surfbar.php b/inc/modules/member/action-surfbar.php index b957dd273e..f76f261e41 100644 --- a/inc/modules/member/action-surfbar.php +++ b/inc/modules/member/action-surfbar.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { diff --git a/inc/modules/member/action-themes.php b/inc/modules/member/action-themes.php index 908fe65098..fc90a45ed7 100644 --- a/inc/modules/member/action-themes.php +++ b/inc/modules/member/action-themes.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { @@ -56,8 +56,7 @@ if ($num_themes > 1) { $OUT = THEME_SELECTION_BOX("login", $act, $wht, $result_themes); } elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0))) { // If there's only one just print it's name - global $THEME_NAME; - define('__THEME_NAME', $THEME_NAME); + define('__THEME_NAME', GET_CURR_THEME_NAME()); $OUT = LOAD_TEMPLATE("theme_one", true); } elseif (IS_ADMIN()) { // If there is no theme installed and there's an admin notify him! diff --git a/inc/modules/member/what- b/inc/modules/member/what- index 92b7347bac..48f496db63 100644 --- a/inc/modules/member/what- +++ b/inc/modules/member/what- @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_LOGGED_IN()) { diff --git a/inc/modules/member/what-bank_create.php b/inc/modules/member/what-bank_create.php index 2d17b4601c..ccae2649b9 100644 --- a/inc/modules/member/what-bank_create.php +++ b/inc/modules/member/what-bank_create.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); } diff --git a/inc/modules/member/what-bank_deposit.php b/inc/modules/member/what-bank_deposit.php index 2d17b4601c..ccae2649b9 100644 --- a/inc/modules/member/what-bank_deposit.php +++ b/inc/modules/member/what-bank_deposit.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); } diff --git a/inc/modules/member/what-bank_infos.php b/inc/modules/member/what-bank_infos.php index 2d17b4601c..ccae2649b9 100644 --- a/inc/modules/member/what-bank_infos.php +++ b/inc/modules/member/what-bank_infos.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); } diff --git a/inc/modules/member/what-bank_output.php b/inc/modules/member/what-bank_output.php index 2d17b4601c..ccae2649b9 100644 --- a/inc/modules/member/what-bank_output.php +++ b/inc/modules/member/what-bank_output.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); } diff --git a/inc/modules/member/what-bank_withdraw.php b/inc/modules/member/what-bank_withdraw.php index 2d17b4601c..ccae2649b9 100644 --- a/inc/modules/member/what-bank_withdraw.php +++ b/inc/modules/member/what-bank_withdraw.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); } diff --git a/inc/modules/member/what-beg.php b/inc/modules/member/what-beg.php index 361f86c093..278d22747e 100644 --- a/inc/modules/member/what-beg.php +++ b/inc/modules/member/what-beg.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg"); return; } diff --git a/inc/modules/member/what-beg2.php b/inc/modules/member/what-beg2.php index d2eca69e26..04e9633b47 100644 --- a/inc/modules/member/what-beg2.php +++ b/inc/modules/member/what-beg2.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php[5~?module=index"); -} - elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg"); return; } diff --git a/inc/modules/member/what-bonus.php b/inc/modules/member/what-bonus.php index f34c4ab80b..ca9002a733 100644 --- a/inc/modules/member/what-bonus.php +++ b/inc/modules/member/what-bonus.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php[5~?module=index"); -} - elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus"); return; } diff --git a/inc/modules/member/what-categories.php b/inc/modules/member/what-categories.php index 8873da7c1f..cc902331e0 100644 --- a/inc/modules/member/what-categories.php +++ b/inc/modules/member/what-categories.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php[13~?module=index"); } diff --git a/inc/modules/member/what-doubler.php b/inc/modules/member/what-doubler.php index b4bb3fbd02..944a746001 100644 --- a/inc/modules/member/what-doubler.php +++ b/inc/modules/member/what-doubler.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php[5~?module=index"); -} - elseif ((!EXT_IS_ACTIVE("doubler")) && (!IS_ADMIN())) -{ +} elseif (!EXT_IS_ACTIVE("doubler")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "doubler"); return; } diff --git a/inc/modules/member/what-guest.php b/inc/modules/member/what-guest.php index 7d77e2d4ba..e6876490bc 100644 --- a/inc/modules/member/what-guest.php +++ b/inc/modules/member/what-guest.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); } diff --git a/inc/modules/member/what-holiday.php b/inc/modules/member/what-holiday.php index 800ee5a0c3..967def78a6 100644 --- a/inc/modules/member/what-holiday.php +++ b/inc/modules/member/what-holiday.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ((!EXT_IS_ACTIVE("holiday")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("holiday")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "holiday"); return; } diff --git a/inc/modules/member/what-html_mail.php b/inc/modules/member/what-html_mail.php index ad798d6fe6..b5602693a2 100644 --- a/inc/modules/member/what-html_mail.php +++ b/inc/modules/member/what-html_mail.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ((!EXT_IS_ACTIVE("html_mail")) && (!IS_ADMIN())) -{ +} elseif (!EXT_IS_ACTIVE("html_mail")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "html_mail"); return; } diff --git a/inc/modules/member/what-logout.php b/inc/modules/member/what-logout.php index 45bd0a01de..c048b06423 100644 --- a/inc/modules/member/what-logout.php +++ b/inc/modules/member/what-logout.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { diff --git a/inc/modules/member/what-mydata.php b/inc/modules/member/what-mydata.php index 5d19989919..efa643a7a6 100644 --- a/inc/modules/member/what-mydata.php +++ b/inc/modules/member/what-mydata.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ((!EXT_IS_ACTIVE("mydata")) && (!IS_ADMIN())) -{ +} elseif (!EXT_IS_ACTIVE("mydata")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "mydata"); return; } diff --git a/inc/modules/member/what-newsletter.php b/inc/modules/member/what-newsletter.php index 9ffe320c87..a27073b20c 100644 --- a/inc/modules/member/what-newsletter.php +++ b/inc/modules/member/what-newsletter.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ((!EXT_IS_ACTIVE("newsletter")) && (!IS_ADMIN())) -{ +} elseif (!EXT_IS_ACTIVE("newsletter")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "newsletter"); return; } diff --git a/inc/modules/member/what-nickname.php b/inc/modules/member/what-nickname.php index 899305c097..2ddb9a9624 100644 --- a/inc/modules/member/what-nickname.php +++ b/inc/modules/member/what-nickname.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ((!EXT_IS_ACTIVE("nickname")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("nickname")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "nickname"); return; } diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index 9bcdff8f57..0577688f28 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ((!EXT_IS_ACTIVE("order")) && (!IS_ADMIN())) -{ +} elseif (!EXT_IS_ACTIVE("order")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "order"); return; } diff --git a/inc/modules/member/what-payout.php b/inc/modules/member/what-payout.php index 7c45d6a89e..496ca955f7 100644 --- a/inc/modules/member/what-payout.php +++ b/inc/modules/member/what-payout.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { // Don't call this directly! $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); diff --git a/inc/modules/member/what-points.php b/inc/modules/member/what-points.php index 129fb40263..780d05a23d 100644 --- a/inc/modules/member/what-points.php +++ b/inc/modules/member/what-points.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { diff --git a/inc/modules/member/what-primera.php b/inc/modules/member/what-primera.php index 78f68da347..c5062c243b 100644 --- a/inc/modules/member/what-primera.php +++ b/inc/modules/member/what-primera.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { diff --git a/inc/modules/member/what-rallyes.php b/inc/modules/member/what-rallyes.php index 97f28f85dd..83b1150c92 100644 --- a/inc/modules/member/what-rallyes.php +++ b/inc/modules/member/what-rallyes.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); -} - elseif ((!EXT_IS_ACTIVE("rallye")) && (!IS_ADMIN())) -{ +} elseif (!EXT_IS_ACTIVE("rallye")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "rallye"); return; } diff --git a/inc/modules/member/what-reflinks.php b/inc/modules/member/what-reflinks.php index 76819b63b6..2e3caa73b6 100644 --- a/inc/modules/member/what-reflinks.php +++ b/inc/modules/member/what-reflinks.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); } diff --git a/inc/modules/member/what-sponsor.php b/inc/modules/member/what-sponsor.php index 5c0ad0f5a5..22cbc52e11 100644 --- a/inc/modules/member/what-sponsor.php +++ b/inc/modules/member/what-sponsor.php @@ -31,13 +31,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL(URL."/modules.php?module=index"); } diff --git a/inc/modules/member/what-stats.php b/inc/modules/member/what-stats.php index bed7ab0792..9020f5027e 100644 --- a/inc/modules/member/what-stats.php +++ b/inc/modules/member/what-stats.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { diff --git a/inc/modules/member/what-support.php b/inc/modules/member/what-support.php index db91df95f9..2e00bc37a1 100644 --- a/inc/modules/member/what-support.php +++ b/inc/modules/member/what-support.php @@ -32,17 +32,12 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()){ LOAD_URL("modules.php?module=index"); -} - elseif ((!EXT_IS_ACTIVE("support")) && (!IS_ADMIN())) -{ +} elseif (!EXT_IS_ACTIVE("support")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "support"); return; } diff --git a/inc/modules/member/what-surfbar_book.php b/inc/modules/member/what-surfbar_book.php index d9dda0fb03..528c3d2b9b 100644 --- a/inc/modules/member/what-surfbar_book.php +++ b/inc/modules/member/what-surfbar_book.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { diff --git a/inc/modules/member/what-surfbar_start.php b/inc/modules/member/what-surfbar_start.php index 73ac3af9c8..2308f2a275 100644 --- a/inc/modules/member/what-surfbar_start.php +++ b/inc/modules/member/what-surfbar_start.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { diff --git a/inc/modules/member/what-surfbar_stats.php b/inc/modules/member/what-surfbar_stats.php index 515aadbc6c..5fd1677b64 100644 --- a/inc/modules/member/what-surfbar_stats.php +++ b/inc/modules/member/what-surfbar_stats.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { diff --git a/inc/modules/member/what-themes.php b/inc/modules/member/what-themes.php index 849768d04d..14c40c1440 100644 --- a/inc/modules/member/what-themes.php +++ b/inc/modules/member/what-themes.php @@ -32,30 +32,26 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); } // Add description as navigation point ADD_DESCR("member", basename(__FILE__)); -if (!empty($_POST['member_theme'])) -{ +if (!empty($_POST['member_theme'])) { // Save theme to member's profile $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET curr_theme='%s' WHERE userid=%s LIMIT 1", array($_POST['member_theme'], $GLOBALS['userid']), __FILE__, __LINE__); // Set new theme for guests - $NewTheme = $_POST['member_theme']; + $newTheme = SQL_ESCAPE($_POST['member_theme']); // Change to new theme - set_session("mxchange_theme", $NewTheme); + set_session("mxchange_theme", $newTheme); // Theme saved! LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_THEME_SAVED); @@ -73,23 +69,16 @@ $THEMES = array( // Read directory "themes" $handle = opendir(PATH."theme/") or mxchange_die("Cannot read themes dir!"); -while ($dir = readdir($handle)) { +while ($entry = readdir($handle)) { // Construct absolute theme.php file name - $theme = sprintf("%stheme/%s/theme.php", PATH, $dir); - - // Test it... - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_themes WHERE theme_path='%s' AND theme_active='Y' LIMIT 1", - array($dir), __FILE__, __LINE__); - - if (($dir != ".") && ($dir != "..") && (FILE_READABLE($theme)) && (SQL_NUMROWS($result) == 1)) { - // Free memory - SQL_FREERESULT($result); + $theme = sprintf("%stheme/%s/theme.php", PATH, $entry); + if (($entry != ".") && ($entry != "..") && (FILE_READABLE($theme)) && (THEME_IS_ACTIVE($entry))) { // Found a valid directory so let's load it's theme.php file include($theme); // Add found theme to array - $THEMES['theme_unix'][] = $dir; + $THEMES['theme_unix'][] = $entry; $THEMES['theme_name'][] = $THEME_NAME; $THEMES['theme_author'][] = $THEME_AUTHOR; $THEMES['theme_email'][] = $THEME_EMAIL; @@ -106,8 +95,7 @@ array_pk_sort($THEMES, array("theme_name")); // Generate output lines for the template $OUT = ""; $SW = 2; -foreach ($THEMES['theme_unix'] as $key => $unix) -{ +foreach ($THEMES['theme_unix'] as $key => $unix) { $default = ""; if (get_session('mxchange_theme') == $unix) $default = " checked selected"; @@ -127,8 +115,8 @@ foreach ($THEMES['theme_unix'] as $key => $unix) \n"; $SW = 3 - $SW; } -if (empty($OUT)) -{ + +if (empty($OUT)) { // No themes found??? $OUT = "
@@ -535,6 +554,25 @@ function ADD_ADMIN_MENU($act, $wht,$return=false) $eval = "\$OUT = \"".COMPILE_CODE(addslashes($OUT))."\";"; eval($eval); + // Is there a cache instance again? + if (is_object($cacheInstance)) { + // Init cache + $cacheInstance->cache_init($cacheName); + + // Prepare cache data + $data = array( + 'output' => base64_encode($OUT), + 'title' => $menuTitle, + 'descr' => $menuDesription + ); + + // Write the data away + $cacheInstance->add_row($data); + + // Close cache + $cacheInstance->cache_close(); + } // END - if + // Return or output content? if ($return) { return $OUT; diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 443f8ad13c..57d77aa258 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what- b/inc/modules/admin/what- index f02615ef84..fb5dca692c 100644 --- a/inc/modules/admin/what- +++ b/inc/modules/admin/what- @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-add_bank_package.php b/inc/modules/admin/what-add_bank_package.php index 87815ff5e2..c24efeb2cc 100644 --- a/inc/modules/admin/what-add_bank_package.php +++ b/inc/modules/admin/what-add_bank_package.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-add_guestnl_cat.php b/inc/modules/admin/what-add_guestnl_cat.php index 2ae7ea347e..18982007bb 100644 --- a/inc/modules/admin/what-add_guestnl_cat.php +++ b/inc/modules/admin/what-add_guestnl_cat.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-add_points.php b/inc/modules/admin/what-add_points.php index fd9b0e5ee8..ab77cda645 100644 --- a/inc/modules/admin/what-add_points.php +++ b/inc/modules/admin/what-add_points.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-add_rallye.php b/inc/modules/admin/what-add_rallye.php index 0b46d156de..9bd259c9f0 100644 --- a/inc/modules/admin/what-add_rallye.php +++ b/inc/modules/admin/what-add_rallye.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-add_sponsor.php b/inc/modules/admin/what-add_sponsor.php index 08da77df9f..45838247b0 100644 --- a/inc/modules/admin/what-add_sponsor.php +++ b/inc/modules/admin/what-add_sponsor.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } diff --git a/inc/modules/admin/what-add_surfbar_url.php b/inc/modules/admin/what-add_surfbar_url.php index 2aef15f398..93c63c81b3 100644 --- a/inc/modules/admin/what-add_surfbar_url.php +++ b/inc/modules/admin/what-add_surfbar_url.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) { +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-admin_add.php b/inc/modules/admin/what-admin_add.php index 385600b139..3553b70179 100644 --- a/inc/modules/admin/what-admin_add.php +++ b/inc/modules/admin/what-admin_add.php @@ -32,17 +32,16 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); // Check if the admin has entered title and what-php file name... -if (((empty($_POST['title'])) || (empty($_POST['menu'])) || (empty($_POST['descr']))) && (isset($_POST['ok']))) -{ +if (((empty($_POST['title'])) || (empty($_POST['menu'])) || (empty($_POST['descr']))) && (isset($_POST['ok']))) { unset($_POST['ok']); } @@ -180,6 +179,7 @@ VALUES('%s', '%s', '%s', '%s', '%s')", addslashes($_POST['descr']), bigintval($_POST['sort']), ), __FILE__, __LINE__); + CACHE_PURGE_ADMIN_MENU(0, $_POST['menu'], $_POST['name']); } else { @@ -192,6 +192,7 @@ VALUES('%s', '%s', '%s', '%s')", addslashes($_POST['descr']), bigintval($_POST['sort']), ), __FILE__, __LINE__); + CACHE_PURGE_ADMIN_MENU(0, $_POST['name']); } LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE); } diff --git a/inc/modules/admin/what-adminedit.php b/inc/modules/admin/what-adminedit.php index d0014a7e57..88db098f49 100644 --- a/inc/modules/admin/what-adminedit.php +++ b/inc/modules/admin/what-adminedit.php @@ -32,16 +32,16 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); // Do we edit/delete/change main menus or sub menus? -$AND = "what = ''"; $SUB = ""; +$AND = "(what = '' OR what IS NULL)"; $SUB = ""; if (!empty($_GET['sub'])) { $AND = sprintf("action='%s'", SQL_ESCAPE($_GET['sub'])); @@ -173,6 +173,7 @@ WHERE ".$AND." AND id=%s LIMIT 1", $sel, ), __FILE__, __LINE__); } + CACHE_PURGE_ADMIN_MENU(0, $_POST['sel_action'][$sel], $_POST['sel_what'][$sel]); LOAD_TEMPLATE("admin_data_saved"); break; @@ -181,6 +182,7 @@ WHERE ".$AND." AND id=%s LIMIT 1", { $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($sel)), __FILE__, __LINE__); + CACHE_PURGE_ADMIN_MENU(0, "", "", $AND); } LOAD_TEMPLATE("admin_data_saved"); break; @@ -228,6 +230,7 @@ WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($_GET['tid']), bigintval($fid)), __FILE__, __LINE__); $result_sort = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_admin_menu SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($_GET['fid']), bigintval($tid)), __FILE__, __LINE__); + CACHE_PURGE_ADMIN_MENU(0, "", "", $AND); } } diff --git a/inc/modules/admin/what-admins_add.php b/inc/modules/admin/what-admins_add.php index 2a842c6144..27956bc37f 100644 --- a/inc/modules/admin/what-admins_add.php +++ b/inc/modules/admin/what-admins_add.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-admins_contact.php b/inc/modules/admin/what-admins_contact.php index a983e639cd..146e16fd19 100644 --- a/inc/modules/admin/what-admins_contact.php +++ b/inc/modules/admin/what-admins_contact.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-admins_contct.php b/inc/modules/admin/what-admins_contct.php index 31d92eaf70..ca2e84f530 100644 --- a/inc/modules/admin/what-admins_contct.php +++ b/inc/modules/admin/what-admins_contct.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-admins_edit.php b/inc/modules/admin/what-admins_edit.php index 798fe3f48f..2a7c9728ae 100644 --- a/inc/modules/admin/what-admins_edit.php +++ b/inc/modules/admin/what-admins_edit.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-admins_mails.php b/inc/modules/admin/what-admins_mails.php index 08c14b722d..874fdc605f 100644 --- a/inc/modules/admin/what-admins_mails.php +++ b/inc/modules/admin/what-admins_mails.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-autopurge.php b/inc/modules/admin/what-autopurge.php index 3df1e785ca..1a729d8e10 100644 --- a/inc/modules/admin/what-autopurge.php +++ b/inc/modules/admin/what-autopurge.php @@ -32,20 +32,18 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { // Data was submitted so we store it -} - else -{ + ADMIN_SAVE_SETTINGS($_POST); +} else { // Setup constants for the template switch ($_CONFIG['ap_inactive']) { diff --git a/inc/modules/admin/what-bonus.php b/inc/modules/admin/what-bonus.php index 4c51760d89..aa9c9858e3 100644 --- a/inc/modules/admin/what-bonus.php +++ b/inc/modules/admin/what-bonus.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-cache_stats.php b/inc/modules/admin/what-cache_stats.php index b22172c7de..121f202bde 100644 --- a/inc/modules/admin/what-cache_stats.php +++ b/inc/modules/admin/what-cache_stats.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-chk_regs.php b/inc/modules/admin/what-chk_regs.php index 253e3e386a..8f8ebc36af 100644 --- a/inc/modules/admin/what-chk_regs.php +++ b/inc/modules/admin/what-chk_regs.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_active.php b/inc/modules/admin/what-config_active.php index 3a19f15666..3a7e0d8445 100644 --- a/inc/modules/admin/what-config_active.php +++ b/inc/modules/admin/what-config_active.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_admin.php b/inc/modules/admin/what-config_admin.php index 6f68bb052d..6592affb88 100644 --- a/inc/modules/admin/what-config_admin.php +++ b/inc/modules/admin/what-config_admin.php @@ -32,21 +32,17 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { // Save configuration ADMIN_SAVE_SETTINGS($_POST); -} - else -{ +} else { // Prepare data for the template switch ($_CONFIG['admin_menu']) { diff --git a/inc/modules/admin/what-config_admins.php b/inc/modules/admin/what-config_admins.php index b0555fa83b..bd5c7a93e0 100644 --- a/inc/modules/admin/what-config_admins.php +++ b/inc/modules/admin/what-config_admins.php @@ -32,23 +32,21 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); $SEL = 0; if (!empty($_POST['sel'])) $SEL = SELECTION_COUNT($_POST['sel']); -if ((isset($_POST['edit'])) && ($SEL > 0)) -{ +if ((isset($_POST['edit'])) && ($SEL > 0)) { // Edit ACLs $SW = 2; $OUT = ""; - foreach ($_POST['sel'] as $id => $sel) - { + foreach ($_POST['sel'] as $id => $sel) { // Load data for the ID $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM "._MYSQL_PREFIX."_admins_acls WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); @@ -78,12 +76,9 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) // Load main template LOAD_TEMPLATE("admin_config_admins_edit"); -} - elseif ((isset($_POST['change'])) && ($SEL > 0)) -{ +} elseif ((isset($_POST['change'])) && ($SEL > 0)) { // Change entries - foreach ($_POST['sel'] as $id => $sel) - { + foreach ($_POST['sel'] as $id => $sel) { // Secure ID $id = bigintval($id); @@ -93,20 +88,19 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) } // Update cache when installed - if (EXT_IS_ACTIVE("cache")) - { + if (EXT_IS_ACTIVE("cache")) { if ($cacheInstance->cache_file("admins_acls", true) == true) $cacheInstance->cache_destroy(); + + // Purge menu cache + CACHE_PURGE_ADMIN_MENU($_POST['admin'][$id]); } // Entries changed LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ADMINS_ENTRIES_CHANGED); -} - elseif ((isset($_POST['del'])) && ($SEL > 0)) -{ +} elseif ((isset($_POST['del'])) && ($SEL > 0)) { // Delete ACLs $SW = 2; $OUT = ""; - foreach ($_POST['sel'] as $id => $sel) - { + foreach ($_POST['sel'] as $id => $sel) { // Load data for the ID $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM "._MYSQL_PREFIX."_admins_acls WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); @@ -115,19 +109,16 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) // Prepare variables if (empty($act)) $act = "---"; - if (empty($wht)) $wht = "---"; + if (empty($wht)) $wht = "---"; $eval = "\$mode = ADMINS_".strtoupper($mode)."_MODE;"; eval($eval); // Load admin's data $login = GET_ADMIN_LOGIN($admin); - if ($login != "***") - { + if ($login != "***") { // Admin found $admin = "".$login.""; - } - else - { + } else { // Maybe deleted? $admin = "".ADMIN_ID_404_1.$admin.ADMIN_ID_404_2.""; } @@ -150,27 +141,24 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) // Load main template LOAD_TEMPLATE("admin_config_admins_del"); -} - elseif ((isset($_POST['remove'])) && ($SEL > 0)) -{ +} elseif ((isset($_POST['remove'])) && ($SEL > 0)) { // Remove entries - foreach ($_POST['sel'] as $id => $sel) - { + foreach ($_POST['sel'] as $id => $sel) { $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admins_acls WHERE id=%s LIMIT 1", array(bigintval($id)),__FILE__, __LINE__); } // Update cache when installed - if (EXT_IS_ACTIVE("cache")) - { + if (EXT_IS_ACTIVE("cache")) { if ($cacheInstance->cache_file("admins_acls", true) == true) $cacheInstance->cache_destroy(); + + // @TODO This causes the whole (!) menu cache being rebuild + CACHE_PURGE_ADMIN_MENU(); } // Entries deleted LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ADMINS_ENTRIES_DELETED); -} - elseif (isset($_POST['add'])) -{ +} elseif (isset($_POST['add'])) { // Check if everything is fine... $result = SQL_QUERY_ESC("SELECT default_acl FROM "._MYSQL_PREFIX."_admins WHERE id=%s LIMIT 1", array(bigintval($_POST['admin_id'])), __FILE__, __LINE__); @@ -179,28 +167,24 @@ if ((isset($_POST['edit'])) && ($SEL > 0)) // Default ACL is false $ACL = false; - if (!empty($_POST['what_menu'])) - { + if (!empty($_POST['what_menu'])) { // Check parent ACL $ACL = ADMINS_CHECK_ACL(GET_ACTION("admin", $_POST['what_menu']), ""); } - if ($mode != $_POST['mode'] || ($ACL)) - { + if ($mode != $_POST['mode'] || ($ACL)) { // Mode is fine $BOTH = ((!empty($_POST['action_menu'])) && (!empty($_POST['what_menu']))); - if (((!empty($_POST['action_menu'])) || (!empty($_POST['what_menu']))) && (!$BOTH)) - { + if (((!empty($_POST['action_menu'])) || (!empty($_POST['what_menu']))) && (!$BOTH)) { // Main or sub menu selected $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_admins_acls WHERE admin_id=%s AND action_menu='%s' AND what_menu='%s' LIMIT 1", array(bigintval($_POST['admin_id']), $_POST['action_menu'], $_POST['what_menu']), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 0) - { + if (SQL_NUMROWS($result) == 0) { // Finally add the new ACL $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_admins_acls (admin_id, action_menu, what_menu, access_mode) VALUES ('%s', '%s', '%s', '%s')", array( - $_POST['admin_id'], + bigintval($_POST['admin_id']), $_POST['action_menu'], $_POST['what_menu'], $_POST['mode'] @@ -208,37 +192,31 @@ VALUES ('%s', '%s', '%s', '%s')", $content = ADMIN_ADMINS_ACL_SAVED; // Update cache when installed - if (EXT_IS_ACTIVE("cache")) - { + if (EXT_IS_ACTIVE("cache")) { if ($cacheInstance->cache_file("admins_acls", true) == true) $cacheInstance->cache_destroy(); - } - } - else - { + + // Purge cache + CACHE_PURGE_ADMIN_MENU($_POST['admin_id'], $_POST['action_menu'], $_POST['what_menu']); + } // END - if + } else { // ACL does already exist! $content = ADMIN_ADMINS_ACL_ALREADY_ADDED; } // Free memory SQL_FREERESULT($result); - } - else - { + } else { // No menu selected makes also no sence... $content = ADMIN_ADMINS_SELECT_ACTION_WHAT; } - } - else - { + } else { // Same mode makes no sence... $content = ADMIN_ADMINS_SAME_MODE_SELECTED; } // Display message LOAD_TEMPLATE("admin_settings_saved", false, $content); -} - else -{ +} else { // List all ACLs $result_acls = SQL_QUERY("SELECT id, admin_id, action_menu, what_menu, access_mode FROM "._MYSQL_PREFIX."_admins_acls ORDER BY admin_id, id", __FILE__, __LINE__); if (SQL_NUMROWS($result_acls) > 0) @@ -298,5 +276,6 @@ VALUES ('%s', '%s', '%s', '%s')", // Load template for adding new ACL LOAD_TEMPLATE("admin_admins_add_acl"); } + // ?> diff --git a/inc/modules/admin/what-config_autopurge.php b/inc/modules/admin/what-config_autopurge.php index 287352e475..e29b37ed9d 100644 --- a/inc/modules/admin/what-config_autopurge.php +++ b/inc/modules/admin/what-config_autopurge.php @@ -32,21 +32,18 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { // Data was submitted so we store it ADMIN_SAVE_SETTINGS($_POST); -} - else -{ +} else { // Output de-/activation selections define('__AP_INACTIVE_SELECTION' , ADD_SELECTION("yn", $_CONFIG['ap_inactive'] , "autopurge_inactive")); define('__AP_UNCONFIRMED_SELECTION', ADD_SELECTION("yn", $_CONFIG['ap_unconfirmed'], "autopurge_unconfirmed")); @@ -68,13 +65,10 @@ if (isset($_POST['ok'])) // Mail confirmation links define('_CFG_AUTO_PURGE', CREATE_TIME_SELECTIONS($_CONFIG['auto_purge'], "auto_purge", "MWD")); - if ($_CONFIG['auto_purge_active'] == "N") - { + if ($_CONFIG['auto_purge_active'] == "N") { define('_CFG_AP_ACTIVE_N', ' checked'); define('_CFG_AP_ACTIVE_Y', ""); - } - else - { + } else { define('_CFG_AP_ACTIVE_N', ""); define('_CFG_AP_ACTIVE_Y', ' checked'); } diff --git a/inc/modules/admin/what-config_beg.php b/inc/modules/admin/what-config_beg.php index ff220ca09e..db38955655 100644 --- a/inc/modules/admin/what-config_beg.php +++ b/inc/modules/admin/what-config_beg.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_birthday.php b/inc/modules/admin/what-config_birthday.php index c578d07f14..1f56c6a9f5 100644 --- a/inc/modules/admin/what-config_birthday.php +++ b/inc/modules/admin/what-config_birthday.php @@ -32,21 +32,18 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { // Save configuration ADMIN_SAVE_SETTINGS($_POST); -} - else -{ +} else { // Prepare data for the template define('__POINTS_VALUE', $_CONFIG['birthday_points']); switch ($_CONFIG['birthday_active']) @@ -77,5 +74,6 @@ if (isset($_POST['ok'])) // Display form LOAD_TEMPLATE("admin_config_birthday"); } + // ?> diff --git a/inc/modules/admin/what-config_bonus.php b/inc/modules/admin/what-config_bonus.php index 5641b9c5cf..1488a2b329 100644 --- a/inc/modules/admin/what-config_bonus.php +++ b/inc/modules/admin/what-config_bonus.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_cache.php b/inc/modules/admin/what-config_cache.php index 17d68e150b..8b9047d05c 100644 --- a/inc/modules/admin/what-config_cache.php +++ b/inc/modules/admin/what-config_cache.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_cats.php b/inc/modules/admin/what-config_cats.php index 4bc5215739..d42c6bd2e8 100644 --- a/inc/modules/admin/what-config_cats.php +++ b/inc/modules/admin/what-config_cats.php @@ -33,7 +33,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_doubler.php b/inc/modules/admin/what-config_doubler.php index 2b80c4c436..04355fd63d 100644 --- a/inc/modules/admin/what-config_doubler.php +++ b/inc/modules/admin/what-config_doubler.php @@ -32,16 +32,15 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { // Replace commata with decimal dot $_POST['doubler_charge'] = str_replace(",", ".", ($_POST['doubler_charge'] / 100)); $_POST['doubler_ref'] = str_replace(",", ".", ($_POST['doubler_ref'] / 100)); @@ -51,9 +50,7 @@ if (isset($_POST['ok'])) // Save settings ADMIN_SAVE_SETTINGS($_POST); -} - else -{ +} else { // Prepare data for the template // - Charge rate define('__DOUBLER_CHARGE', TRANSLATE_COMMA(($_CONFIG['doubler_charge'] * 100), false)); diff --git a/inc/modules/admin/what-config_email.php b/inc/modules/admin/what-config_email.php index cb306c5d5a..e36c9f5bb6 100644 --- a/inc/modules/admin/what-config_email.php +++ b/inc/modules/admin/what-config_email.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_extensions.php b/inc/modules/admin/what-config_extensions.php index e8f26f98c1..4827207a74 100644 --- a/inc/modules/admin/what-config_extensions.php +++ b/inc/modules/admin/what-config_extensions.php @@ -32,24 +32,20 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { // Save configuration ADMIN_SAVE_SETTINGS($_POST); -} - else -{ +} else { // Prepare data - switch ($_CONFIG['verbose_sql']) - { + switch ($_CONFIG['verbose_sql']) { case 'Y': define('__VERBOSE_Y', ' checked'); define('__VERBOSE_N', ""); break; case 'N': define('__VERBOSE_Y', ""); define('__VERBOSE_N', ' checked'); break; } @@ -58,5 +54,6 @@ if (isset($_POST['ok'])) LOAD_TEMPLATE("admin_config_extensions"); } + // ?> diff --git a/inc/modules/admin/what-config_holiday.php b/inc/modules/admin/what-config_holiday.php index e652e7b1ff..b2d824df2f 100644 --- a/inc/modules/admin/what-config_holiday.php +++ b/inc/modules/admin/what-config_holiday.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_home.php b/inc/modules/admin/what-config_home.php index 64bcfd3b71..c2068f9ffb 100644 --- a/inc/modules/admin/what-config_home.php +++ b/inc/modules/admin/what-config_home.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_mediadata.php b/inc/modules/admin/what-config_mediadata.php index d7c7f82132..5af3aa5d29 100644 --- a/inc/modules/admin/what-config_mediadata.php +++ b/inc/modules/admin/what-config_mediadata.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_mods.php b/inc/modules/admin/what-config_mods.php index 346b168906..9bc4c994fd 100644 --- a/inc/modules/admin/what-config_mods.php +++ b/inc/modules/admin/what-config_mods.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_newsletter.php b/inc/modules/admin/what-config_newsletter.php index f169c3b279..c7dc393d5b 100644 --- a/inc/modules/admin/what-config_newsletter.php +++ b/inc/modules/admin/what-config_newsletter.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_nickname.php b/inc/modules/admin/what-config_nickname.php index 30bc33b924..b08d423c81 100644 --- a/inc/modules/admin/what-config_nickname.php +++ b/inc/modules/admin/what-config_nickname.php @@ -32,23 +32,21 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) -{ +if ((!defined('__SECURITY')) || (!is_admin())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { // Save data ADMIN_SAVE_SETTINGS($_POST); -} - else -{ +} else { // Load template LOAD_TEMPLATE("admin_config_nickname"); } + // ?> diff --git a/inc/modules/admin/what-config_order.php b/inc/modules/admin/what-config_order.php index 1c8e8dd9a3..8f63c4488a 100644 --- a/inc/modules/admin/what-config_order.php +++ b/inc/modules/admin/what-config_order.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_other.php b/inc/modules/admin/what-config_other.php index 79b5113d2f..e9f43515ac 100644 --- a/inc/modules/admin/what-config_other.php +++ b/inc/modules/admin/what-config_other.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("other")) || (GET_EXT_VERSION("other") == "")) { diff --git a/inc/modules/admin/what-config_payouts.php b/inc/modules/admin/what-config_payouts.php index 39e03d9c91..3b3af308e0 100644 --- a/inc/modules/admin/what-config_payouts.php +++ b/inc/modules/admin/what-config_payouts.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_points.php b/inc/modules/admin/what-config_points.php index 74fffe655d..ca9a6e71da 100644 --- a/inc/modules/admin/what-config_points.php +++ b/inc/modules/admin/what-config_points.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -40,36 +40,29 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); -if (!empty($_GET['sub'])) -{ +if (!empty($_GET['sub'])) { switch ($_GET['sub']) { case "points": - if ((empty($_POST['points_register'])) || (empty($_POST['points_ref']))) - { + if ((empty($_POST['points_register'])) || (empty($_POST['points_ref']))) { unset($_POST['ok']); } break; case "ref": - if (isset($_GET['do'])) - { - if (((empty($_POST['lvl'])) || (empty($_POST['perc']))) && ($_GET['do'] == "add")) - { + if (isset($_GET['do'])) { + if (((empty($_POST['lvl'])) || (empty($_POST['perc']))) && ($_GET['do'] == "add")) { unset($_POST['ok']); } } break; } -} - else -{ +} else { // Display overview $_GET['sub'] = "overview"; } -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { $SQL = array(); switch ($_GET['sub']) { @@ -85,8 +78,7 @@ if (isset($_POST['ok'])) break; case "edit": // Change entries - foreach ($_POST['lvl'] as $id => $value) - { + foreach ($_POST['lvl'] as $id => $value) { // Secure ID $id = bigintval($id); @@ -98,8 +90,7 @@ if (isset($_POST['ok'])) break; case "del": - foreach ($_POST['id'] as $id => $value) - { + foreach ($_POST['id'] as $id => $value) { $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_refdepths WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); } @@ -108,8 +99,7 @@ if (isset($_POST['ok'])) } // Update cache file - if (GET_EXT_VERSION("cache") >= "0.1.2") - { + if (GET_EXT_VERSION("cache") >= "0.1.2") { if ($cacheInstance->cache_file("refdepths", true)) $cacheInstance->cache_destroy(); } break; diff --git a/inc/modules/admin/what-config_primera.php b/inc/modules/admin/what-config_primera.php index 349d7ad52b..bd559c2e71 100644 --- a/inc/modules/admin/what-config_primera.php +++ b/inc/modules/admin/what-config_primera.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_proxy.php b/inc/modules/admin/what-config_proxy.php index 75cd3f38e8..756b42d751 100644 --- a/inc/modules/admin/what-config_proxy.php +++ b/inc/modules/admin/what-config_proxy.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) { +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_rallye_prices.php b/inc/modules/admin/what-config_rallye_prices.php index d56729c939..c06f365fc4 100644 --- a/inc/modules/admin/what-config_rallye_prices.php +++ b/inc/modules/admin/what-config_rallye_prices.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_refid.php b/inc/modules/admin/what-config_refid.php index ea4f977972..46b26debac 100644 --- a/inc/modules/admin/what-config_refid.php +++ b/inc/modules/admin/what-config_refid.php @@ -32,11 +32,11 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } + // Add description as navigation point ADD_DESCR("admin", basename(__FILE__)); diff --git a/inc/modules/admin/what-config_reg.php b/inc/modules/admin/what-config_reg.php index d1e56fb116..9c5922d27e 100644 --- a/inc/modules/admin/what-config_reg.php +++ b/inc/modules/admin/what-config_reg.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/modules/admin/what-config_register.php b/inc/modules/admin/what-config_register.php index ac02a5a59e..06b5cf4d38 100644 --- a/inc/modules/admin/what-config_register.php +++ b/inc/modules/admin/what-config_register.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -42,10 +41,8 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) ADD_DESCR("admin", basename(__FILE__)); // Do we want to save changes? -if (isset($_POST['ok'])) -{ - foreach ($_POST['sel'] as $id => $value) - { +if (isset($_POST['ok'])) { + foreach ($_POST['sel'] as $id => $value) { $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_must_register SET field_required='%s' WHERE id=%s AND field_required != '%s' LIMIT 1", array($value, bigintval($id), $value),__FILE__, __LINE__); } @@ -55,8 +52,7 @@ if (isset($_POST['ok'])) // List all register values $result = SQL_QUERY("SELECT id, field_name, field_required FROM "._MYSQL_PREFIX."_must_register ORDER BY id", __FILE__, __LINE__); $SW = 2; $OUT = ""; -while (list($id, $name, $required) = SQL_FETCHROW($result)) -{ +while (list($id, $name, $required) = SQL_FETCHROW($result)) { $eval = "\$name = ".strtoupper($name).";"; eval($eval); $OUT .= "
".LOAD_TEMPLATE("admin_settings_saved", true, ADMIN_NO_THEMES_FOUND)."
diff --git a/inc/modules/member/what-transfer.php b/inc/modules/member/what-transfer.php index 59d36bc655..ddbb47dd6f 100644 --- a/inc/modules/member/what-transfer.php +++ b/inc/modules/member/what-transfer.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { diff --git a/inc/modules/member/what-unconfirmed.php b/inc/modules/member/what-unconfirmed.php index 4e22502eaf..f6879b2ba8 100644 --- a/inc/modules/member/what-unconfirmed.php +++ b/inc/modules/member/what-unconfirmed.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { diff --git a/inc/modules/member/what-welcome.php b/inc/modules/member/what-welcome.php index c5d75511dd..ce5e843fad 100644 --- a/inc/modules/member/what-welcome.php +++ b/inc/modules/member/what-welcome.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif (!IS_MEMBER()) -{ +} elseif (!IS_MEMBER()) { LOAD_URL("modules.php?module=index"); } diff --git a/inc/modules/member/what-wernis.php b/inc/modules/member/what-wernis.php index 3c48c8640b..a2d9e43ed4 100644 --- a/inc/modules/member/what-wernis.php +++ b/inc/modules/member/what-wernis.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { diff --git a/inc/modules/order.php b/inc/modules/order.php index 73626631b5..c0164a51d7 100644 --- a/inc/modules/order.php +++ b/inc/modules/order.php @@ -33,7 +33,7 @@ // Some security stuff... $URL = ""; -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("order")) && (!IS_ADMIN())) { diff --git a/inc/modules/sponsor.php b/inc/modules/sponsor.php index 27cf4dc6db..f0450923b3 100644 --- a/inc/modules/sponsor.php +++ b/inc/modules/sponsor.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) { diff --git a/inc/modules/sponsor/.php b/inc/modules/sponsor/.php index eeb6fe4494..27fcb6f39c 100644 --- a/inc/modules/sponsor/.php +++ b/inc/modules/sponsor/.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) { diff --git a/inc/modules/sponsor/account.php b/inc/modules/sponsor/account.php index b23ec6a99a..25a03a9e38 100644 --- a/inc/modules/sponsor/account.php +++ b/inc/modules/sponsor/account.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) { diff --git a/inc/modules/sponsor/settings.php b/inc/modules/sponsor/settings.php index 927d33cf97..b6f78e32f7 100644 --- a/inc/modules/sponsor/settings.php +++ b/inc/modules/sponsor/settings.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) { diff --git a/inc/modules/sponsor/welcome.php b/inc/modules/sponsor/welcome.php index 4aa7880e92..95f0a3a4a7 100644 --- a/inc/modules/sponsor/welcome.php +++ b/inc/modules/sponsor/welcome.php @@ -31,7 +31,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) { diff --git a/inc/modules/welcome.php b/inc/modules/welcome.php index d59a536d71..ce50f5bcc7 100644 --- a/inc/modules/welcome.php +++ b/inc/modules/welcome.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/monthly/monthly_ b/inc/monthly/monthly_ index 2dd861a40c..729b3b8b4e 100644 --- a/inc/monthly/monthly_ +++ b/inc/monthly/monthly_ @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) -{ +} elseif (!EXT_IS_ACTIVE("")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE); return; } diff --git a/inc/monthly/monthly_beg.php b/inc/monthly/monthly_beg.php index 579f4de62c..55188d1175 100644 --- a/inc/monthly/monthly_beg.php +++ b/inc/monthly/monthly_beg.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) { diff --git a/inc/monthly/monthly_bonus.php b/inc/monthly/monthly_bonus.php index f4e465fb58..e270061a96 100644 --- a/inc/monthly/monthly_bonus.php +++ b/inc/monthly/monthly_bonus.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus"); return; } diff --git a/inc/monthly/monthly_newsletter.php b/inc/monthly/monthly_newsletter.php index ed7eb9205b..46b2bdb182 100644 --- a/inc/monthly/monthly_newsletter.php +++ b/inc/monthly/monthly_newsletter.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("newsletter")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("newsletter")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "newsletter"); return; } diff --git a/inc/monthly/monthly_surfbar.php b/inc/monthly/monthly_surfbar.php index cdcf1606ec..4b23ca9f79 100644 --- a/inc/monthly/monthly_surfbar.php +++ b/inc/monthly/monthly_surfbar.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) { diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index 57737072c9..85323f6bad 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -135,9 +135,6 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT // Update online list UPDATE_ONLINE_LIST($PHPSESSID, $GLOBALS['module'], $GLOBALS['action'], $GLOBALS['what']); - // Load theme name - $currTheme = GET_CURR_THEME(); - // Set default 'what' value //* DEBUG */ echo "-".$GLOBALS['module']."/".$GLOBALS['what']."-
\n"; if ((empty($GLOBALS['what'])) && (empty($GLOBALS['action'])) && ($CSS != 1) && ($CSS != -1)) { diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 756e52d3b3..c32622cf8e 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -44,7 +44,8 @@ function ADD_MODULE_TITLE($mod) { // Is the script installed? if (isBooleanConstantAndTrue('mxchange_installed')) { - if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($cacheArray['modules']['module'])) && (is_array($cacheArray['modules']['module'])) && (isset($cacheArray['modules']['module'][$mod]))) { + // Check if cache is valid + if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($cacheArray['modules']['module'])) && (in_array($mod, $cacheArray['modules']['module']))) { // Load from cache $name = $cacheArray['modules']['title'][$mod]; @@ -56,7 +57,7 @@ function ADD_MODULE_TITLE($mod) { list($name) = SQL_FETCHROW($result); SQL_FREERESULT($result); } - } + } // END - if // Trim name $name = trim($name); @@ -68,8 +69,10 @@ function ADD_MODULE_TITLE($mod) { if (SQL_NUMROWS($result) == 0) { // Add module to database $dummy = CHECK_MODULE($mod); - } - } + } // END - if + } // END - if + + // Return name return $name; } @@ -454,9 +457,12 @@ function IS_ADMIN($admin="") // Admin login was found so let's load password from DB list($passDB) = SQL_FETCHROW($result); + // Temporary cache it + $cacheArray['admins']['password'][$admin] = $passDB; + // Generate password hash $valPass = generatePassString($passDB); - } + } // END - if // Free memory SQL_FREERESULT($result); @@ -893,7 +899,7 @@ function COUNT_MODULE($mod) function GET_ACTION ($MODE, &$wht) { global $ret, $_CONFIG; - // DEPRECATED: Init status + // @DEPRECATED Init status $ret = ""; //* DEBUG: */ echo __LINE__."=".$MODE."/".$wht."/".$GLOBALS['action']."=
"; diff --git a/inc/patch-system.php b/inc/patch-system.php index 9eb7c43df2..c0daae6238 100644 --- a/inc/patch-system.php +++ b/inc/patch-system.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/pool-update.php b/inc/pool-update.php index 58a1bb91cd..20b4062502 100644 --- a/inc/pool-update.php +++ b/inc/pool-update.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/profile-updte.php b/inc/profile-updte.php index 17f56d3d86..fb40eb9efa 100644 --- a/inc/profile-updte.php +++ b/inc/profile-updte.php @@ -33,8 +33,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/reset/reset_ b/inc/reset/reset_ index 98eaa943fe..fa3bff0800 100644 --- a/inc/reset/reset_ +++ b/inc/reset/reset_ @@ -32,10 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) { +} elseif (!EXT_IS_ACTIVE("")) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE); return; } diff --git a/inc/reset/reset_beg.php b/inc/reset/reset_beg.php index c668ba3b2e..d4bf446968 100644 --- a/inc/reset/reset_beg.php +++ b/inc/reset/reset_beg.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) { diff --git a/inc/reset/reset_bonus.php b/inc/reset/reset_bonus.php index 98c2ab506d..f4e42eb440 100644 --- a/inc/reset/reset_bonus.php +++ b/inc/reset/reset_bonus.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus"); return; } diff --git a/inc/reset/reset_daily.php b/inc/reset/reset_daily.php index b8adac194a..250730be76 100644 --- a/inc/reset/reset_daily.php +++ b/inc/reset/reset_daily.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/reset/reset_engine.php b/inc/reset/reset_engine.php index fdc3192366..f385dd0e20 100644 --- a/inc/reset/reset_engine.php +++ b/inc/reset/reset_engine.php @@ -32,13 +32,10 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} - elseif ((!EXT_IS_ACTIVE("engine")) && (!IS_ADMIN())) -{ +} elseif ((!EXT_IS_ACTIVE("engine")) && (!IS_ADMIN())) { ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "engine"); return; } diff --git a/inc/reset/reset_holiday.php b/inc/reset/reset_holiday.php index 3fc5f67995..3a2256fa24 100644 --- a/inc/reset/reset_holiday.php +++ b/inc/reset/reset_holiday.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("holiday")) && (!IS_ADMIN())) { diff --git a/inc/reset/reset_surfbar.php b/inc/reset/reset_surfbar.php index 3b83306d32..9c9f0a1e21 100644 --- a/inc/reset/reset_surfbar.php +++ b/inc/reset/reset_surfbar.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) { diff --git a/inc/session.php b/inc/session.php index b3c4dfbd55..2c7ab4488d 100644 --- a/inc/session.php +++ b/inc/session.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/sql_error.php b/inc/sql_error.php index fa001a2ff6..c6597e5298 100644 --- a/inc/sql_error.php +++ b/inc/sql_error.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } diff --git a/inc/stats_bonus.php b/inc/stats_bonus.php index a064faedea..2ad4a0cf4d 100644 --- a/inc/stats_bonus.php +++ b/inc/stats_bonus.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); diff --git a/inc/stylesheet.php b/inc/stylesheet.php index 497339beb8..10341b96e8 100644 --- a/inc/stylesheet.php +++ b/inc/stylesheet.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -50,11 +49,9 @@ if ((basename($_SERVER['PHP_SELF']) == "install.php") || (!isBooleanConstantAndT if (empty($_CONFIG['css_php'])) $_CONFIG['css_php'] = "FILE"; // Output CSS files or content or link to css.php ? -if (($CSS == "1") || ($_CONFIG['css_php'] == "DIRECT")) -{ +if (($CSS == "1") || ($_CONFIG['css_php'] == "DIRECT")) { // Load CSS files - if (is_array($EXT_CSS_FILES)) - { + if (is_array($EXT_CSS_FILES)) { // Load extension's CSS files foreach ($EXT_CSS_FILES as $value) $STYLES[] = $value; } @@ -65,11 +62,10 @@ if (($CSS == "1") || ($_CONFIG['css_php'] == "DIRECT")) function GET_CURR_THEME () { return "default"; } - } + } // END - if // Output inclusion lines - foreach ($STYLES as $value) - { + foreach ($STYLES as $value) { // Only include found CSS files (to reduce 404 requests) $BASE = sprintf("%stheme/%s/css/", PATH, GET_CURR_THEME()); $file = $BASE.$value; @@ -78,7 +74,7 @@ if (($CSS == "1") || ($_CONFIG['css_php'] == "DIRECT")) if ((FILE_READABLE($file)) && (filesize($file) > 0)) { switch ($_CONFIG['css_php']) { case "DIRECT": - OUTPUT_HTML(""); + OUTPUT_HTML(""); break; case "FILE": @@ -94,8 +90,8 @@ if (($CSS == "1") || ($_CONFIG['css_php'] == "DIRECT")) if (isBooleanConstantAndTrue('mxchange_installing')) { // Default theme first $NEW_THEME = "default"; - if (!empty($_GET['theme'])) $NEW_THEME = $_GET['theme']; - if (!empty($_POST['theme'])) $NEW_THEME = $_POST['theme']; + if (!empty($_GET['theme'])) $NEW_THEME = SQL_ESCAPE($_GET['theme']); + if (!empty($_POST['theme'])) $NEW_THEME = SQL_ESCAPE($_POST['theme']); OUTPUT_HTML("?theme=".$NEW_THEME."&installing=1", false); } OUTPUT_HTML("\" />"); diff --git a/inc/theme-manager.php b/inc/theme-manager.php index 0ee37962e4..ab5cb1dbe6 100644 --- a/inc/theme-manager.php +++ b/inc/theme-manager.php @@ -32,8 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } @@ -43,7 +42,7 @@ require_once(PATH."inc/session.php"); // Get current theme name function GET_CURR_THEME() { - global $INC_POOL, $_CONFIG, $CSS; + global $INC_POOL, $_CONFIG, $CSS, $cacheArray; // The default theme is 'default'... ;-) $ret = "default"; @@ -55,24 +54,24 @@ function GET_CURR_THEME() { // Set default theme set_session("mxchange_theme", $ret); } elseif ((isSessionVariableSet('mxchange_theme')) && (GET_EXT_VERSION("sql_patches") >= "0.1.4")) { + //die("
".print_r($cacheArray['themes'], true)."
"); // Get theme from cookie - $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_themes WHERE theme_path='%s' LIMIT 1", array(get_session('mxchange_theme')), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) { - // Design is valid! - $ret = get_session('mxchange_theme'); - } + $ret = get_session('mxchange_theme'); - // Free memory - SQL_FREERESULT($result); + // Is it valid? + if (THEME_GET_ID($ret) == 0) { + // Fix it to default + $ret = "default"; + } // END - if } elseif ((!isBooleanConstantAndTrue('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($CSS == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) { // Prepare FQFN for checking - $theme = sprintf("%stheme/%s/theme.php", PATH, $_GET['theme']); + $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_GET['theme'])); // Installation mode active if ((!empty($_GET['theme'])) && (FILE_READABLE($theme))) { // Set cookie from URL data set_session("mxchange_theme", $_GET['theme']); - } elseif (FILE_READABLE(PATH."theme/".$_POST['theme']."/theme.php")) { + } elseif (FILE_READABLE(sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme'])))) { // Set cookie from posted data set_session("mxchange_theme", $_POST['theme']); } @@ -96,7 +95,6 @@ function GET_CURR_THEME() { function THEME_SELECTION_BOX($mod, $act, $wht, $result) { // Construction URL - global $currTheme; $FORM = URL."/modules.php?module=".$mod; if (!empty($act)) $FORM .= "&action=".$act; if (!empty($wht)) $FORM .= "&what=".$wht; @@ -127,7 +125,7 @@ function THEME_SELECTION_BOX($mod, $act, $wht, $result) { $OUT = ""; foreach ($THEMES['theme_unix'] as $key => $theme) { $OUT .= "