public function cleanUp()
 {
     if (!$this->keepReminders) {
         $queue = new w2p_System_EventQueue();
         $reminders = $queue->find('tasks', 'remind');
         $queue->delete_list = array_keys($reminders);
         $queue->commit_updates();
     }
 }
 public function __construct()
 {
     parent::__construct();
     trigger_error(get_class($this) . " has been deprecated in v3.1 and will be removed by v4.0. Please use " . get_parent_class($this) . " instead.", E_USER_NOTICE);
 }
Beispiel #3
0
 /**
  *
  */
 public function clearReminder($dont_check = false)
 {
     $ev = new w2p_System_EventQueue();
     $event_list = $ev->find('tasks', 'remind', $this->task_id);
     if (count($event_list)) {
         foreach ($event_list as $id => $notUsed) {
             if ($dont_check || $this->task_percent_complete >= 100) {
                 $ev->remove($id);
             }
         }
     }
 }
Beispiel #4
0
 /**
  * Queue mail to allow the queue manager to trigger
  * the email transfer.
  *
  * @access private
  */
 private function QueueMail()
 {
     $ec = new w2p_System_EventQueue();
     $vars = get_object_vars($this);
     return $ec->add(array('w2p_Utilities_Mail', 'SendQueuedMail'), $vars, 'w2p_Utilities_Mail', true);
 }
 public function gc()
 {
     global $AppUI;
     $max = $this->convertTime('max_lifetime');
     $idle = $this->convertTime('idle_time');
     // First pass is to kill any users that are logged in at the time of the session.
     $where = 'UNIX_TIMESTAMP() - UNIX_TIMESTAMP(session_updated) > ' . $idle . ' OR UNIX_TIMESTAMP() - UNIX_TIMESTAMP(session_created) > ' . $max;
     $q = new w2p_Database_Query();
     $q->addTable('user_access_log');
     $q->addUpdate('date_time_out', $q->dbfnNowWithTZ());
     $q2 = new w2p_Database_Query();
     $q2->addTable('sessions');
     $q2->addQuery('session_user');
     $q2->addWhere($where);
     $q->addWhere('user_access_log_id IN ( ' . $q2->prepare() . ' )');
     $q->exec();
     $q->clear();
     $q2->clear();
     // Now we simply delete the expired sessions.
     $q->setDelete('sessions');
     $q->addWhere($where);
     $q->exec();
     $q->clear();
     if (w2PgetConfig('session_gc_scan_queue')) {
         // We need to scan the event queue.  If $AppUI isn't created yet
         // And it isn't likely that it will be, we create it and run the
         // queue scanner.
         if (!isset($AppUI)) {
             $AppUI = new w2p_Core_CAppUI();
             $queue = new w2p_System_EventQueue();
             $queue->scan();
         }
     }
     return true;
 }
<?php

// Function to scan the event queue and execute any functions required.
require_once 'base.php';
require_once W2P_BASE_DIR . '/includes/config.php';
require_once W2P_BASE_DIR . '/includes/main_functions.php';
require_once W2P_BASE_DIR . '/includes/db_adodb.php';
$defaultTZ = w2PgetConfig('system_timezone', 'UTC');
date_default_timezone_set($defaultTZ);
$AppUI = new w2p_Core_CAppUI();
$AppUI->setUserLocale();
$queue = new w2p_System_EventQueue();
$queue->scan();
/*
 This is the first piece of a simple hook system to allow for regularly
 scheduled maintenance tasks to occur.  This could be data validation and
 cleanup, sending email notifications, or workflow related tasks.
*/
$hooks = new w2p_System_HookHandler($AppUI);
$hooks->process('cron');