mirror of
https://github.com/e107inc/e107.git
synced 2025-04-14 01:22:13 +02:00
Fixed #2087 - New Feature: "Delete all X failed logins from database" added to batch-drop down menu in Failed Logins admin area.
This commit is contained in:
parent
12bca51fc8
commit
61a02c7569
@ -543,6 +543,7 @@ class banlist_form_ui extends e_admin_form_ui
|
||||
|
||||
protected $fieldpref = array('gen_datestamp', 'gen_ip', 'gen_chardata');
|
||||
|
||||
protected $batchOptions = array();
|
||||
|
||||
// optional
|
||||
public function init()
|
||||
@ -552,6 +553,26 @@ class banlist_form_ui extends e_admin_form_ui
|
||||
$dels = implode(',',$_POST['e-multiselect']);
|
||||
//$e107::getDb()->insert('banlist',
|
||||
}
|
||||
|
||||
$allFailedTotal = e107::getDB()->count('generic', '(*)', "gen_type='failed_login'");
|
||||
|
||||
$this->batchOptions = array('delete-all'=>"Delete all ".$allFailedTotal." failed logins from database");
|
||||
|
||||
if(!empty($_POST['etrigger_batch']) && $_POST['etrigger_batch'] == "delete-all")
|
||||
{
|
||||
$this->deleteAllFailed();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function deleteAllFailed()
|
||||
{
|
||||
|
||||
if(e107::getDB()->delete('generic', "gen_type='failed_login'"))
|
||||
{
|
||||
e107::getMessage()->addSuccess(LAN_DELETED);
|
||||
}
|
||||
}
|
||||
|
||||
public function afterDelete($data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user