Incorrect accessYou cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; exit(); } /** * * @class task_item * @brief Task to remove validating members over configured time * */ class task_item { /** * Object that stores the parent task manager class * * @var $class */ protected $class; /** * Array that stores the task data * * @var $task */ protected $task = array(); /** * Registry Object Shortcuts * * @var $registry * @var $DB * @var $settings * @var $lang */ protected $registry; protected $DB; protected $settings; protected $lang; /** * Constructor * * @param object $registry Registry object * @param object $class Task manager class object * @param array $task Array with the task data * @return @e void */ public function __construct( ipsRegistry $registry, $class, $task ) { /* Make registry objects */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->lang = $this->registry->getClass('class_localization'); $this->class = $class; $this->task = $task; } /** * Run this task * * @return @e void */ public function runTask() { // If enabled, remove validating new_reg members & entries from members table if ( intval($this->settings['prune_notifications']) > 0 ) { $classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' ); $notifyLibrary = new $classToLoad( $this->registry ); $olderThan = time() - ( $this->settings['prune_notifications'] * ( 86400 * 30 ) ); $removed = $notifyLibrary->deleteNotificationsOlderThan( $olderThan ); $this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_member' ), 'members' ); $this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task_removeoldnotifications'], $removed ) ); } //----------------------------------------- // Unlock Task: DO NOT MODIFY! //----------------------------------------- $this->class->unlockTask( $this->task ); } }