|
|
|
@ -533,20 +533,26 @@ class Fail2BanDb(object):
|
|
|
|
|
ticket.getData()))
|
|
|
|
|
|
|
|
|
|
@commitandrollback
|
|
|
|
|
def delBan(self, cur, jail, ip):
|
|
|
|
|
"""Delete a ban from the database.
|
|
|
|
|
def delBan(self, cur, jail, *args):
|
|
|
|
|
"""Delete a single or multiple tickets from the database.
|
|
|
|
|
|
|
|
|
|
Parameters
|
|
|
|
|
----------
|
|
|
|
|
jail : Jail
|
|
|
|
|
Jail in which the ban has occurred.
|
|
|
|
|
ip : str
|
|
|
|
|
IP to be removed.
|
|
|
|
|
Jail in which the ticket(s) should be removed.
|
|
|
|
|
args : list of IP
|
|
|
|
|
IPs to be removed, if not given all tickets of jail will be removed.
|
|
|
|
|
"""
|
|
|
|
|
queryArgs = (jail.name, str(ip));
|
|
|
|
|
cur.execute(
|
|
|
|
|
"DELETE FROM bans WHERE jail = ? AND ip = ?",
|
|
|
|
|
queryArgs);
|
|
|
|
|
query = "DELETE FROM bans WHERE jail = ?"
|
|
|
|
|
queryArgs = [jail.name];
|
|
|
|
|
if not len(args):
|
|
|
|
|
cur.execute(query, queryArgs);
|
|
|
|
|
return
|
|
|
|
|
query += " AND ip = ?"
|
|
|
|
|
queryArgs.append('');
|
|
|
|
|
for ip in args:
|
|
|
|
|
queryArgs[1] = str(ip);
|
|
|
|
|
cur.execute(query, queryArgs);
|
|
|
|
|
|
|
|
|
|
@commitandrollback
|
|
|
|
|
def _getBans(self, cur, jail=None, bantime=None, ip=None):
|
|
|
|
|