1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

Added new failed-login-limit pref to default install. Some minor language-file cleanup.

This commit is contained in:
Cameron
2015-04-12 23:11:13 -07:00
parent 0d86f9a42f
commit a2fdd27d7b
5 changed files with 38 additions and 7 deletions

View File

@@ -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)

View File

@@ -92,6 +92,7 @@
<core name="emotepack">default</core>
<core name="enable_rdns">0</core>
<core name="enable_rdns_on_ban">0</core>
<core name="failed_login_limit">10</core>
<core name="filter_script">0</core>
<core name="flood_hits">100</core>
<core name="flood_protect">1</core>

View File

@@ -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'], '...');

View File

@@ -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);

View File

@@ -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");