~ubuntu-bots/ubuntu-bots/devel

« back to all changes in this revision

Viewing changes to Bantracker/cgi/bans.cgi

  • Committer: tsimpson
  • Date: 2014-04-15 05:15:24 UTC
  • mfrom: (311.1.1 ubuntu-bots)
  • Revision ID: tsimpson@ubuntu.com-20140415051524-auvnksltipv32m0s
Merge lp:~m4v/ubuntu-bots/fetch-quiets (LP: #799524)

Show diffs side-by-side

added added

removed removed

Lines of Context:
304
304
makeInput("kicks", "Kicks")
305
305
makeInput("bans", "Bans")
306
306
makeInput("oldbans", "Removed bans")
 
307
makeInput("marks", "Marks")
307
308
print '</div>'
308
309
    
309
310
print '<div style="float:left">'
324
325
    send_page('bans.tmpl')
325
326
 
326
327
# Select and filter bans
327
 
def getBans(id=None, mask=None, kicks=True, oldbans=True, bans=True, floodbots=True, operator=None,
 
328
def getBans(id=None, mask=None, kicks=True, oldbans=True, bans=True, marks=True, floodbots=True, operator=None,
328
329
            channel=None, limit=None, offset=0, withCount=False):
329
330
    sql = "SELECT channel, mask, operator, time, removal, removal_op, id FROM bans"
330
331
    args = []
343
344
    if channel:
344
345
        where.append("channel LIKE %s")
345
346
        args.append(channel)
 
347
    if not marks:
 
348
        where.append("id NOT IN (SELECT ban_id FROM comments WHERE comment LIKE '**MARK**%%')")
346
349
    if not kicks:
347
350
        where.append("mask LIKE '%%!%%'")
348
351
    if not (oldbans or bans):
424
427
    bans, ban_count = getBans(mask=query, kicks=isOn('kicks'),
425
428
                               oldbans=isOn('oldbans') or isOn('oldmutes'),
426
429
                               bans=isOn('bans') or isOn('mutes'),
 
430
                               marks=isOn('marks'),
427
431
                               floodbots=isOn('floodbots'),
428
432
                               operator=oper,
429
433
                               channel=chan,