Version 3.3.4

This commit is contained in:
Neo committed 2025-12-19 00:35:52 -08:00
1 parent 78706903a2
commit fb6b5baabc
2206 files changed
+409828 -382984

No files matched your search

@@ -0,0 +1,116 @@
<?php
/**
* @file archive.php Task to check and write incremental archives - Matt Mecham
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* @since -
* $LastChangedDate: 2011-05-13 03:28:10 +0100 (Fri, 13 May 2011) $
* @version v3.3.4
* $Revision: 8754 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 update the topic views from the temporary table
*
*/
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()
{
/* Language class */
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
/* Load up archive class */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/writer.php', 'classes_archive_writer' );
$archiveWriter = new $classToLoad();
$archiveWriter->setApp('forums');
/* Do it! DO IT */
$count = $archiveWriter->processBatch();
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task_archiveprocess'], intval($count) ) );
/* Load up restore class */
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/archive/restore.php', 'classes_archive_restore' );
$archiveRestore = new $classToLoad();
$archiveRestore->setApp('forums');
/* Do it! DO IT */
$count = $archiveRestore->processBatch();
if ( $count )
{
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task_unarchiveprocess'], $count ) );
}
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlockTask( $this->task );
}
}
+141 -169
View File
@@ -1,170 +1,142 @@
<?php
/**
* @file cleanout.php Task to clean out 'dead' sessions, validations, registration image entires, etc
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: ips_terabyte $
* @since -
* $LastChangedDate: 2011-09-26 16:02:02 -0400 (Mon, 26 Sep 2011) $
* @version v3.2.3
* $Revision: 9551 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 clean out 'dead' sessions, validations, registration image entires, etc
*
*/
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->caches =& ipsRegistry::cache()->fetchCaches();
$this->cache = ipsRegistry::cache();
$this->class = $class;
$this->task = $task;
}
/**
* Run this task
*
* @return @e void
*/
public function runTask()
{
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
//-----------------------------------------
// Delete reg_anti_spam
//-----------------------------------------
$this->DB->delete( 'captcha', 'captcha_date < ' . (time() - (60*60*6)) );
//-----------------------------------------
// Delete sessions
//-----------------------------------------
$this->DB->delete( 'sessions', 'running_time < ' . ( IPS_UNIX_TIME_NOW - $this->settings['session_expiration'] ) );
//-----------------------------------------
// Lost password requests
//-----------------------------------------
$_cutoff = time() - ( $this->settings['lost_pw_prune'] * 60 * 60 * 24 );
$this->DB->delete( 'validating', 'lost_pass=1 AND entry_date < ' . $_cutoff );
/* Delete old saved content */
$this->DB->delete( 'core_editor_autosave', 'eas_updated < ' . ( IPS_UNIX_TIME_NOW - 86400 ) );
/* Delete old cached content */
$this->DB->delete( 'cache_simple', 'cache_time < ' . ( IPS_UNIX_TIME_NOW - 86400 ) );
//-----------------------------------------
// Delete core_incoming_email_logs
//-----------------------------------------
if ( $this->DB->checkForTable('core_incoming_email_log') )
{
$this->DB->delete( 'core_incoming_email_log', 'log_time < ' . ( IPS_UNIX_TIME_NOW - 60 ) );
}
/* Delete old inline messages (5 mins) */
$this->DB->delete( 'core_inline_messages', 'inline_msg_date < ' . ( IPS_UNIX_TIME_NOW - 300 ) );
/* Update license key if needed */
$licenseData = $this->cache->getCache( 'licenseData' );
if( ! $licenseData || ( $licenseData['key']['_expires'] != 9999999999 AND $licenseData['key']['_expires'] < IPS_UNIX_TIME_NOW ) )
{
/* We need a classFileManagement object */
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
$classFileManagement = new $classToLoad();
/* Query the api */
$response = $classFileManagement->getFileContents("http://myipb.in/license.php?lk={$this->settings['ipb_reg_number']}&url={$this->settings['board_url']}&flush=1" );
/* Get License Data */
$licenseData = json_decode( $response, true );
/* Copyright Removal? */
if ( $licenseData['cr'] )
{
IPSLib::updateSettings( array( 'ipb_copy_number' => $licenseData['cr'], 'ips_cp_purchase' => 1 ) );
}
elseif ( $this->settings['ips_cp_purchase'] )
{
IPSLib::updateSettings( array( 'ips_cp_purchase' => 0 ) );
}
/* Save to cache */
$licenseData['_cached_date'] = time();
$licenseData['key']['_expires'] = $licenseData['key']['_expires'] ? $licenseData['key']['_expires'] : 9999999999;
$licenseData['key']['expires'] = $licenseData['key']['expires'] ? $licenseData['key']['expires'] : 9999999999;
$this->cache->setCache( 'licenseData', $licenseData, array( 'array' => 1 ) );
}
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->appendTaskLog( $this->task, $this->lang->words['task_cleanout'] );
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlockTask( $this->task );
}
<?php
/**
* @file cleanout.php Task to clean out 'dead' sessions, validations, registration image entires, etc
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: mark $
* @since -
* $LastChangedDate: 2012-02-22 12:07:55 -0500 (Wed, 22 Feb 2012) $
* @version v3.3.4
* $Revision: 10349 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 clean out 'dead' sessions, validations, registration image entires, etc
*
*/
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->caches =& ipsRegistry::cache()->fetchCaches();
$this->cache = ipsRegistry::cache();
$this->class = $class;
$this->task = $task;
}
/**
* Run this task
*
* @return @e void
*/
public function runTask()
{
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
//-----------------------------------------
// Delete reg_anti_spam
//-----------------------------------------
$this->DB->delete( 'captcha', 'captcha_date < ' . (time() - (60*60*6)) );
//-----------------------------------------
// Delete sessions
//-----------------------------------------
$this->DB->delete( 'sessions', 'running_time < ' . ( IPS_UNIX_TIME_NOW - $this->settings['session_expiration'] ) );
//-----------------------------------------
// Lost password requests
//-----------------------------------------
$_cutoff = time() - ( $this->settings['lost_pw_prune'] * 60 * 60 * 24 );
$this->DB->delete( 'validating', 'lost_pass=1 AND entry_date < ' . $_cutoff );
/* Delete old saved content */
$this->DB->delete( 'core_editor_autosave', 'eas_updated < ' . ( IPS_UNIX_TIME_NOW - 86400 ) );
/* Delete old cached content */
$this->DB->delete( 'cache_simple', 'cache_time < ' . ( IPS_UNIX_TIME_NOW - 86400 ) );
/* Remove rep caches (3 days old) */
$this->DB->delete( 'reputation_cache', 'cache_date < ' . ( IPS_UNIX_TIME_NOW - ( 86400 * 3 ) ) );
/* Remove recent topics (3 days worth ) */
$this->DB->delete( 'forums_recent_posts', 'post_date < ' . ( IPS_UNIX_TIME_NOW - ( 86400 * 3 ) ) );
//-----------------------------------------
// Delete core_incoming_email_logs
//-----------------------------------------
if ( $this->DB->checkForTable('core_incoming_email_log') )
{
$this->DB->delete( 'core_incoming_email_log', 'log_time < ' . ( IPS_UNIX_TIME_NOW - 60 ) );
}
/* Delete old inline messages (5 mins) */
$this->DB->delete( 'core_inline_messages', 'inline_msg_date < ' . ( IPS_UNIX_TIME_NOW - 300 ) );
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->appendTaskLog( $this->task, $this->lang->words['task_cleanout'] );
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlockTask( $this->task );
}
}
@@ -3,11 +3,11 @@
* @file contentcache.php Task to prune the content cache (posts & signatures)
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* @since 27th January 2004
* $LastChangedDate: 2011-03-18 21:17:06 -0400 (Fri, 18 Mar 2011) $
* @version v3.2.3
* @version v3.3.4
* $Revision: 8131 $
*/
@@ -1,10 +1,10 @@
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -1,106 +1,106 @@
<?php
/**
* @file itemmarkers.php Task to prune dead item markers
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: mmecham $
* @since 27th January 2004
* $LastChangedDate: 2011-06-03 09:45:07 -0400 (Fri, 03 Jun 2011) $
* @version v3.2.3
* $Revision: 8957 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 prune dead item markers
*
*/
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 $lang
*/
protected $registry;
protected $DB;
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->lang = $this->registry->getClass('class_localization');
$this->class = $class;
$this->task = $task;
}
/**
* Run this task
*
* @return @e void
*/
public function runTask()
{
/* INIT */
if ( ! $this->registry->isClassLoaded( 'classItemMarking' ) )
{
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/itemmarking/classItemMarking.php', 'classItemMarking' );
$this->registry->setClass( 'classItemMarking', new $classToLoad( $this->registry ) );
}
$time = time() - ( 86400 * 30 );
$itemsRemoved = $this->registry->getClass('classItemMarking')->manualCleanUp( 50, 6 );
/* Remove 'deleted' items */
$this->DB->delete( 'core_item_markers', 'item_is_deleted=1' );
$c = $this->DB->getAffectedRows();
/* Now delete old markers - we use a separate query because there are separate indexes */
$this->DB->delete( 'core_item_markers', 'item_last_saved < ' . $time );
$c += $this->DB->getAffectedRows();
IPSDebug::addLogMessage( "$c item markers removed", 'markers_cleanout' );
/* Log task */
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['itemmarkers_task_log'], $itemsRemoved, $c ) );
/* UNLOCK TASK */
$this->class->unlockTask( $this->task );
}
<?php
/**
* @file itemmarkers.php Task to prune dead item markers
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: mmecham $
* @since 27th January 2004
* $LastChangedDate: 2011-12-16 06:13:08 -0500 (Fri, 16 Dec 2011) $
* @version v3.3.4
* $Revision: 10009 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 prune dead item markers
*
*/
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 $lang
*/
protected $registry;
protected $DB;
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->lang = $this->registry->getClass('class_localization');
$this->class = $class;
$this->task = $task;
}
/**
* Run this task
*
* @return @e void
*/
public function runTask()
{
/* INIT */
if ( ! $this->registry->isClassLoaded( 'classItemMarking' ) )
{
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/classes/itemmarking/classItemMarking.php', 'classItemMarking' );
$this->registry->setClass( 'classItemMarking', new $classToLoad( $this->registry ) );
}
$time = time() - ( 86400 * ipsRegistry::$settings['topic_marking_keep_days'] );
$itemsRemoved = 0;
/* Remove 'deleted' items */
$this->DB->delete( 'core_item_markers', 'item_is_deleted=1' );
$c = $this->DB->getAffectedRows();
/* Now delete old markers - we use a separate query because there are separate indexes */
$this->DB->delete( 'core_item_markers', 'item_last_saved < ' . $time );
$c += $this->DB->getAffectedRows();
IPSDebug::addLogMessage( "$c item markers removed", 'markers_cleanout' );
/* Log task */
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['itemmarkers_task_log'], $itemsRemoved, $c ) );
/* UNLOCK TASK */
$this->class->unlockTask( $this->task );
}
}
+201 -201
View File
@@ -1,202 +1,202 @@
<?php
/**
* @file logprune.php Task to prune old logs from the cache folder
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: mmecham $
* @since -
* $LastChangedDate: 2011-04-19 11:20:55 -0400 (Tue, 19 Apr 2011) $
* @version v3.2.3
* $Revision: 8383 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 prune old logs from the cache folder
*
*/
class task_item
{
/**
* Integer value (seconds) used to delete old records
* By default 1 month: 2592000 (60*60*24*30)
*
* @var $deleteTime
*/
protected $deleteTime = 2592000;
/**
* 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()
{
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
//-----------------------------------------
// Spider Logs
//-----------------------------------------
if( $this->settings['ipb_prune_spider'] )
{
$this->DB->delete( "spider_logs", "entry_date < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Spam Logs
//-----------------------------------------
if( $this->settings['ipb_prune_spam'] )
{
$this->DB->delete( "spam_service_log", "log_date < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Admin Login Logs
//-----------------------------------------
if( $this->settings['prune_admin_login_logs'] )
{
$this->DB->delete( "admin_login_logs", "admin_time < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Task Logs
//-----------------------------------------
if( $this->settings['ipb_prune_task'] )
{
$this->DB->delete( "task_logs", "log_date < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Admin Logs
//-----------------------------------------
if( $this->settings['ipb_prune_admin'] )
{
$this->DB->delete( "admin_logs", "ctime < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Mod Logs
//-----------------------------------------
if ( $this->settings['ipb_prune_mod'] )
{
$this->DB->delete( "moderator_logs", "ctime < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Email Error Logs
//-----------------------------------------
if ( $this->settings['ipb_prune_emailerror'] )
{
$this->DB->delete( "mail_error_logs", "mlog_date < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Error Logs
//-----------------------------------------
if ( $this->settings['prune_error_logs'] )
{
$this->DB->delete( "error_logs", "log_date < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// SQL Logs
//-----------------------------------------
if ( $this->settings['ipb_prune_sql'] )
{
try
{
foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache' ) as $file )
{
if( $file->isDot() OR !$file->isFile() )
{
continue;
}
if( preg_match( "#^sql_(error|debug|upgrade)_log_(\d+)_(\d+)_(\d+).cgi$#", $file->getFilename(), $matches ) )
{
if( $file->getMTime() < (time() - $this->deleteTime) )
{
@unlink( $file->getPathname() );
}
}
}
} catch ( Exception $e ) {}
}
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->appendTaskLog( $this->task, $this->lang->words['task_logprune'] );
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlockTask( $this->task );
}
<?php
/**
* @file logprune.php Task to prune old logs from the cache folder
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: mmecham $
* @since -
* $LastChangedDate: 2011-04-19 11:20:55 -0400 (Tue, 19 Apr 2011) $
* @version v3.3.4
* $Revision: 8383 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 prune old logs from the cache folder
*
*/
class task_item
{
/**
* Integer value (seconds) used to delete old records
* By default 1 month: 2592000 (60*60*24*30)
*
* @var $deleteTime
*/
protected $deleteTime = 2592000;
/**
* 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()
{
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
//-----------------------------------------
// Spider Logs
//-----------------------------------------
if( $this->settings['ipb_prune_spider'] )
{
$this->DB->delete( "spider_logs", "entry_date < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Spam Logs
//-----------------------------------------
if( $this->settings['ipb_prune_spam'] )
{
$this->DB->delete( "spam_service_log", "log_date < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Admin Login Logs
//-----------------------------------------
if( $this->settings['prune_admin_login_logs'] )
{
$this->DB->delete( "admin_login_logs", "admin_time < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Task Logs
//-----------------------------------------
if( $this->settings['ipb_prune_task'] )
{
$this->DB->delete( "task_logs", "log_date < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Admin Logs
//-----------------------------------------
if( $this->settings['ipb_prune_admin'] )
{
$this->DB->delete( "admin_logs", "ctime < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Mod Logs
//-----------------------------------------
if ( $this->settings['ipb_prune_mod'] )
{
$this->DB->delete( "moderator_logs", "ctime < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Email Error Logs
//-----------------------------------------
if ( $this->settings['ipb_prune_emailerror'] )
{
$this->DB->delete( "mail_error_logs", "mlog_date < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// Error Logs
//-----------------------------------------
if ( $this->settings['prune_error_logs'] )
{
$this->DB->delete( "error_logs", "log_date < " . (time() - $this->deleteTime) );
}
//-----------------------------------------
// SQL Logs
//-----------------------------------------
if ( $this->settings['ipb_prune_sql'] )
{
try
{
foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache' ) as $file )
{
if( $file->isDot() OR !$file->isFile() )
{
continue;
}
if( preg_match( "#^sql_(error|debug|upgrade)_log_(\d+)_(\d+)_(\d+).cgi$#", $file->getFilename(), $matches ) )
{
if( $file->getMTime() < (time() - $this->deleteTime) )
{
@unlink( $file->getPathname() );
}
}
}
} catch ( Exception $e ) {}
}
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->appendTaskLog( $this->task, $this->lang->words['task_logprune'] );
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlockTask( $this->task );
}
}
@@ -1,142 +1,120 @@
<?php
/**
* @file openidcleanup.php Task to cleanup uncleared OpenID caches
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: ips_terabyte $
* @since -
* $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $
* @version v3.2.3
* $Revision: 7750 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 cleanup uncleared OpenID caches
*
*/
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 $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->lang = $this->registry->getClass('class_localization');
$this->class = $class;
$this->task = $task;
}
/**
* Run this task
*
* @return @e void
*/
public function runTask()
{
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
//-----------------------------------------
// Clean out openid caches older than 24 hours
// For whatever reason the OpenID libraries
// seem to have an issue where caches can start
// to accumulate. On boards heavily using
// OpenID, it's possible to eventually fill up
// the cache directories, which causes all subsequent
// logins to fail. This task just clears out those
// caches once every 24 hours to keep that from happening.
//-----------------------------------------
try
{
if( is_dir( DOC_IPS_ROOT_PATH . 'cache/openid' ) )
{
if( is_dir( DOC_IPS_ROOT_PATH . 'cache/openid/associations' ) )
{
foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache/openid/associations' ) as $cache )
{
if( $cache->getMTime() < ( time() - ( 60 * 60 * 24 ) ) )
{
@unlink( $cache->getPathname() );
}
}
}
if( is_dir( DOC_IPS_ROOT_PATH . 'cache/openid/nonces' ) )
{
foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache/openid/nonces' ) as $cache )
{
if( $cache->getMTime() < ( time() - ( 60 * 60 * 24 ) ) )
{
@unlink( $cache->getPathname() );
}
}
}
if( is_dir( DOC_IPS_ROOT_PATH . 'cache/openid/temp' ) )
{
foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache/openid/temp' ) as $cache )
{
if( $cache->getMTime() < ( time() - ( 60 * 60 * 24 ) ) )
{
@unlink( $cache->getPathname() );
}
}
}
}
} catch ( Exception $e ) {}
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->appendTaskLog( $this->task, $this->lang->words['task_openidcleanup'] );
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlockTask( $this->task );
}
<?php
/**
* @file minifycleanup.php Task to cleanup old minify files
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* @since -
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $Revision: 10914 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 cleanup old minify files
*/
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 $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->settings = $registry->fetchSettings();
$this->lang = $this->registry->getClass('class_localization');
$this->class = $class;
$this->task = $task;
}
/**
* Run this task
*
* @return @e void
*/
public function runTask()
{
//-----------------------------------------
// This is only relevant if we use minify
//-----------------------------------------
if( !$this->settings['use_minify'] )
{
$this->class->unlockTask( $this->task );
return;
}
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
//-----------------------------------------
// Clean out the files minify creates once a week,
// just to ensure old unused files don't eat up disk space
//-----------------------------------------
try
{
if( is_dir( DOC_IPS_ROOT_PATH . 'cache/tmp' ) )
{
foreach( new DirectoryIterator( DOC_IPS_ROOT_PATH . 'cache/tmp' ) as $cache )
{
if( $cache->getMTime() < ( time() - ( 60 * 60 * 24 * 7 ) ) AND $cache->getFilename() != 'index.html' )
{
@unlink( $cache->getPathname() );
}
}
}
} catch ( Exception $e ) {}
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->appendTaskLog( $this->task, $this->lang->words['task_minifycleanup'] );
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlockTask( $this->task );
}
}
@@ -1,131 +1,131 @@
<?php
/**
* @file mysqlcleanup.php Task to prune dead item markers
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: ips_terabyte $
* @since -
* $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $
* @version v3.2.3
* $Revision: 7750 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 prune dead item markers
*
*/
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()
{
//-----------------------------------------
// This is mysql only
//-----------------------------------------
if ( strtolower( $this->settings['sql_driver'] ) != 'mysql' )
{
$this->class->unlockTask( $this->task );
return;
}
//-----------------------------------------
// Clean out sleeping mysql processes
//-----------------------------------------
$this->DB->return_die = true;
$resource = $this->DB->query( "SHOW PROCESSLIST", true );
while( $r = $this->DB->fetch($resource) )
{
//-----------------------------------------
// Make sure we're only killing stuff on our db
//-----------------------------------------
if( $r['db'] == $this->settings['sql_database'] AND $r['Command'] == 'Sleep' AND $r['Time'] > 60 )
{
$this->DB->return_die = true;
$this->DB->query( "KILL {$r['Id']}" );
/* Log */
IPSDebug::addLogMessage( 'Task - MySQL Clean Up Performed. Killed id ' . $r['Id'], 'mysqlCleanUp', $r );
}
}
$this->DB->return_die = false;
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
$this->class->appendTaskLog( $this->task, $this->lang->words['task_mysqlcleanup'] );
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlockTask( $this->task );
}
<?php
/**
* @file mysqlcleanup.php Task to prune dead item markers
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: ips_terabyte $
* @since -
* $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $
* @version v3.3.4
* $Revision: 7750 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 prune dead item markers
*
*/
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()
{
//-----------------------------------------
// This is mysql only
//-----------------------------------------
if ( strtolower( $this->settings['sql_driver'] ) != 'mysql' )
{
$this->class->unlockTask( $this->task );
return;
}
//-----------------------------------------
// Clean out sleeping mysql processes
//-----------------------------------------
$this->DB->return_die = true;
$resource = $this->DB->query( "SHOW PROCESSLIST", true );
while( $r = $this->DB->fetch($resource) )
{
//-----------------------------------------
// Make sure we're only killing stuff on our db
//-----------------------------------------
if( $r['db'] == $this->settings['sql_database'] AND $r['Command'] == 'Sleep' AND $r['Time'] > 60 )
{
$this->DB->return_die = true;
$this->DB->query( "KILL {$r['Id']}" );
/* Log */
IPSDebug::addLogMessage( 'Task - MySQL Clean Up Performed. Killed id ' . $r['Id'], 'mysqlCleanUp', $r );
}
}
$this->DB->return_die = false;
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
$this->class->appendTaskLog( $this->task, $this->lang->words['task_mysqlcleanup'] );
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlockTask( $this->task );
}
}
+136 -123
View File
@@ -1,124 +1,137 @@
<?php
/**
* @file optimize.php Task to optimize database tables daily
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: ips_terabyte $
* @since -
* $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $
* @version v3.2.3
* $Revision: 7750 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 optimize database tables daily
*
*/
class task_item
{
/**
* Tables to optimize. Initially I was just going to run
* optimize tables query against all tables, but Charles
* prefers this static list of tables, and so it shall be.
*
* @var $charlesTables
*/
protected $charlesTables = array( 'core_item_markers',
'core_item_markers_storage',
'inline_notifications',
'cache_store',
'content_cache_posts',
);
/**
* 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 $lang
*/
protected $registry;
protected $DB;
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->lang = $this->registry->getClass('class_localization');
$this->class = $class;
$this->task = $task;
}
/**
* Run this task
*
* @return @e void
*/
public function runTask()
{
/* Not needed for mssql as per #23105 bug */
if ( ipsRegistry::dbFunctions()->getDriverType() != 'mysql' )
{
$this->class->unlockTask( $this->task );
return;
}
/* Get tables and optimize */
$_tables = $this->charlesTables;
if( is_array($_tables) AND count($_tables) )
{
$PRE = ipsRegistry::dbFunctions()->getPrefix();
ipsRegistry::dbFunctions()->prefix_changed = true;
foreach( $_tables as $_table )
{
$this->DB->query( "OPTIMIZE TABLE {$PRE}{$_table}" );
$this->DB->query( "ANALYZE TABLE {$PRE}{$_table}" );
}
ipsRegistry::dbFunctions()->prefix_changed = false;
}
/* Log to log table - modify but dont delete */
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task__optimizedtables'], count($_tables) ) );
/* Unlock Task: DO NOT MODIFY! */
$this->class->unlockTask( $this->task );
}
<?php
/**
* @file optimize.php Task to optimize database tables daily
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* @since -
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $Revision: 10914 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 optimize database tables daily
*
*/
class task_item
{
/**
* Tables to optimize. Initially I was just going to run
* optimize tables query against all tables, but Charles
* prefers this static list of tables, and so it shall be.
*
* @var $charlesTables
*/
protected $charlesTables = array( 'core_item_markers',
'core_item_markers_storage',
'inline_notifications',
'cache_store',
'content_cache_posts',
);
/**
* 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 $lang
*/
protected $registry;
protected $DB;
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->lang = $this->registry->getClass('class_localization');
$this->class = $class;
$this->task = $task;
}
/**
* Run this task
*
* @return @e void
*/
public function runTask()
{
/* Not needed for mssql as per #23105 bug */
if ( ipsRegistry::dbFunctions()->getDriverType() != 'mysql' )
{
$this->class->unlockTask( $this->task );
return;
}
/* Get tables and optimize */
$tables = $this->charlesTables;
$_tables = array();
if( is_array($tables) AND count($tables) )
{
/* InnoDB is a no-no! :o */
$this->DB->query( "SHOW TABLE STATUS" );
while( $tbl = $this->DB->fetch() )
{
if ( ! empty($tbl['Name']) && in_array( $tbl['Name'], $tables ) && strtolower($tbl['Engine']) != 'innodb' )
{
$_tables[] = $tbl['Name'];
}
}
/* Was everything a no-no? :( */
if( count($_tables) )
{
$PRE = ipsRegistry::dbFunctions()->getPrefix();
foreach( $_tables as $_table )
{
$this->DB->query( "OPTIMIZE TABLE {$PRE}{$_table}" );
$this->DB->query( "ANALYZE TABLE {$PRE}{$_table}" );
}
}
}
/* Log to log table - modify but dont delete */
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task__optimizedtables'], count($_tables) ) );
/* Unlock Task: DO NOT MODIFY! */
$this->class->unlockTask( $this->task );
}
}
+202 -206
View File
@@ -1,207 +1,203 @@
<?php
/**
* @file pop3mail.php Task to handle incoming emails through POP3
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: mark $
* @since 25th June 2010
* $LastChangedDate: 2011-08-23 10:24:47 -0400 (Tue, 23 Aug 2011) $
* @version v3.2.3
* $Revision: 9404 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 handle incoming emails through POP3
*
*/
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 $settings
* @var $lang
*/
protected $registry;
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->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()
{
//--------------------------------------
// Init
//--------------------------------------
require_once( IPS_KERNEL_PATH . '/pop3class/pop3.php' );/*noLibHook*/
$this->pop3 = new pop3_class;
$this->pop3->hostname = $this->settings['pop3_server'];
$this->pop3->port = $this->settings['pop3_port'];
$this->pop3->tls = $this->settings['pop3_tls'];
$this->pop3->realm = '';
$this->pop3->workstation = '';
$this->pop3->authentication_mechanism = 'USER';
$this->pop3->debug = FALSE;
$this->pop3->html_debug = FALSE;
$this->pop3->join_continuation_header_lines = FALSE;
$user = $this->settings['pop3_user'];
$password = $this->settings['pop3_password'];
$apop = FALSE;
//--------------------------------------
// Connect and login
//--------------------------------------
$open = $this->pop3->Open();
if ( $open != '' )
{
return;
}
$login = $this->pop3->Login( $user, $password, $apop );
if ( $login != '' )
{
return;
}
//--------------------------------------
// Any messages?
//--------------------------------------
$messages = NULL;
$size = NULL;
$this->pop3->Statistics( $messages, $size );
if ( !$messages )
{
$this->pop3->Close();
/* Log to log table - modify but dont delete */
$this->class->appendTaskLog( $this->task, $this->lang->words['task_pop3email'] );
/* Unlock Task: DO NOT MODIFY! */
$this->class->unlockTask( $this->task );
return;
}
//--------------------------------------
// Well get them then!
//--------------------------------------
require_once ( IPS_KERNEL_PATH . 'classIncomingEmail.php' );/*noLibHook*/
$result = $this->pop3->ListMessages( '', TRUE );
if ( is_array( $result ) and !empty( $result ) )
{
foreach ( $result as $id => $messageID )
{
$headers = NULL;
$body = NULL;
$getMessage = $this->RetrieveMessage( $id );
if ( $getMessage === NULL )
{
continue;
}
$incomingEmail = new classIncomingEmail( $getMessage );
if ( !$incomingEmail->ignore )
{
$incomingEmail->route();
}
// And delete
$this->pop3->DeleteMessage( $id );
}
}
//--------------------------------------
// Log off
//--------------------------------------
$this->pop3->Close();
/* Log to log table - modify but dont delete */
$this->class->appendTaskLog( $this->task, $this->lang->words['task_pop3email'] );
/* Unlock Task: DO NOT MODIFY! */
$this->class->unlockTask( $this->task );
}
protected function RetrieveMessage( $id )
{
if( $this->pop3->PutLine( "RETR {$id}" ) == 0 )
{
return NULL;
}
$response = $this->pop3->GetLine();
if ( substr( $response, 0, 3 ) != '+OK' )
{
return NULL;
}
$message = '';
while ( TRUE == TRUE )
{
$line = $this->pop3->GetLine();
if ( $line == '.' )
{
break;
}
$message .= $line . "\n";
}
return $message;
}
<?php
/**
* @file pop3mail.php Task to handle incoming emails through POP3
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: bfarber $
* @since 25th June 2010
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
* @version v3.3.4
* $Revision: 10914 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 handle incoming emails through POP3
*
*/
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 $settings
* @var $lang
*/
protected $registry;
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->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()
{
//--------------------------------------
// Init
//--------------------------------------
require_once( IPS_KERNEL_PATH . '/pop3class/pop3.php' );/*noLibHook*/
$this->pop3 = new pop3_class;
$this->pop3->hostname = $this->settings['pop3_server'];
$this->pop3->port = $this->settings['pop3_port'];
$this->pop3->tls = $this->settings['pop3_tls'];
$this->pop3->realm = '';
$this->pop3->workstation = '';
$this->pop3->authentication_mechanism = 'USER';
$this->pop3->debug = FALSE;
$this->pop3->html_debug = FALSE;
$this->pop3->join_continuation_header_lines = FALSE;
$user = $this->settings['pop3_user'];
$password = $this->settings['pop3_password'];
$apop = FALSE;
//--------------------------------------
// Connect and login
//--------------------------------------
$open = $this->pop3->Open();
if ( $open != '' )
{
return;
}
$login = $this->pop3->Login( $user, $password, $apop );
if ( $login != '' )
{
return;
}
//--------------------------------------
// Any messages?
//--------------------------------------
$messages = NULL;
$size = NULL;
$this->pop3->Statistics( $messages, $size );
if ( !$messages )
{
$this->pop3->Close();
/* Log to log table - modify but dont delete */
$this->class->appendTaskLog( $this->task, $this->lang->words['task_pop3email'] );
/* Unlock Task: DO NOT MODIFY! */
$this->class->unlockTask( $this->task );
return;
}
//--------------------------------------
// Well get them then!
//--------------------------------------
require_once ( IPS_ROOT_PATH . 'sources/classes/incomingEmail/incomingEmail.php' );
$result = $this->pop3->ListMessages( '', TRUE );
if ( is_array( $result ) and !empty( $result ) )
{
foreach ( $result as $id => $messageID )
{
$headers = NULL;
$body = NULL;
$getMessage = $this->RetrieveMessage( $id );
if ( $getMessage === NULL )
{
continue;
}
incomingEmail::parse( $getMessage );
// And delete
$this->pop3->DeleteMessage( $id );
}
}
//--------------------------------------
// Log off
//--------------------------------------
$this->pop3->Close();
/* Log to log table - modify but dont delete */
$this->class->appendTaskLog( $this->task, $this->lang->words['task_pop3email'] );
/* Unlock Task: DO NOT MODIFY! */
$this->class->unlockTask( $this->task );
}
protected function RetrieveMessage( $id )
{
if( $this->pop3->PutLine( "RETR {$id}" ) == 0 )
{
return NULL;
}
$response = $this->pop3->GetLine();
if ( substr( $response, 0, 3 ) != '+OK' )
{
return NULL;
}
$message = '';
while ( TRUE == TRUE )
{
$line = $this->pop3->GetLine();
if ( $line == '.' )
{
break;
}
$message .= $line . "\n";
}
return $message;
}
}
@@ -1,99 +1,105 @@
<?php
/**
* @file rebuildstats.php Task to rebuild the board statistics
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: This is NULLED!
* $Author: ips_terabyte $
* @since -
* $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $
* @version v3.2.3
* $Revision: 7750 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 rebuild the board statistics
*
*/
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 $lang
* @var $cache
*/
protected $registry;
protected $lang;
protected $cache;
/**
* 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->lang = $this->registry->getClass('class_localization');
$this->cache = $this->registry->cache();
$this->class = $class;
$this->task = $task;
}
/**
* Run this task
*
* @return @e void
*/
public function runTask()
{
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
//-----------------------------------------
// Rebuild stats cache
//-----------------------------------------
$this->cache->rebuildCache( 'stats', 'global' );
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->appendTaskLog( $this->task, $this->lang->words['task_statsrebuilt'] );
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlockTask( $this->task );
}
<?php
/**
* @file rebuildstats.php Task to rebuild the board statistics
*~TERABYTE_DOC_READY~
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
* $License: http://www.invisionpower.com/company/standards.php#license$
* $Author: mark $
* @since -
* $LastChangedDate: 2012-02-22 12:07:55 -0500 (Wed, 22 Feb 2012) $
* @version v3.3.4
* $Revision: 10349 $
*/
if ( ! defined( 'IN_IPB' ) )
{
print "<h1>Incorrect access</h1>You 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 rebuild the board statistics
*
*/
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 $lang
* @var $cache
*/
protected $registry;
protected $lang;
protected $cache;
/**
* 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->lang = $this->registry->getClass('class_localization');
$this->cache = $this->registry->cache();
$this->class = $class;
$this->task = $task;
}
/**
* Run this task
*
* @return @e void
*/
public function runTask()
{
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
//-----------------------------------------
// Rebuild stats cache
//-----------------------------------------
$this->cache->rebuildCache( 'stats', 'global' );
//-----------------------------------------
// And license key
//-----------------------------------------
$this->cache->rebuildCache( 'licenseData', 'global' );
//-----------------------------------------
// Log to log table - modify but dont delete
//-----------------------------------------
$this->class->appendTaskLog( $this->task, $this->lang->words['task_statsrebuilt'] );
//-----------------------------------------
// Unlock Task: DO NOT MODIFY!
//-----------------------------------------
$this->class->unlockTask( $this->task );
}
}