Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

@@ -1,21 +1,14 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Task: Clean out 'dead' sessions, validations, registration image entires, etc
* 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.invisionpower.com/community/board/license.html
* @package IP.Board
* @subpackage Core
* @link http://www.invisionpower.com
* @since 27th January 2004
* @version $Rev: 6708 $
* @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' ) )
@@ -24,78 +17,67 @@ if ( ! defined( 'IN_IPB' ) )
exit();
}
/**
*
* @class task_item
* @brief Task to clean out 'dead' sessions, validations, registration image entires, etc
*
*/
class task_item
{
/**
* Parent task manager class
* Object that stores the parent task manager class
*
* @access protected
* @var object
* @var $class
*/
protected $class;
/**
* This task data
*
* @access protected
* @var array
*/
protected $task = array();
/**
* Prevent logging
*
* @access protected
* @var boolean
*/
protected $restrict_log = false;
/**#@+
/**
* Array that stores the task data
*
* @var $task
*/
protected $task = array();
/**
* Registry Object Shortcuts
*
* @access protected
* @var object
* @var $registry
* @var $DB
* @var $settings
* @var $lang
*/
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
* @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->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->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
* 1235503784
* @access public
* @return void
*
* @return @e void
*/
public function runTask()
{
@@ -121,6 +103,58 @@ class task_item
$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
//-----------------------------------------
@@ -133,5 +167,4 @@ class task_item
$this->class->unlockTask( $this->task );
}
}