Пример #1
0
def ban(event):
    r = event.request
    ip_ban = general.list_bans(ip = r.remote_addr)

    if 'logged_in' in r.session:
        username_ban = general.list_bans(username = users.get_user_by_id(r.session['users.id']).name)
    else:
        username_ban = False

    if ip_ban or username_ban:
        raise httpexceptions.HTTPForbidden