mirror of
https://github.com/e107inc/e107.git
synced 2025-07-09 09:13:25 +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:
@ -543,6 +543,7 @@ class banlist_form_ui extends e_admin_form_ui
|
|||||||
|
|
||||||
protected $fieldpref = array('gen_datestamp', 'gen_ip', 'gen_chardata');
|
protected $fieldpref = array('gen_datestamp', 'gen_ip', 'gen_chardata');
|
||||||
|
|
||||||
|
protected $batchOptions = array();
|
||||||
|
|
||||||
// optional
|
// optional
|
||||||
public function init()
|
public function init()
|
||||||
@ -552,6 +553,26 @@ class banlist_form_ui extends e_admin_form_ui
|
|||||||
$dels = implode(',',$_POST['e-multiselect']);
|
$dels = implode(',',$_POST['e-multiselect']);
|
||||||
//$e107::getDb()->insert('banlist',
|
//$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)
|
public function afterDelete($data)
|
||||||
|
Reference in New Issue
Block a user