diff --git a/cron.php b/cron.php index 53d5e7442..5d8021a64 100644 --- a/cron.php +++ b/cron.php @@ -41,26 +41,31 @@ require_once(realpath(dirname(__FILE__)."/class2.php")); $pwd = str_replace('token=','',$pwd); } - if($pref['e_cron_pwd'] != $pwd) + if(($pref['e_cron_pwd'] != $pwd) || empty($pref['e_cron_pwd'])) { - require_once(e_HANDLER."mail.php"); - - $message = "Your Cron Schedule is not configured correctly. Your passwords do not match. -

- Sent from cron: ".$pwd."
- Stored in e107: ".$pref['e_cron_pwd']."

- You should regenerate the cron command in admin and enter it again in your server configuration. - "; - - $message .= "

Debug Info

"; - $message .= "

_SERVER

"; - $message .= print_a($_SERVER,true); - $message .= "

_ENV

"; - $message .= print_a($_ENV,true); - $message .= "

_GET

"; - $message .= print_a($_GET,true); - - sendemail($pref['siteadminemail'], "e107 - Cron Schedule Misconfigured.", $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']); + + if(!empty($pwd)) + { + require_once(e_HANDLER."mail.php"); + + $message = "Your Cron Schedule is not configured correctly. Your passwords do not match. +

+ Sent from cron: ".$pwd."
+ Stored in e107: ".$pref['e_cron_pwd']."

+ You should regenerate the cron command in admin and enter it again in your server configuration. + "; + + $message .= "

Debug Info

"; + $message .= "

_SERVER

"; + $message .= print_a($_SERVER,true); + $message .= "

_ENV

"; + $message .= print_a($_ENV,true); + $message .= "

_GET

"; + $message .= print_a($_GET,true); + + sendemail($pref['siteadminemail'], "e107 - Cron Schedule Misconfigured.", $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']); + } + exit; }