Beispiel #1
0
def index(req, colID=1, ln=CFG_SITE_LANG, mtype='', content='', confirm=0):
    navtrail_previous_links = wsc.getnavtrail()

    try:
        uid = getUid(req)
    except:
        return error_page('Error', req)

    auth = check_user(req,'cfgwebsearch')
    if not auth[0]:
        return page(title="WebSearch Admin",
                body=wsc.perform_index(colID=colID,
                                       ln=ln,
                                       mtype=mtype,
                                       content=content,
                                       confirm=confirm),
                uid=uid,
                language=ln,
                req=req,
                navtrail = navtrail_previous_links,
                lastupdated=__lastupdated__)
    else:
        return page_not_authorized(req=req, text=auth[1], navtrail=navtrail_previous_links)
        return page_not_authorized(req=req, text=auth[1], navtrail=navtrail_previous_links)

def index(req, colID=1, ln=CFG_SITE_LANG, mtype='', content='', confirm=0):
    navtrail_previous_links = wsc.getnavtrail()

    try:
        uid = getUid(req)
    except Error, e:
        return error_page(req)

    auth = check_user(req,'cfgwebsearch')
    if not auth[0]:
        return page(title="WebSearch Admin",
                body=wsc.perform_index(colID=colID,
                                       ln=ln,
                                       mtype=mtype,
                                       content=content,
                                       confirm=confirm),
                uid=uid,
                language=ln,
                req=req,
                navtrail = navtrail_previous_links,
                lastupdated=__lastupdated__)
    else:
        return page_not_authorized(req=req, text=auth[1], navtrail=navtrail_previous_links)

def error_page(req, ln=CFG_SITE_LANG, verbose=1):
    _ = gettext_set_language(ln)

    return page(title=_("Internal Error"),
                body = create_error_box(req, verbose=verbose, ln=ln),
        return page_not_authorized(req=req, text=auth[1], navtrail=navtrail_previous_links)

def index(req, colID=1, ln=CFG_SITE_LANG, mtype='', content='', confirm=0):
    navtrail_previous_links = wsc.getnavtrail()

    try:
        uid = getUid(req)
    except Error, e:
        return error_page(req)

    auth = check_user(req,'cfgwebsearch')
    if not auth[0]:
        return page(title="WebSearch Admin",
                body=wsc.perform_index(colID=colID,
                                       ln=ln,
                                       mtype=mtype,
                                       content=content,
                                       confirm=confirm),
                uid=uid,
                language=ln,
                req=req,
                navtrail = navtrail_previous_links,
                lastupdated=__lastupdated__)
    else:
        return page_not_authorized(req=req, text=auth[1], navtrail=navtrail_previous_links)

def error_page(req, ln=CFG_SITE_LANG, verbose=1):
    _ = gettext_set_language(ln)

    return page(title=_("Internal Error"),
                body = create_error_box(req, verbose=verbose, ln=ln),