From 44aadef1eae9767d1d54da2821119aa60a5ee4f6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 6 Oct 2008 16:03:38 +0000 Subject: [PATCH] Reset scripts rewritten in header --- inc/databases.php | 2 +- inc/mails/_mails.php | 6 +++--- inc/mails/beg_mails.php | 5 ++--- inc/mails/birthday_mails.php | 5 ++--- inc/mails/bonus_mails.php | 5 ++--- inc/monthly/monthly_beg.php | 3 +-- inc/monthly/monthly_bonus.php | 3 +-- inc/monthly/monthly_newsletter.php | 3 +-- inc/monthly/monthly_surfbar.php | 5 ++--- inc/reset/reset_ | 3 +-- inc/reset/reset_beg.php | 3 +-- inc/reset/reset_bonus.php | 3 +-- inc/reset/reset_daily.php | 4 +++- inc/reset/reset_engine.php | 3 +-- inc/reset/reset_holiday.php | 3 +-- inc/reset/reset_surfbar.php | 5 ++--- inc/weekly/weekly_ | 3 +-- inc/weekly/weekly_surfbar.php | 3 +-- 18 files changed, 27 insertions(+), 40 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index 81b7b59e3d..a9558a3c8e 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "456"); +define('CURR_SVN_REVISION', "457"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/mails/_mails.php b/inc/mails/_mails.php index 2032d04786..a208c5376f 100644 --- a/inc/mails/_mails.php +++ b/inc/mails/_mails.php @@ -35,13 +35,13 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, ""); +} elseif (!EXT_IS_ACTIVE("")) { return; } // Do not execute when script is in CSS mode -if ($CSS == 1) return; +global $CSS; +if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; // ?> diff --git a/inc/mails/beg_mails.php b/inc/mails/beg_mails.php index 824313d9bc..3247190093 100644 --- a/inc/mails/beg_mails.php +++ b/inc/mails/beg_mails.php @@ -35,14 +35,13 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg"); +} elseif (!EXT_IS_ACTIVE("beg")) { return; } // Do not execute when script is in CSS mode global $CSS; -if ($CSS == 1) return; +if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; // Create timemark from saved month $mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time())); diff --git a/inc/mails/birthday_mails.php b/inc/mails/birthday_mails.php index ab74796524..83d8eb4ea8 100644 --- a/inc/mails/birthday_mails.php +++ b/inc/mails/birthday_mails.php @@ -35,14 +35,13 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("birthday")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "birthday"); +} elseif (!EXT_IS_ACTIVE("birthday")) { return; } // Do not execute when script is in CSS mode global $CSS; -if ($CSS == 1) return; +if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; // Get current day (01 to 31), month (01 to 12) and year (4-digits year) $DAY = date("d", time()); diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index a66f714ed3..50726857f9 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -35,14 +35,13 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus"); +} elseif (!EXT_IS_ACTIVE("bonus")) { return; } // Do not execute when script is in CSS mode global $CSS; -if ($CSS == 1) return; +if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; // Create timemark from saved month $mark = mktime(0, 0, 0, $_CONFIG['last_month'], date("d", time()), date('Y', time())); diff --git a/inc/monthly/monthly_beg.php b/inc/monthly/monthly_beg.php index cc69c583b4..3680e6d904 100644 --- a/inc/monthly/monthly_beg.php +++ b/inc/monthly/monthly_beg.php @@ -35,8 +35,7 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg"); +} elseif (!EXT_IS_ACTIVE("beg")) { return; } diff --git a/inc/monthly/monthly_bonus.php b/inc/monthly/monthly_bonus.php index c67f734f21..a7c002584b 100644 --- a/inc/monthly/monthly_bonus.php +++ b/inc/monthly/monthly_bonus.php @@ -35,8 +35,7 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus"); +} elseif (!EXT_IS_ACTIVE("bonus")) { return; } diff --git a/inc/monthly/monthly_newsletter.php b/inc/monthly/monthly_newsletter.php index 3e1ab6618e..776c99bd7f 100644 --- a/inc/monthly/monthly_newsletter.php +++ b/inc/monthly/monthly_newsletter.php @@ -35,8 +35,7 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("newsletter")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "newsletter"); +} elseif (!EXT_IS_ACTIVE("newsletter")) { return; } diff --git a/inc/monthly/monthly_surfbar.php b/inc/monthly/monthly_surfbar.php index 4b23ca9f79..35de46718f 100644 --- a/inc/monthly/monthly_surfbar.php +++ b/inc/monthly/monthly_surfbar.php @@ -35,13 +35,12 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE); +} elseif (!EXT_IS_ACTIVE("surfbar")) { return; } // Do not execute when script is in CSS mode or no daily reset -if (($CSS == 1) || (defined('__DAILY_RESET'))) return; +if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; // Reset surfbar counter UPDATE_CONFIG("surfbar_monthly_counter", "0"); diff --git a/inc/reset/reset_ b/inc/reset/reset_ index fa3bff0800..f9a56e2bf3 100644 --- a/inc/reset/reset_ +++ b/inc/reset/reset_ @@ -36,12 +36,11 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!EXT_IS_ACTIVE("")) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE); return; } // Do not execute when script is in CSS mode or no daily reset -if (($CSS == 1) || (defined('__DAILY_RESET'))) return; +if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; // ?> diff --git a/inc/reset/reset_beg.php b/inc/reset/reset_beg.php index ddad449cc0..66be41d664 100644 --- a/inc/reset/reset_beg.php +++ b/inc/reset/reset_beg.php @@ -35,8 +35,7 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("beg")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "beg"); +} elseif (!EXT_IS_ACTIVE("beg")) { return; } diff --git a/inc/reset/reset_bonus.php b/inc/reset/reset_bonus.php index d0a57bf66b..60e8003002 100644 --- a/inc/reset/reset_bonus.php +++ b/inc/reset/reset_bonus.php @@ -35,8 +35,7 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus"); +} elseif (!EXT_IS_ACTIVE("bonus")) { return; } diff --git a/inc/reset/reset_daily.php b/inc/reset/reset_daily.php index 9ae3f045b1..d0ee83a5a2 100644 --- a/inc/reset/reset_daily.php +++ b/inc/reset/reset_daily.php @@ -35,6 +35,8 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); +} elseif (!EXT_IS_ACTIVE("sql_patches")) { + return; } // Update user profiles @@ -65,7 +67,7 @@ WHERE userid=%s AND locked_points != 0.00000 ORDER BY ref_depth", // Ok transfer points while (list($dep, $locked) = SQL_FETCHROW($result_points)) { - //* DEBUG: */ echo basename(__FILE__).":uid={$uid},depth={$dep},locked={$locked}
\n"; + //* DEBUG: */ echo basename(__FILE__).":uid={$uid},depth={$dep},locked={$locked}
\n"; $result_update = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_points SET points=points+%s, locked_points=0.00000 WHERE userid=%s AND ref_depth=%d LIMIT 1", array($locked, bigintval($uid), $dep), __FILE__, __LINE__); diff --git a/inc/reset/reset_engine.php b/inc/reset/reset_engine.php index 9688395dac..9643621a01 100644 --- a/inc/reset/reset_engine.php +++ b/inc/reset/reset_engine.php @@ -35,8 +35,7 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("engine")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "engine"); +} elseif (!EXT_IS_ACTIVE("engine")) { return; } diff --git a/inc/reset/reset_holiday.php b/inc/reset/reset_holiday.php index b323667ddd..8545a247a0 100644 --- a/inc/reset/reset_holiday.php +++ b/inc/reset/reset_holiday.php @@ -35,8 +35,7 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("holiday")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "holiday"); +} elseif (!EXT_IS_ACTIVE("holiday")) { return; } diff --git a/inc/reset/reset_surfbar.php b/inc/reset/reset_surfbar.php index 9c9f0a1e21..5398a779e8 100644 --- a/inc/reset/reset_surfbar.php +++ b/inc/reset/reset_surfbar.php @@ -35,13 +35,12 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE); +} elseif (!EXT_IS_ACTIVE("surfbar")) { return; } // Do not execute when script is in CSS mode or no daily reset -if (($CSS == 1) || (defined('__DAILY_RESET'))) return; +if (($CSS == 1) || (!defined('__DAILY_RESET'))) return; // Reset surfbar counter UPDATE_CONFIG(array("surfbar_daily_counter", "surfbar_yester_counter`"), array(0, $_CONFIG['surfbar_daily_counter'])); diff --git a/inc/weekly/weekly_ b/inc/weekly/weekly_ index 8e3bc85796..aeed2d5a78 100644 --- a/inc/weekly/weekly_ +++ b/inc/weekly/weekly_ @@ -35,8 +35,7 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE); +} elseif (!EXT_IS_ACTIVE("")) { return; } diff --git a/inc/weekly/weekly_surfbar.php b/inc/weekly/weekly_surfbar.php index 2a9a0be3a2..b2a160abb4 100644 --- a/inc/weekly/weekly_surfbar.php +++ b/inc/weekly/weekly_surfbar.php @@ -35,8 +35,7 @@ if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); -} elseif ((!EXT_IS_ACTIVE("surfbar")) && (!IS_ADMIN())) { - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE); +} elseif (!EXT_IS_ACTIVE("surfbar")) { return; } -- 2.39.5