Version 3.3.4
This commit is contained in:
1 parent
78706903a2
commit
fb6b5baabc
2206 files changed
+409828
-382984
No files matched your search
@@ -1,90 +1,90 @@
|
||||
<?php
|
||||
/**
|
||||
* @file bulkmail.php Task to send out bulk emails (dynamically enabled)
|
||||
*~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 send out bulk emails (dynamically enabled)
|
||||
*
|
||||
*/
|
||||
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
|
||||
*/
|
||||
protected $registry;
|
||||
|
||||
/**
|
||||
* 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->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load Bulk Mailer thing
|
||||
//-----------------------------------------
|
||||
|
||||
define( 'IN_ACP', 1 );
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'members' ) . '/modules_admin/bulkmail/bulkmail.php', 'admin_members_bulkmail_bulkmail' );
|
||||
$bulkmail = new $classToLoad();
|
||||
$bulkmail->makeRegistryShortcuts( $this->registry );
|
||||
$bulkmail->mailSendProcess();
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file bulkmail.php Task to send out bulk emails (dynamically enabled)
|
||||
*~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 send out bulk emails (dynamically enabled)
|
||||
*
|
||||
*/
|
||||
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
|
||||
*/
|
||||
protected $registry;
|
||||
|
||||
/**
|
||||
* 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->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Load Bulk Mailer thing
|
||||
//-----------------------------------------
|
||||
|
||||
define( 'IN_ACP', 1 );
|
||||
|
||||
$classToLoad = IPSLib::loadActionOverloader( IPSLib::getAppDir( 'members' ) . '/modules_admin/bulkmail/bulkmail.php', 'admin_members_bulkmail_bulkmail' );
|
||||
$bulkmail = new $classToLoad();
|
||||
$bulkmail->makeRegistryShortcuts( $this->registry );
|
||||
$bulkmail->mailSendProcess();
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
}
|
||||
@@ -1,10 +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.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
<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.invisionpower.com">IP.Board</a>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,148 +1,168 @@
|
||||
<?php
|
||||
/**
|
||||
* @file mobile_notifications.php Task to send out mobile notifications
|
||||
*~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 send out mobile notifications
|
||||
*
|
||||
*/
|
||||
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()
|
||||
{
|
||||
/* INIT */
|
||||
$maxNotificationsToProcess = 250;
|
||||
$licenseKey = ipsRegistry::$settings['ipb_reg_number'];
|
||||
$forum = urlencode( $this->settings['board_name'] );
|
||||
$domain = urlencode( ipsRegistry::$settings['board_url'] );
|
||||
$apiBaseURL = "http://myipb.in/apn-server/index.php?api=addMessageToQueue&key={$licenseKey}&forum={$forum}&domain={$domain}";
|
||||
|
||||
/* Get the file managemnet class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
|
||||
$query = new $classToLoad();
|
||||
|
||||
/* Get waiting notifications */
|
||||
$this->DB->build( array(
|
||||
'select' => 'n.*',
|
||||
'from' => array( 'mobile_notifications' => 'n' ),
|
||||
'where' => 'n.notify_sent=0',
|
||||
'order' => 'n.notify_date ASC',
|
||||
'limit' => array( 0, $maxNotificationsToProcess ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'select' => 'm.ips_mobile_token',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'n.member_id=m.member_id',
|
||||
'type' => 'left',
|
||||
)
|
||||
)
|
||||
) );
|
||||
$this->DB->execute();
|
||||
|
||||
$_sentIds = array();
|
||||
while( $r = $this->DB->fetch() )
|
||||
{
|
||||
/* VARS */
|
||||
$ipsToken = $r['ips_mobile_token'];
|
||||
$message = urlencode( strip_tags( $r['notify_title'] ) );
|
||||
|
||||
if( ! $ipsToken || ! $message )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Query the api */
|
||||
$response = $query->getFileContents( "{$apiBaseURL}&ipsToken={$ipsToken}&message={$message}" );
|
||||
|
||||
/* Save the ID */
|
||||
$_sentIds[] = $r['id'];
|
||||
}
|
||||
|
||||
/* Update the table */
|
||||
if( count( $_sentIds ) )
|
||||
{
|
||||
$this->DB->update( 'mobile_notifications', array( 'notify_sent' => 1 ), 'id IN ('.implode( ',', $_sentIds ).')' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_mobileNotifications'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file mobile_notifications.php Task to send out mobile notifications
|
||||
*~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 send out mobile notifications
|
||||
*
|
||||
*/
|
||||
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()
|
||||
{
|
||||
$licenseData = $this->registry->cache()->getCache('licenseData');
|
||||
if ( isset( $licenseData['iphoneNotifications'] ) and $licenseData['iphoneNotifications'] )
|
||||
{
|
||||
|
||||
/* INIT */
|
||||
$maxNotificationsToProcess = 250;
|
||||
$licenseKey = ipsRegistry::$settings['ipb_reg_number'];
|
||||
$forum = urlencode( $this->settings['board_name'] );
|
||||
$domain = urlencode( ipsRegistry::$settings['board_url'] );
|
||||
$apiBaseURL = "http://apn-server.invisionpower.com/index.php?api=addMessageToQueue&key=12345&forum=Forum&domain=;)";
|
||||
|
||||
/* Get the file managemnet class */
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement' );
|
||||
$query = new $classToLoad();
|
||||
|
||||
/* Get waiting notifications */
|
||||
$this->DB->build( array(
|
||||
'select' => 'n.*',
|
||||
'from' => array( 'mobile_notifications' => 'n' ),
|
||||
'where' => 'n.notify_sent=0',
|
||||
'order' => 'n.notify_date ASC',
|
||||
'limit' => array( 0, $maxNotificationsToProcess ),
|
||||
) );
|
||||
$e = $this->DB->execute();
|
||||
|
||||
$_sentIds = array();
|
||||
while( $r = $this->DB->fetch( $e ) )
|
||||
{
|
||||
$this->DB->build( array( 'select' => '*', 'from' => 'mobile_device_map', 'where' => "member_id={$r['member_id']}" ) );
|
||||
$f = $this->DB->execute();
|
||||
|
||||
while ( $device = $this->DB->fetch( $f ) )
|
||||
{
|
||||
$message = urlencode( strip_tags( $r['notify_title'] ) );
|
||||
|
||||
if( ! $device['token'] || ! $message )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Query the api */
|
||||
$response = $query->getFileContents( "{$apiBaseURL}&ipsToken={$device['token']}&message={$message}¬ify_url={$r['notify_url']}" );
|
||||
|
||||
/* If the response tells us to delete this device ID, do so */
|
||||
if ( $response == 'REMOVE_DEVICE' )
|
||||
{
|
||||
$this->DB->delete( 'mobile_device_map', "token='{$device['token']}'" );
|
||||
}
|
||||
|
||||
#IPSDebug::addLogMessage( $response, 'mobileNotifications', array( 'notifications' => $r, 'device' => $device ), true );
|
||||
}
|
||||
|
||||
/* Save the ID */
|
||||
$_sentIds[] = $r['id'];
|
||||
}
|
||||
|
||||
#IPSDebug::addLogMessage( implode( ',', $_sentIds ), 'mobileNotifications', false, true );
|
||||
|
||||
/* Update the table */
|
||||
if( count( $_sentIds ) )
|
||||
{
|
||||
$this->DB->update( 'mobile_notifications', array( 'notify_sent' => 1 ), 'id IN ('.implode( ',', $_sentIds ).')' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_mobileNotifications'] );
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Log to log table - modify but dont delete
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->appendTaskLog( $this->task, $this->lang->words['task_mobileNotifications_badlicense'] );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* @file prunenotifications.php Task to remove older notifications
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: ips_terabyte $ - Matt Mecham
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-02-08 22:20:18 +0000 (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 remove validating members over configured time
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
// If enabled, remove validating new_reg members & entries from members table
|
||||
if ( intval($this->settings['prune_notifications']) > 0 )
|
||||
{
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
|
||||
$notifyLibrary = new $classToLoad( $this->registry );
|
||||
|
||||
$olderThan = time() - ( $this->settings['prune_notifications'] * ( 86400 * 30 ) );
|
||||
|
||||
$removed = $notifyLibrary->deleteNotificationsOlderThan( $olderThan );
|
||||
|
||||
$this->registry->getClass('class_localization')->loadLanguageFile( array( 'admin_member' ), 'members' );
|
||||
$this->class->appendTaskLog( $this->task, sprintf( $this->lang->words['task_removeoldnotifications'], $removed ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
}
|
||||
@@ -1,169 +1,169 @@
|
||||
<?php
|
||||
/**
|
||||
* @file removelocked.php Task to remove locked members from the ACP list who are already unlocked
|
||||
*~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 remove locked members from the ACP list who are already unlocked
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
|
||||
if ( $this->settings['ipb_bruteforce_attempts'] AND $this->settings['ipb_bruteforce_unlock'] )
|
||||
{
|
||||
/* Init vars */
|
||||
$count = 0;
|
||||
$canUnlock = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'member_id, failed_logins, failed_login_count',
|
||||
'from' => 'members',
|
||||
'where' => 'failed_login_count > 0 AND failed_logins ' . $this->DB->buildIsNull( false ),
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
$used_ips = array();
|
||||
$this_attempt = array();
|
||||
$oldest = 0;
|
||||
$newest = 0;
|
||||
|
||||
if( $r['failed_logins'] )
|
||||
{
|
||||
$failed_logins = explode( ",", IPSText::cleanPermString( $r['failed_logins'] ) );
|
||||
|
||||
if( is_array($failed_logins) AND count($failed_logins) )
|
||||
{
|
||||
sort($failed_logins);
|
||||
|
||||
foreach( $failed_logins as $attempt )
|
||||
{
|
||||
$this_attempt = explode( "-", $attempt );
|
||||
|
||||
if( isset($used_ips[ $this_attempt[1] ]) AND $this_attempt[0] > $used_ips[ $this_attempt[1] ] )
|
||||
{
|
||||
$used_ips[ $this_attempt[1] ] = $this_attempt[0];
|
||||
}
|
||||
}
|
||||
|
||||
$totalLocked = count($used_ips);
|
||||
$totalToUnlock = 0;
|
||||
|
||||
if( count($used_ips) )
|
||||
{
|
||||
foreach( $used_ips as $ip => $timestamp )
|
||||
{
|
||||
if( $timestamp < time() - ($this->settings['ipb_bruteforce_period']*60) )
|
||||
{
|
||||
$totalToUnlock++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $totalToUnlock == $totalLocked )
|
||||
{
|
||||
$canUnlock[] = $r['member_id'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$canUnlock[] = $r['member_id'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$canUnlock[] = $r['member_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if( count($canUnlock) )
|
||||
{
|
||||
$this->DB->update( 'members', array( 'failed_logins' => null, 'failed_login_count' => 0 ), 'member_id IN(' . implode( ',', $canUnlock ) . ')' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// 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_removelocked'], count($canUnlock) ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file removelocked.php Task to remove locked members from the ACP list who are already unlocked
|
||||
*~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 remove locked members from the ACP list who are already unlocked
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
|
||||
if ( $this->settings['ipb_bruteforce_attempts'] AND $this->settings['ipb_bruteforce_unlock'] )
|
||||
{
|
||||
/* Init vars */
|
||||
$count = 0;
|
||||
$canUnlock = array();
|
||||
|
||||
$this->DB->build( array( 'select' => 'member_id, failed_logins, failed_login_count',
|
||||
'from' => 'members',
|
||||
'where' => 'failed_login_count > 0 AND failed_logins ' . $this->DB->buildIsNull( false ),
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $r = $this->DB->fetch($outer) )
|
||||
{
|
||||
$used_ips = array();
|
||||
$this_attempt = array();
|
||||
$oldest = 0;
|
||||
$newest = 0;
|
||||
|
||||
if( $r['failed_logins'] )
|
||||
{
|
||||
$failed_logins = explode( ",", IPSText::cleanPermString( $r['failed_logins'] ) );
|
||||
|
||||
if( is_array($failed_logins) AND count($failed_logins) )
|
||||
{
|
||||
sort($failed_logins);
|
||||
|
||||
foreach( $failed_logins as $attempt )
|
||||
{
|
||||
$this_attempt = explode( "-", $attempt );
|
||||
|
||||
if( isset($used_ips[ $this_attempt[1] ]) AND $this_attempt[0] > $used_ips[ $this_attempt[1] ] )
|
||||
{
|
||||
$used_ips[ $this_attempt[1] ] = $this_attempt[0];
|
||||
}
|
||||
}
|
||||
|
||||
$totalLocked = count($used_ips);
|
||||
$totalToUnlock = 0;
|
||||
|
||||
if( count($used_ips) )
|
||||
{
|
||||
foreach( $used_ips as $ip => $timestamp )
|
||||
{
|
||||
if( $timestamp < time() - ($this->settings['ipb_bruteforce_period']*60) )
|
||||
{
|
||||
$totalToUnlock++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $totalToUnlock == $totalLocked )
|
||||
{
|
||||
$canUnlock[] = $r['member_id'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$canUnlock[] = $r['member_id'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$canUnlock[] = $r['member_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if( count($canUnlock) )
|
||||
{
|
||||
$this->DB->update( 'members', array( 'failed_logins' => null, 'failed_login_count' => 0 ), 'member_id IN(' . implode( ',', $canUnlock ) . ')' );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// 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_removelocked'], count($canUnlock) ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
}
|
||||
@@ -1,139 +1,139 @@
|
||||
<?php
|
||||
/**
|
||||
* @file removevalidating.php Task to remove validating members over configured time
|
||||
*~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 remove validating members over configured time
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
// If enabled, remove validating new_reg members & entries from members table
|
||||
if ( intval($this->settings['validate_day_prune']) > 0 )
|
||||
{
|
||||
/* Init vars */
|
||||
$mids = array();
|
||||
$vids = array();
|
||||
$emails = array();
|
||||
$less_than = time() - $this->settings['validate_day_prune'] * 86400;
|
||||
|
||||
/* Get members from DB */
|
||||
$this->DB->build( array( 'select' => 'v.vid, v.member_id',
|
||||
'from' => array( 'validating' => 'v' ),
|
||||
'where' => 'v.new_reg=1 AND v.coppa_user<>1 AND v.entry_date < '.$less_than.' AND v.lost_pass<>1 AND v.user_verified=0',
|
||||
'add_join' => array( array( 'select' => 'm.posts, m.member_group_id, m.email',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=v.member_id',
|
||||
'type' => 'left' ) )
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $i = $this->DB->fetch($outer) )
|
||||
{
|
||||
if( $i['member_group_id'] != $this->settings['auth_group'] )
|
||||
{
|
||||
// No longer validating?
|
||||
|
||||
$this->DB->delete( 'validating', "vid='{$i['vid']}'" );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( intval($i['posts']) < 1 )
|
||||
{
|
||||
$mids[] = $i['member_id'];
|
||||
}
|
||||
}
|
||||
|
||||
// Remove non-posted validating members
|
||||
|
||||
if ( count($mids) > 0 )
|
||||
{
|
||||
IPSMember::remove( $mids );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// 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_removevalidating'], count($mids) ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file removevalidating.php Task to remove validating members over configured time
|
||||
*~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 remove validating members over configured time
|
||||
*
|
||||
*/
|
||||
class task_item
|
||||
{
|
||||
/**
|
||||
* Object that stores the parent task manager class
|
||||
*
|
||||
* @var $class
|
||||
*/
|
||||
protected $class;
|
||||
|
||||
/**
|
||||
* Array that stores the task data
|
||||
*
|
||||
* @var $task
|
||||
*/
|
||||
protected $task = array();
|
||||
|
||||
/**
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @var $registry
|
||||
* @var $DB
|
||||
* @var $settings
|
||||
* @var $lang
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
protected $lang;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param object $registry Registry object
|
||||
* @param object $class Task manager class object
|
||||
* @param array $task Array with the task data
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry, $class, $task )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->lang = $this->registry->getClass('class_localization');
|
||||
|
||||
$this->class = $class;
|
||||
$this->task = $task;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run this task
|
||||
*
|
||||
* @return @e void
|
||||
*/
|
||||
public function runTask()
|
||||
{
|
||||
// If enabled, remove validating new_reg members & entries from members table
|
||||
if ( intval($this->settings['validate_day_prune']) > 0 )
|
||||
{
|
||||
/* Init vars */
|
||||
$mids = array();
|
||||
$vids = array();
|
||||
$emails = array();
|
||||
$less_than = time() - $this->settings['validate_day_prune'] * 86400;
|
||||
|
||||
/* Get members from DB */
|
||||
$this->DB->build( array( 'select' => 'v.vid, v.member_id',
|
||||
'from' => array( 'validating' => 'v' ),
|
||||
'where' => 'v.new_reg=1 AND v.coppa_user<>1 AND v.entry_date < '.$less_than.' AND v.lost_pass<>1 AND v.user_verified=0',
|
||||
'add_join' => array( array( 'select' => 'm.posts, m.member_group_id, m.email',
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => 'm.member_id=v.member_id',
|
||||
'type' => 'left' ) )
|
||||
) );
|
||||
$outer = $this->DB->execute();
|
||||
|
||||
while( $i = $this->DB->fetch($outer) )
|
||||
{
|
||||
if( $i['member_group_id'] != $this->settings['auth_group'] )
|
||||
{
|
||||
// No longer validating?
|
||||
|
||||
$this->DB->delete( 'validating', "vid='{$i['vid']}'" );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( intval($i['posts']) < 1 )
|
||||
{
|
||||
$mids[] = $i['member_id'];
|
||||
}
|
||||
}
|
||||
|
||||
// Remove non-posted validating members
|
||||
|
||||
if ( count($mids) > 0 )
|
||||
{
|
||||
IPSMember::remove( $mids );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// 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_removevalidating'], count($mids) ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Unlock Task: DO NOT MODIFY!
|
||||
//-----------------------------------------
|
||||
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,12 @@
|
||||
* @file twitfacesync.php Task to update data from Twitter and Facebook (photos, statuses, etc)
|
||||
*~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 -
|
||||
* $LastChangedDate: 2011-04-19 23:03:31 -0400 (Tue, 19 Apr 2011) $
|
||||
* @version v3.2.3
|
||||
* $Revision: 8397 $
|
||||
* $LastChangedDate: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 10914 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -99,7 +99,7 @@ class task_item
|
||||
'from' => array( 'members' => 'm' ),
|
||||
'where' => '( (m.twitter_id != \'\' AND m.tc_lastsync < ' . $_sync .') OR (m.fb_uid > 0 AND m.fb_lastsync < ' . $_sync . ') ) AND p.partial_id ' . $this->DB->buildIsNull(true) . ' AND m.last_visit > ' . $_active,
|
||||
'order' => 'm.last_visit DESC',
|
||||
'limit' => array( 0, 100 ),
|
||||
'limit' => array( 0, 30 ),
|
||||
'add_join' => array(
|
||||
array(
|
||||
'from' => array( 'members_partial' => 'p' ),
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* @file update_profile_views.php Task to update the profile views from the temporary table
|
||||
*~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: ips_terabyte $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-02-08 17:20:18 -0500 (Tue, 08 Feb 2011) $
|
||||
* @version v3.2.3
|
||||
* @version v3.3.4
|
||||
* $Revision: 7750 $
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
/**
|
||||
* @file warnings.php Task to optimize database tables daily
|
||||
* $Copyright: © 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: mark $
|
||||
* @since -
|
||||
* $LastChangedDate: 2011-11-18 06:19:03 -0500 (Fri, 18 Nov 2011) $
|
||||
* @version v3.3.4
|
||||
* $Revision: 9838 $
|
||||
*/
|
||||
|
||||
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
|
||||
{
|
||||
/**
|
||||
* 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()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Do it
|
||||
//-----------------------------------------
|
||||
|
||||
$this->DB->build( array(
|
||||
'select' => '*',
|
||||
'from' => 'members_warn_logs',
|
||||
'where' => 'wl_expire>0 AND wl_expire_date>0 AND wl_expire_date<' . time(),
|
||||
'order' => 'wl_date ASC',
|
||||
'limit' => array( 0, 25 )
|
||||
) );
|
||||
$e = $this->DB->execute();
|
||||
while ( $r = $this->DB->fetch( $e ) )
|
||||
{
|
||||
$this->DB->update( 'members', "warn_level=warn_level-{$r['wl_points']}", "member_id={$r['wl_member']}", FALSE, TRUE );
|
||||
$this->DB->update( 'members_warn_logs', array( 'wl_expire_date' => 0 ), "wl_id={$r['wl_id']}" );
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Finish
|
||||
//-----------------------------------------
|
||||
|
||||
/* 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__warnings'] );
|
||||
|
||||
/* Unlock Task: DO NOT MODIFY! */
|
||||
$this->class->unlockTask( $this->task );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user