mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
Added new failed-login-limit pref to default install. Some minor language-file cleanup.
This commit is contained in:
@@ -92,6 +92,7 @@ class banlist_ui extends e_admin_ui
|
|||||||
protected $table = 'banlist';
|
protected $table = 'banlist';
|
||||||
protected $pid = 'banlist_id';
|
protected $pid = 'banlist_id';
|
||||||
protected $perPage = 10;
|
protected $perPage = 10;
|
||||||
|
protected $listOrder = 'banlist_datestamp DESC';
|
||||||
|
|
||||||
protected $fields = array (
|
protected $fields = array (
|
||||||
'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
|
'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
|
||||||
@@ -101,7 +102,7 @@ class banlist_ui extends e_admin_ui
|
|||||||
'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_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_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_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', ),
|
'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', ),
|
'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
|
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
|
// Custom Method/Function
|
||||||
function banlist_bantype($curVal,$mode)
|
function banlist_bantype($curVal,$mode)
|
||||||
|
@@ -92,6 +92,7 @@
|
|||||||
<core name="emotepack">default</core>
|
<core name="emotepack">default</core>
|
||||||
<core name="enable_rdns">0</core>
|
<core name="enable_rdns">0</core>
|
||||||
<core name="enable_rdns_on_ban">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="filter_script">0</core>
|
||||||
<core name="flood_hits">100</core>
|
<core name="flood_hits">100</core>
|
||||||
<core name="flood_protect">1</core>
|
<core name="flood_protect">1</core>
|
||||||
|
@@ -3086,6 +3086,11 @@ class e_form
|
|||||||
case 'tags':
|
case 'tags':
|
||||||
case 'text':
|
case 'text':
|
||||||
|
|
||||||
|
if(!empty($parms['constant']))
|
||||||
|
{
|
||||||
|
$value = defset($value,$value);
|
||||||
|
}
|
||||||
|
|
||||||
if(vartrue($parms['truncate']))
|
if(vartrue($parms['truncate']))
|
||||||
{
|
{
|
||||||
$value = $tp->text_truncate($value, $parms['truncate'], '...');
|
$value = $tp->text_truncate($value, $parms['truncate'], '...');
|
||||||
|
@@ -217,8 +217,10 @@ class e_online
|
|||||||
// Check for excessive access
|
// Check for excessive access
|
||||||
if ($row['online_pagecount'] > $online_bancount)
|
if ($row['online_pagecount'] > $online_bancount)
|
||||||
{
|
{
|
||||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_banlist.php');
|
e107::lan('core','banlist',true);//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))
|
$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('flood', $ip); //BC
|
||||||
e107::getEvent()->trigger('user_ban_flood', $ip);
|
e107::getEvent()->trigger('user_ban_flood', $ip);
|
||||||
|
@@ -82,7 +82,7 @@ define("BANLAN_74", "Banlist Maintenance");
|
|||||||
define("BANLAN_75", "Remove expired bans from list");
|
define("BANLAN_75", "Remove expired bans from list");
|
||||||
define("BANLAN_76", "Execute");
|
define("BANLAN_76", "Execute");
|
||||||
define("BANLAN_77", "Messages/Ban Periods");
|
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_79", "CSV Export format:");
|
||||||
define("BANLAN_80", "CSV Import format:");
|
define("BANLAN_80", "CSV Import format:");
|
||||||
define("BANLAN_81", "Ban Action Log");
|
define("BANLAN_81", "Ban Action Log");
|
||||||
|
Reference in New Issue
Block a user