diff --git a/e107_admin/banlist.php b/e107_admin/banlist.php index b59347fc6..b76182160 100644 --- a/e107_admin/banlist.php +++ b/e107_admin/banlist.php @@ -91,17 +91,18 @@ class banlist_ui extends e_admin_ui protected $eventName = 'ban'; protected $table = 'banlist'; protected $pid = 'banlist_id'; - protected $perPage = 10; + protected $perPage = 10; + protected $listOrder = 'banlist_datestamp DESC'; protected $fields = array ( 'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ), - 'banlist_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), + 'banlist_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'banlist_ip' => array ( 'title' => LAN_IP, 'type' => 'ip', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'banlist_bantype' => array ( 'title' => LAN_TYPE, 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'filter'=>true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'banlist_datestamp' => array ( 'title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => 'auto=1&hidden=1&readonly=1', 'class' => 'left', 'thclass' => 'left', ), 'banlist_banexpires' => array ( 'title' => 'Expires', 'type' => 'method', 'data' => 'int', 'inline'=>true, 'width' => 'auto', 'batch' => true, 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'banlist_admin' => array ( 'title' => 'Admin', 'type' => 'boolean', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), - 'banlist_reason' => array ( 'title' => 'Reason', 'type' => 'text', 'data' => 'str', 'inline'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), + 'banlist_reason' => array ( 'title' => 'Reason', 'type' => 'text', 'data' => 'str', 'inline'=>true, 'width' => 'auto', 'help' => '', 'readParms' => 'constant=1', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'banlist_notes' => array ( 'title' => 'Notes', 'type' => 'text', 'data' => 'str', 'inline'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'options' => array ( 'title' => LAN_OPTIONS, 'type' => '', 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ), ); @@ -295,6 +296,28 @@ class banlist_ui extends e_admin_ui class banlist_form_ui extends e_admin_form_ui { + // Custom Method/Function + function banlist_reason($curVal,$mode) //TODO + { + + switch($mode) + { + case 'read': // List Page + + break; + + case 'write': // Edit Page + return $this->renderElement('banlist_reason', $curVal, array()); + break; + + case 'filter': + case 'batch': + + break; + } + } + + // Custom Method/Function function banlist_bantype($curVal,$mode) diff --git a/e107_core/xml/default_install.xml b/e107_core/xml/default_install.xml index ae8a990a5..c2bb22ebb 100644 --- a/e107_core/xml/default_install.xml +++ b/e107_core/xml/default_install.xml @@ -92,6 +92,7 @@ default 0 0 + 10 0 100 1 diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 90c2d87a0..4d501b7e2 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -3085,7 +3085,12 @@ class e_form case 'tags': case 'text': - + + if(!empty($parms['constant'])) + { + $value = defset($value,$value); + } + if(vartrue($parms['truncate'])) { $value = $tp->text_truncate($value, $parms['truncate'], '...'); diff --git a/e107_handlers/online_class.php b/e107_handlers/online_class.php index 2598ee467..5ae3e25b9 100755 --- a/e107_handlers/online_class.php +++ b/e107_handlers/online_class.php @@ -217,8 +217,10 @@ class e_online // Check for excessive access if ($row['online_pagecount'] > $online_bancount) { - include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_banlist.php'); - if (true === e107::getIPHandler()->add_ban(2,str_replace('--HITS--',$row['online_pagecount'],BANLAN_78),$ip,0)) + e107::lan('core','banlist',true);//e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_banlist.php' + $reason = e107::getParser()->lanVars(BANLAN_78,$row['online_pagecount']); // str_replace('--HITS--',$row['online_pagecount'], BANLAN_78) + + if (true === e107::getIPHandler()->add_ban(2, $reason, $ip,0)) { e107::getEvent()->trigger('flood', $ip); //BC e107::getEvent()->trigger('user_ban_flood', $ip); diff --git a/e107_languages/English/admin/lan_banlist.php b/e107_languages/English/admin/lan_banlist.php index 7c8c49aa4..6230ca0cb 100644 --- a/e107_languages/English/admin/lan_banlist.php +++ b/e107_languages/English/admin/lan_banlist.php @@ -82,7 +82,7 @@ define("BANLAN_74", "Banlist Maintenance"); define("BANLAN_75", "Remove expired bans from list"); define("BANLAN_76", "Execute"); define("BANLAN_77", "Messages/Ban Periods"); -define("BANLAN_78", "Hit count exceeded (--HITS-- requests within allotted time)"); +define("BANLAN_78", "Hit count exceeded ([x] requests within allotted time)"); define("BANLAN_79", "CSV Export format:"); define("BANLAN_80", "CSV Import format:"); define("BANLAN_81", "Ban Action Log");