Пример #1
0
                $onlyText = false;
            } else {
                $onlyText = true;
            }
            if (eF_mail($GLOBALS['configuration']['system_email'], $recipient, $notification['subject'], $notification['body'], false, $onlyText)) {
                $sent_messages = 1;
            } else {
                $sent_messages = 0;
            }
        }
    } else {
        //debug();
        if (!$GLOBALS['configuration']['notifications_lock'] || time() - $GLOBALS['configuration']['notifications_lock'] > 600) {
            //10 minutes maximum lock time
            EFrontConfiguration::setValue('notifications_lock', time());
            $sent_messages = EfrontNotification::sendNextNotifications($GLOBALS['configuration']['notifications_messages_per_time']);
            EFrontConfiguration::setValue('notifications_lock', 0);
        } else {
            chdir($dir);
            echo "locked";
            exit;
        }
    }
}
//pr($sent_messages);
//debug(false);
if ($GLOBALS['configuration']['notifications_maximum_inter_time'] > 0) {
    EfrontConfiguration::setValue('notifications_last_send_timestamp', time());
}
if ($sent_messages) {
    EfrontNotification::clearSentMessages();