From 094f3a6af3b901020395eafee16b3b5e151f1137 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 12 Jan 2013 06:37:44 +0000 Subject: [PATCH] Added script template for cron jobs, fixed some checks on CSS/HTML mode --- .gitattributes | 2 ++ inc/daily/daily_ | 2 +- inc/daily/daily_100_bonus.php | 2 +- inc/daily/daily_autopurge.php | 2 +- inc/daily/daily_beg.php | 2 +- inc/daily/daily_birthday.php | 2 +- inc/daily/daily_bonus.php | 2 +- inc/daily/daily_doubler.php | 2 +- inc/daily/daily_earning.php | 2 +- inc/daily/daily_holiday.php | 2 +- inc/daily/daily_order.php | 2 +- inc/daily/daily_profile.php | 2 +- inc/daily/daily_surfbar.php | 2 +- inc/daily/daily_user.php | 2 +- inc/daily/daily_user_subids.php | 2 +- inc/daily/daily_yoomedia.php | 2 +- inc/hourly/hourly_ | 4 +-- inc/jobs/.htaccess | 1 + inc/jobs/job_ | 56 ++++++++++++++++++++++++++++++ inc/monthly/monthly_ | 4 +-- inc/monthly/monthly_beg.php | 4 +-- inc/monthly/monthly_bonus.php | 4 +-- inc/monthly/monthly_newsletter.php | 4 +-- inc/monthly/monthly_surfbar.php | 4 +-- inc/weekly/weekly_ | 4 +-- inc/weekly/weekly_surfbar.php | 4 +-- 26 files changed, 90 insertions(+), 31 deletions(-) create mode 100644 inc/jobs/.htaccess create mode 100644 inc/jobs/job_ diff --git a/.gitattributes b/.gitattributes index 4ce171147d..757daa1c31 100644 --- a/.gitattributes +++ b/.gitattributes @@ -305,6 +305,8 @@ inc/install/install_page_5.php svneol=native#text/plain inc/install/install_page_finalize.php svneol=native#text/plain inc/install/install_page_finished.php svneol=native#text/plain inc/install/install_page_welcome.php svneol=native#text/plain +inc/jobs/.htaccess svneol=native#text/plain +inc/jobs/job_ svneol=native#text/plain inc/js/.htaccess svneol=native#text/plain inc/js/js- svneol=native#text/plain inc/js/js-admin_ajax.php svneol=native#text/plain diff --git a/inc/daily/daily_ b/inc/daily/daily_ index ed360158a2..9dc6242bd7 100644 --- a/inc/daily/daily_ +++ b/inc/daily/daily_ @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionActive('')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext- disabled.'); diff --git a/inc/daily/daily_100_bonus.php b/inc/daily/daily_100_bonus.php index 622e598a90..e62ffbb9f0 100644 --- a/inc/daily/daily_100_bonus.php +++ b/inc/daily/daily_100_bonus.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionActive('bonus')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-bonus disabled.'); diff --git a/inc/daily/daily_autopurge.php b/inc/daily/daily_autopurge.php index 7d18667b26..61ef29aa0c 100644 --- a/inc/daily/daily_autopurge.php +++ b/inc/daily/daily_autopurge.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionActive('autopurge')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-autopurge disabled.'); diff --git a/inc/daily/daily_beg.php b/inc/daily/daily_beg.php index 05321b1e81..5970927f95 100644 --- a/inc/daily/daily_beg.php +++ b/inc/daily/daily_beg.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionActive('beg')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-beg disabled.'); diff --git a/inc/daily/daily_birthday.php b/inc/daily/daily_birthday.php index a724e2220b..a4de24302c 100644 --- a/inc/daily/daily_birthday.php +++ b/inc/daily/daily_birthday.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode + // Do not execute when script is in non-HTML mode return; } elseif (!isExtensionActive('birthday')) { // Extension not active/installed diff --git a/inc/daily/daily_bonus.php b/inc/daily/daily_bonus.php index 47681aeb60..ac7c83c3ab 100644 --- a/inc/daily/daily_bonus.php +++ b/inc/daily/daily_bonus.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionActive('bonus')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-bonus disabled.'); diff --git a/inc/daily/daily_doubler.php b/inc/daily/daily_doubler.php index b316f9c28a..b6a81caa24 100644 --- a/inc/daily/daily_doubler.php +++ b/inc/daily/daily_doubler.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif ((!isExtensionActive('doubler')) || (getDoublerSendMode() != 'RESET')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-doubler disabled.'); diff --git a/inc/daily/daily_earning.php b/inc/daily/daily_earning.php index f6c0c5d495..ca7c19ef3c 100644 --- a/inc/daily/daily_earning.php +++ b/inc/daily/daily_earning.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionActive('earning')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-earning disabled.'); diff --git a/inc/daily/daily_holiday.php b/inc/daily/daily_holiday.php index dcf962f325..4f759d7710 100644 --- a/inc/daily/daily_holiday.php +++ b/inc/daily/daily_holiday.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || ((!isResetModeEnabled()) && (getConfig('holiday_mode') == 'RESET'))) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionActive('holiday')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-holiday disabled.'); diff --git a/inc/daily/daily_order.php b/inc/daily/daily_order.php index d424e14c8c..2789b2b6ed 100644 --- a/inc/daily/daily_order.php +++ b/inc/daily/daily_order.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionActive('order')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-order disabled.'); diff --git a/inc/daily/daily_profile.php b/inc/daily/daily_profile.php index 70b0eb96b5..4fdda8ba0d 100644 --- a/inc/daily/daily_profile.php +++ b/inc/daily/daily_profile.php @@ -40,7 +40,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionActive('profile')) { logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-profile disabled.'); diff --git a/inc/daily/daily_surfbar.php b/inc/daily/daily_surfbar.php index 44ad188140..9d9790a4eb 100644 --- a/inc/daily/daily_surfbar.php +++ b/inc/daily/daily_surfbar.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionActive('surfbar')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-surfbar disabled.'); diff --git a/inc/daily/daily_user.php b/inc/daily/daily_user.php index 35483f6a76..ec4fc49acf 100644 --- a/inc/daily/daily_user.php +++ b/inc/daily/daily_user.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif ((!isExtensionActive('sql_patches')) || (!isExtensionActive('user'))) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension(s) ext-sql_patches/ext-user disabled.'); diff --git a/inc/daily/daily_user_subids.php b/inc/daily/daily_user_subids.php index 449350faa9..84df36e3f0 100644 --- a/inc/daily/daily_user_subids.php +++ b/inc/daily/daily_user_subids.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionInstalledAndNewer('user', '0.5.8')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-user disabled or out-dated.'); diff --git a/inc/daily/daily_yoomedia.php b/inc/daily/daily_yoomedia.php index d1827deace..d2ecafdbcd 100644 --- a/inc/daily/daily_yoomedia.php +++ b/inc/daily/daily_yoomedia.php @@ -39,7 +39,7 @@ if (!defined('__SECURITY')) { die(); } elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionActive('yoomedia')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-yoomedia disabled.'); diff --git a/inc/hourly/hourly_ b/inc/hourly/hourly_ index 9d501114ab..42c7659d11 100644 --- a/inc/hourly/hourly_ +++ b/inc/hourly/hourly_ @@ -38,8 +38,8 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} elseif ((isCssOutputMode()) || (isHourlyResetEnabled()) || (!isExtensionInstalledAndNewer('sql_patches', '0.7.5'))) { - // Do not execute when script is in CSS mode or no hourly reset +} elseif ((!isHtmlOutputMode()) || (isHourlyResetEnabled()) || (!isExtensionInstalledAndNewer('sql_patches', '0.7.5'))) { + // Do not execute when script is in non-HTML mode or no hourly reset return; } elseif (!isExtensionActive('')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext- disabled.'); diff --git a/inc/jobs/.htaccess b/inc/jobs/.htaccess new file mode 100644 index 0000000000..3a42882788 --- /dev/null +++ b/inc/jobs/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/jobs/job_ b/inc/jobs/job_ new file mode 100644 index 0000000000..6433a01ffd --- /dev/null +++ b/inc/jobs/job_ @@ -0,0 +1,56 @@ + diff --git a/inc/monthly/monthly_ b/inc/monthly/monthly_ index ff113267fb..a6cd3a91d7 100644 --- a/inc/monthly/monthly_ +++ b/inc/monthly/monthly_ @@ -38,8 +38,8 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} elseif ((isCssOutputMode()) || (isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no hourly reset +} elseif ((!isHtmlOutputMode()) || (isResetModeEnabled())) { + // Do not execute when script is in non-HTML mode or no hourly reset return; } elseif (!isExtensionActive('')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext- disabled.'); diff --git a/inc/monthly/monthly_beg.php b/inc/monthly/monthly_beg.php index 9c09db6985..0d6dd424bd 100644 --- a/inc/monthly/monthly_beg.php +++ b/inc/monthly/monthly_beg.php @@ -38,8 +38,8 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} elseif ((isCssOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no hourly reset +} elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { + // Do not execute when script is in non-HTML mode or no hourly reset return; } elseif ((!isExtensionActive('beg')) || (!isBegRallyeEnabled())) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-beg disabled.'); diff --git a/inc/monthly/monthly_bonus.php b/inc/monthly/monthly_bonus.php index c663790830..eb640a1bac 100644 --- a/inc/monthly/monthly_bonus.php +++ b/inc/monthly/monthly_bonus.php @@ -38,8 +38,8 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} elseif ((isCssOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no hourly reset +} elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { + // Do not execute when script is in non-HTML mode or no hourly reset return; } elseif (!isExtensionActive('bonus')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-bonus disabled.'); diff --git a/inc/monthly/monthly_newsletter.php b/inc/monthly/monthly_newsletter.php index 34927f2595..58a1aabd41 100644 --- a/inc/monthly/monthly_newsletter.php +++ b/inc/monthly/monthly_newsletter.php @@ -38,8 +38,8 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} elseif ((isCssOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no hourly reset +} elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { + // Do not execute when script is in non-HTML mode or no hourly reset return; } elseif (!isExtensionActive('newsletter')) { logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-newsletter disabled.'); diff --git a/inc/monthly/monthly_surfbar.php b/inc/monthly/monthly_surfbar.php index 9c73218b6c..ce88cf5204 100644 --- a/inc/monthly/monthly_surfbar.php +++ b/inc/monthly/monthly_surfbar.php @@ -38,8 +38,8 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} elseif ((isCssOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no hourly reset +} elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { + // Do not execute when script is in non-HTML mode or no hourly reset return; } elseif (!isExtensionActive('surfbar')) { logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-surfbar disabled.'); diff --git a/inc/weekly/weekly_ b/inc/weekly/weekly_ index fd2662f93a..b7b17bb69a 100644 --- a/inc/weekly/weekly_ +++ b/inc/weekly/weekly_ @@ -38,8 +38,8 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} elseif ((isCssOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset +} elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionActive('')) { if (isDebugModeEnabled()) logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext- disabled.'); diff --git a/inc/weekly/weekly_surfbar.php b/inc/weekly/weekly_surfbar.php index 8d7b7b9588..07fe708c01 100644 --- a/inc/weekly/weekly_surfbar.php +++ b/inc/weekly/weekly_surfbar.php @@ -38,8 +38,8 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} elseif ((isCssOutputMode()) || (!isResetModeEnabled())) { - // Do not execute when script is in CSS mode or no daily reset +} elseif ((!isHtmlOutputMode()) || (!isResetModeEnabled())) { + // Do not execute when script is in non-HTML mode or no daily reset return; } elseif (!isExtensionActive('surfbar')) { logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension ext-surfbar disabled.'); -- 2.39.2