|
From: Greg M. <bli...@us...> - 2008-08-23 19:47:25
|
Update of /cvsroot/phpwebsite-comm/modules/mailinglists/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12069/class Modified Files: Runtime.php Log Message: Purge subscribers who haven't activated in over 2 days. Index: Runtime.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/mailinglists/class/Runtime.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Runtime.php 2 Jan 2008 21:59:25 -0000 1.1 --- Runtime.php 23 Aug 2008 19:47:00 -0000 1.2 *************** *** 236,239 **** --- 236,250 ---- $db->unlockTables(); } + + function cleanup() + { + /* Purge subscribers who haven't activated in over 2 days. */ + $clean_time = (mktime() - (86400*2)); + + $db = new PHPWS_DB('mailinglists_subscribers'); + $db->addWhere('subscribed', $clean_time, '<'); + $db->addWhere('active', 0); + PHPWS_Error::logIfError($db->delete()); + } } |