Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Task: Clean out 'dead' sessions, validations, registration image entires, etc
|
||||
* Last Updated: $LastChangedDate: 2009-07-01 07:35:02 -0400 (Wed, 01 Jul 2009) $
|
||||
* Last Updated: $LastChangedDate: 2010-07-28 05:00:44 -0400 (Wed, 28 Jul 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 4832 $
|
||||
* @version $Rev: 6708 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -111,6 +113,14 @@ class task_item
|
||||
|
||||
$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 );
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Task: Prune back content cache
|
||||
* Last Updated: $LastChangedDate: 2009-02-04 20:03:59 +0000 (Wed, 04 Feb 2009) $
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 3887 $
|
||||
* @version $Rev: 5713 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> 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.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
|
||||
<html>
|
||||
<head><title>IP.Board - Bulletin Board System</title></head>
|
||||
<body>
|
||||
<h1>403: IP.Board -> 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.invisionboard.com/">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Task: Update 'dead' markers
|
||||
* Last Updated: $LastChangedDate: 2009-02-04 20:03:59 +0000 (Wed, 04 Feb 2009) $
|
||||
* Last Updated: $LastChangedDate: 2010-07-29 08:08:48 -0400 (Thu, 29 Jul 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 3887 $
|
||||
* @version $Rev: 6711 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -106,9 +108,15 @@ class task_item
|
||||
$this->registry->setClass( 'classItemMarking', new classItemMarking( $this->registry ) );
|
||||
}
|
||||
|
||||
$itemsRemoved = $this->registry->getClass('classItemMarking')->manualCleanUp( 100 );
|
||||
$itemsRemoved = $this->registry->getClass('classItemMarking')->manualCleanUp( 50, 6 );
|
||||
|
||||
$this->class->appendTaskLog( $this->task, "Cleaned up " . $itemsRemoved . " markers" );
|
||||
/* Remove 'deleted' items */
|
||||
$this->DB->delete( 'core_item_markers', 'item_is_deleted=1' );
|
||||
$c = $this->DB->getAffectedRows();
|
||||
|
||||
IPSDebug::addLogMessage( "$c item markers removed", 'markers_cleanout' );
|
||||
|
||||
$this->class->appendTaskLog( $this->task, "Cleaned up " . $itemsRemoved . " markers, removed " . $c . " unused rows" );
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Task: Prune old logs
|
||||
* Last Updated: $LastChangedDate: 2009-05-20 16:34:08 -0400 (Wed, 20 May 2009) $
|
||||
* Last Updated: $LastChangedDate: 2010-06-08 20:53:45 -0400 (Tue, 08 Jun 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 4679 $
|
||||
* @version $Rev: 6485 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -108,6 +110,10 @@ class task_item
|
||||
$this->DB->delete( "spider_logs", "entry_date < " . (time() - (60*60*24*30)) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Spam Logs
|
||||
//-----------------------------------------
|
||||
|
||||
//-----------------------------------------
|
||||
// Admin Login Logs
|
||||
//-----------------------------------------
|
||||
|
||||
@@ -1,152 +1,154 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Task: Simple task to clean out sleeping mysql queries
|
||||
* Last Updated: $LastChangedDate: 2009-04-02 04:31:59 -0400 (Thu, 02 Apr 2009) $
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 4390 $
|
||||
*/
|
||||
|
||||
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
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return 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->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// 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->class->appendTaskLog( $this->task, $this->lang->words['task_mysqlcleanup'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Simple task to clean out sleeping mysql queries
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5713 $
|
||||
*/
|
||||
|
||||
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
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return 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->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// 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->class->appendTaskLog( $this->task, $this->lang->words['task_mysqlcleanup'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,175 +1,177 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* Task: Cleanup for uncleared OpenID caches
|
||||
* Last Updated: $LastChangedDate: 2009-05-20 16:34:08 -0400 (Wed, 20 May 2009) $
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 4679 $
|
||||
*/
|
||||
|
||||
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
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return 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->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// This is mysql only
|
||||
//-----------------------------------------
|
||||
|
||||
if ( strtolower( $this->settings['sql_driver'] ) != 'mysql' )
|
||||
{
|
||||
$this->class->unlockTask( $this->task );
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// 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
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Cleanup for uncleared OpenID caches
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5713 $
|
||||
*/
|
||||
|
||||
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
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return 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->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
|
||||
//-----------------------------------------
|
||||
// This is mysql only
|
||||
//-----------------------------------------
|
||||
|
||||
if ( strtolower( $this->settings['sql_driver'] ) != 'mysql' )
|
||||
{
|
||||
$this->class->unlockTask( $this->task );
|
||||
return;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// 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 );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Optimizes database tables daily
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 5713 $
|
||||
*/
|
||||
|
||||
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
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $charlesTables = array(
|
||||
'core_item_markers',
|
||||
'core_item_markers_storage',
|
||||
'inline_notifications',
|
||||
'cache_store',
|
||||
'content_cache_posts',
|
||||
);
|
||||
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return 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->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'public_global' ), 'core' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
/* Not needed for mssql as per #23105 bug */
|
||||
if ( ipsRegistry::dbFunctions()->getDriverType() != 'mysql' )
|
||||
{
|
||||
$this->class->unlockTask( $this->task );
|
||||
return;
|
||||
}
|
||||
|
||||
//$_tables = $this->DB->getTableNames();
|
||||
|
||||
//if( is_array($_tables) AND count($_tables) )
|
||||
//{
|
||||
// foreach( $_tables as $_table )
|
||||
// {
|
||||
// $this->DB->query( "OPTIMIZE TABLE {$_table}" );
|
||||
// $this->DB->query( "ANALYZE TABLE {$_table}" );
|
||||
// }
|
||||
//}
|
||||
|
||||
$_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;
|
||||
}
|
||||
|
||||
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task__optimizedtables'], count($_tables) ) );
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Task: Incoming Email Handler - POP3
|
||||
* Last Updated: $LastChangedDate: 2010-06-25 07:37:32 -0400 (Fri, 25 Jun 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: mark $
|
||||
* @copyright (c) 2010 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 25th June 2010
|
||||
* @version $Rev: 6575 $
|
||||
*/
|
||||
|
||||
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
|
||||
{
|
||||
/**
|
||||
* Parent task manager class
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* This task data
|
||||
*
|
||||
* @access protected
|
||||
* @var array
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Prevent logging
|
||||
*
|
||||
* @access protected
|
||||
* @var boolean
|
||||
*/
|
||||
protected $restrict_log = false;
|
||||
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $cache;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @param object Parent task class
|
||||
* @param array This task data
|
||||
* @return 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->request =& $this->registry->fetchRequest();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
|
||||
//--------------------------------------
|
||||
// Init
|
||||
//--------------------------------------
|
||||
|
||||
require_once( IPS_KERNEL_PATH . '/pop3class/pop3.php' );
|
||||
$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 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//--------------------------------------
|
||||
// Well get them then!
|
||||
//--------------------------------------
|
||||
|
||||
require_once ( IPS_KERNEL_PATH . 'classIncomingEmail.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 = new classIncomingEmail( $getMessage );
|
||||
$incomingEmail->route();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------
|
||||
// Log off
|
||||
//--------------------------------------
|
||||
|
||||
$this->pop3->Close();
|
||||
|
||||
//-----------------------------------------
|
||||
// Cleanup
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_pop3email'] );
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
|
||||
protected function RetrieveMessage( $id )
|
||||
{
|
||||
if( $this->pop3->PutLine( "RETR {$id}" ) == 0 )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
$response = $this->pop3->GetLine();
|
||||
if ( $response != "+OK message follows" )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
$message = '';
|
||||
while ( TRUE == TRUE )
|
||||
{
|
||||
$line = $this->pop3->GetLine();
|
||||
if ( $line == '.' )
|
||||
{
|
||||
break;
|
||||
}
|
||||
$message .= $line . "\n";
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.0.5
|
||||
* IP.Board v3.1.4
|
||||
* Task: Rebuild stats
|
||||
* Last Updated: $LastChangedDate: 2009-04-06 22:42:50 -0400 (Mon, 06 Apr 2009) $
|
||||
* Last Updated: $LastChangedDate: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: bfarber $
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.iinvisionpower.com/community/board/license.html
|
||||
* @package Invision Power Board
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @subpackage Core
|
||||
* @link http://www.iinvisionpower.com
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 27th January 2004
|
||||
* @version $Rev: 4411 $
|
||||
* @version $Rev: 5713 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
|
||||
Reference in new issue
Block a user