1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-21 21:21:54 +02:00

Add banlist retrigger handling

This commit is contained in:
e107steved 2011-12-30 16:09:10 +00:00
parent 86030cd8f9
commit 6f61a7f889
5 changed files with 39 additions and 8 deletions
e107_admin
e107_handlers
e107_plugins
calendar_menu
pm

@ -135,7 +135,8 @@ class cron_admin_ui extends e_admin_ui
'name' => 'Mail Queue',
'category' => 'mail',
'function' => 'procEmailQueue',
'description' => 'Process mail queue'),
'description' => 'Process mail queue'
),
2 => array(
'name' => 'Mail Bounce Check',
'category' => 'mail',
@ -143,6 +144,13 @@ class cron_admin_ui extends e_admin_ui
'description' => 'Check for bounced emails',
// 'available' => vartrue($pref['mail_bounce_auto'])
),
3 => array(
'name' => 'Ban Retrigger Check',
'category' => 'user',
'function' => 'procBanRetrigger',
'description' => 'Process bounce retriggers<br />Only needed if retriggering of bans enabled.',
'available' => e107::getPref('ban_retrigger')
),
);
if(!$_GET['action'])
@ -424,12 +432,13 @@ class cron_admin_form_ui extends e_admin_form_ui
var $cronCategories = array(
'backup' => "Backup",
'backup' => 'Backup',
'content' => ADLAN_CL_3,
'log' => "Logging",
'log' => 'Logging',
'mail' => ADLAN_136,
'notify' => ADLAN_149,
'user' => LAN_USER,
'plugin' => 'Plugins'
);
/**

@ -18,6 +18,7 @@
if (!defined('e107_INIT')) { exit; }
define ('CRON_MAIL_DEBUG', TRUE);
define ('CRON_RETRIGGER_DEBUG', TRUE);
class _system_cron
{
@ -43,7 +44,7 @@ class _system_cron
function procEmailQueue()
{
global $pref;
//global $pref;
if (CRON_MAIL_DEBUG)
{
$e107 = e107::getInstance();
@ -60,7 +61,7 @@ class _system_cron
function procEmailBounce()
{
global $pref;
//global $pref;
if (CRON_MAIL_DEBUG)
{
$e107 = e107::getInstance();
@ -75,6 +76,23 @@ class _system_cron
}
}
function procBanRetrigger()
{
//global $pref;
if (CRON_RETRIGGER_DEBUG)
{
$e107 = e107::getInstance();
$e107->admin_log->e_log_event(10,debug_backtrace(),'DEBUG','CRON Ban retrigger','Retrigger processing started',FALSE,LOG_TO_ROLLING);
}
require_once(e_HANDLER.'iphandler_class.php');
$ipManager = new banlistManager();
$ipManager->banRetriggerAction();
if (CRON_RETRIGGER_DEBUG)
{
$e107->admin_log->e_log_event(10,debug_backtrace(),'DEBUG','CRON Ban Retrigger','Retrigger processing completed',FALSE,LOG_TO_ROLLING);
}
}
}
@ -100,7 +118,7 @@ class _system_cron
* This class is idea for people who can not use the traditional Unix cron through shell.
* One way of using is embedding the calling script in a web page which is often visited.
* The script will work out the last due time, by comparing with run log timestamp. The scrip
* will envoke any scripts needed to run, be it deleting older table records, or updating prices.
* will invoke any scripts needed to run, be it deleting older table records, or updating prices.
* It can parse the same cron string used by Unix.
*/

@ -1480,6 +1480,10 @@ class banlistManager
}
}
}
if ($numRet)
{
$this->writeBanListFiles('ip'); // Just rewrite the ban list - the actual IP addresses won't have changed
}
return $numRet;
}
}

@ -56,7 +56,7 @@ class calendar_menu_cron // include plugin-folder in the name.
public function config()
{
$cron = array();
$cron[] = array('name' => LAN_EC_MAIL_04, 'function' => 'processSubs', 'description' => LAN_EC_MAIL_05);
$cron[] = array('name' => LAN_EC_MAIL_04, 'category' => 'plugin', 'function' => 'processSubs', 'description' => LAN_EC_MAIL_05);
return $cron;
}

@ -60,7 +60,7 @@ class pm_cron // include plugin-folder in the name.
$cron = array();
$cron[] = array(
'name' => LAN_EC_PM_04,
'category' => 'log',
'category' => 'plugin',
'function' => 'processPM',
'description' => LAN_EC_PM_05
);