Exemplo n.º 1
0
def show_wb(blacklist, whitelist, recipient):
    if blacklist:
        list_type = 'blacklist'
    elif whitelist:
        list_type = 'whitelist'
    else:
        list_type = None

    try:
        show_wblist(list_type, recipient)
    except:
        raise
Exemplo n.º 2
0
 def GET(self, function = None, identifier = None):
     session = web.config._session
     wbauth = Cookie(web.cookies().get(authCookie))
     if not wbauth:
         return unauthorized()
     try:
         if not session.ticket['ticket'] == wbauth.ticket:
             return unauthorized()
     except AttributeError:
         return unauthorized()
     logging.info("showList (GET): %s %s %s" % (function, identifier,  wbauth))
     if not validateCSRFToken(web.ctx.env, session):
         return unauthorized()
     if not function:
         rows = wb.show_wblist(None, None, silent = True)
         return createResponse(web, rows)
     else:
         if function.startswith('/'):
             identifier = function.lstrip('/')
             function = None
         rows = wb.show_wblist(function, identifier, silent = True)
         return createResponse(web, rows)