AntonLV 10 years ago
parent
commit
9aa09c7d64
1 changed files with 10 additions and 4 deletions
  1. 10 4
      inc/classes/BxDolCronAccount.php

+ 10 - 4
inc/classes/BxDolCronAccount.php

@@ -18,10 +18,8 @@ class BxDolCronAccount extends BxDolCron
 
     protected function finish()
     {
-        if (!($sOutput = ob_get_clean()))
-            return;
-
-		if(getParam('enable_notification_account') != 'on')
+        $sOutput = ob_get_clean();
+		if(!$sOutput || getParam('enable_notification_account') != 'on')
 			return;
 
         $aTemplate = BxDolEmailTemplates::getInstance()->parseTemplate('t_Account', array(
@@ -57,13 +55,21 @@ class BxDolCronAccount extends BxDolCron
     protected function processNewlyJoined()
     {
         $aAccounts = BxDolAccountQuery::getInstance()->getAccounts(array('type' => 'by_join_date', 'date' => time() - 86400));
+        if(empty($aAccounts) || !is_array($aAccounts))
+            return;
 
         $sAccounts = "";
         foreach($aAccounts as $aAccount) {
         	$oProfile = BxDolProfile::getInstance($aAccount['profile_id']);
+        	if(!$oProfile)
+        	    continue;
+
         	$sAccounts .= _t('_sys_notification_account_link', $oProfile->getUrl(), $oProfile->getDisplayName(), $aAccount['email']);
         }
 
+        if(!$sAccounts)
+            return;
+
         echo _t('_sys_notification_account', $sAccounts);
     }