1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

Fix for crons not running under some circumstances.

This commit is contained in:
Cameron
2014-11-15 11:27:54 -08:00
parent d4d55ac057
commit ca416467ba
2 changed files with 13 additions and 13 deletions

View File

@@ -980,7 +980,7 @@ if(varset($pref['force_userupdate']) && USER && !isset($_E107['no_forceuserupdat
$sql->db_Mark_Time('Start: Signup/splash/admin'); $sql->db_Mark_Time('Start: Signup/splash/admin');
if(($pref['membersonly_enabled'] && !isset($_E107['allow_guest'])) || $pref['maintainance_flag']) if(($pref['membersonly_enabled'] && !isset($_E107['allow_guest'])) || ($pref['maintainance_flag'] && empty($_E107['cli'])))
{ {
//XXX move force_userupdate() also? //XXX move force_userupdate() also?
e107::getRedirect()->checkMaintenance(); e107::getRedirect()->checkMaintenance();

View File

@@ -4,35 +4,32 @@
+ ----------------------------------------------------------------------------+ + ----------------------------------------------------------------------------+
|| e107 website system || e107 website system
| |
| Copyright (C) 2008-2009 e107 Inc | Copyright (C) 2008-2014 e107 Inc
| http://e107.org | http://e107.org
| |
| |
| Released under the terms and conditions of the | Released under the terms and conditions of the
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/cron.php,v $
| $Revision$
| $Date$
| $Author$
+----------------------------------------------------------------------------+
*/ */
// Usage: [full path to this script]cron.php --u=admin --p=password // use your admin login. // Usage: [full path to this script]cron.php --u=admin --p=password // use your admin login.
// test // test
$_E107['cli'] = TRUE; $_E107['cli'] = true;
$_E107['debug'] = false; $_E107['debug'] = false;
$_E107['no_online'] = TRUE; $_E107['no_online'] = true;
$_E107['no_forceuserupdate'] = TRUE; $_E107['no_forceuserupdate'] = true;
$_E107['no_menus'] = TRUE; $_E107['no_menus'] = true;
$_E107['allow_guest'] = true; // allow crons to run while in members-only mode.
// we allow theme init as cron jobs might need to access current theme templates (e.g. custom email templates) // we allow theme init as cron jobs might need to access current theme templates (e.g. custom email templates)
require_once(realpath(dirname(__FILE__)."/class2.php")); require_once(realpath(dirname(__FILE__)."/class2.php"));
$pwd = ($_E107['debug'] && $_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : trim($_SERVER['argv'][1]); $pwd = ($_E107['debug'] && $_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : trim($_SERVER['argv'][1]);
if(empty($pwd) && !empty($_GET['token'])) if(!empty($_GET['token']))
{ {
$pwd = $_GET['token']; $pwd = $_GET['token'];
} }
@@ -48,9 +45,12 @@ require_once(realpath(dirname(__FILE__)."/class2.php"));
You should regenerate the cron command in admin and enter it again in your server configuration. You should regenerate the cron command in admin and enter it again in your server configuration.
"; ";
$message .= "<h4>Debug Info</h4>"; $message .= "<h2>Debug Info</h2>";
$message .= "<h3>_SERVER</h3>";
$message .= print_a($_SERVER,true); $message .= print_a($_SERVER,true);
$message .= "<h3>_ENV</h3>";
$message .= print_a($_ENV,true); $message .= print_a($_ENV,true);
$message .= "<h3>_GET</h3>";
$message .= print_a($_GET,true); $message .= print_a($_GET,true);
sendemail($pref['siteadminemail'], "e107 - Cron Schedule Misconfigured.", $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']); sendemail($pref['siteadminemail'], "e107 - Cron Schedule Misconfigured.", $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']);