X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Notify.php;h=15bbc7a28980e0d5c8d64f43183c38b9b8e42350;hb=7e9cdd246cc8bba1ce46a4db263a0f49b7cbc5a0;hp=9cc389632cbf2b87317354f7efbadc30c5a89291;hpb=3c65f3a064d717285c5fddbb378eec20e1a5a5fd;p=Pman.Core diff --git a/Notify.php b/Notify.php index 9cc38963..15bbc7a2 100644 --- a/Notify.php +++ b/Notify.php @@ -16,7 +16,13 @@ require_once 'Pman.php'; class Pman_Core_Notify extends Pman { - static $cli_desc = "Send out notification emails (usually from cron)"; + static $cli_desc = "Runs the notification queue (usually from cron) + Normally used to sends out emails to anyone in the notification list. + + /etc/cron.d/pman-core-notify + * * * * * www-data /usr/bin/php /home/gitlive/web.mtrack/admin.php Core/Notify > /dev/null + +"; static $cli_opts = array( 'debug' => array( @@ -65,7 +71,7 @@ class Pman_Core_Notify extends Pman var $target = 'Core/NotifySend'; var $evtype = ''; // any notification... // this script should only handle EMAIL notifications.. - + var $force = false; function getAuth() { $ff = HTML_FlexyFramework::get(); @@ -117,8 +123,11 @@ class Pman_Core_Notify extends Pman $w = DB_DataObject::factory($this->table); if (!$showold) { - $w->whereAdd('act_when > sent'); // eg.. sent is not valid.. + // standard + + $w->whereAdd('act_when > sent'); // eg.. sent is not valid.. + $w->whereAdd('act_start > NOW() - INTERVAL 14 DAY'); // ignore the ones stuck in the queue if (!$this->force) { $w->whereAdd('act_when < NOW()'); // eg.. not if future.. }