Esempio n. 1
0
def modifytranslations(req, ln=CFG_SITE_LANG, bsrID='', trans=None, confirm=0):
    """
    Display the modify translations page
    """
    navtrail_previous_links = bsc.getnavtrail(
    ) + """&gt; <a class="navtrail" href="%s/admin/bibsort/bibsortadmin.py/">BibSort Admin Interface</a> """ % (
        CFG_SITE_URL)

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

    auth = bsc.check_user(req, 'cfgbibsort')
    if not auth[0]:
        bsrID = wash_url_argument(bsrID, 'int')
        confirm = wash_url_argument(confirm, 'int')
        return page(title="Modify translations",
                    body=bsc.perform_modifytranslations(
                        ln, bsrID, trans, confirm),
                    uid=uid,
                    language=ln,
                    navtrail=navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
    else:
        return page_not_authorized(req=req,
                                   text=auth[1],
                                   navtrail=navtrail_previous_links)
Esempio n. 2
0
def index(req, ln=CFG_SITE_LANG, action='', bsrID='', sm_name='', sm_def_type='', sm_def_value='', sm_washer='', sm_locale=''):
    """
    Display the initial(main) page
    """
    navtrail_previous_links = bsc.getnavtrail()

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

    auth = bsc.check_user(req,'cfgbibsort')
    if not auth[0]:
        action = wash_url_argument(action, 'str')
        bsrID = wash_url_argument(bsrID, 'int')
        sm_name = wash_url_argument(sm_name, 'str')
        sm_def_type = wash_url_argument(sm_def_type, 'str')
        sm_def_value = wash_url_argument(sm_def_value, 'str')
        sm_washer = wash_url_argument(sm_washer, 'str')
        sm_locale = wash_url_argument(sm_locale, 'str')
        return page(title="BibSort Admin Interface",
                body=bsc.perform_index(ln, action, bsrID, sm_name, sm_def_type, sm_def_value, sm_washer, sm_locale),
                uid=uid,
                language=ln,
                navtrail = navtrail_previous_links,
                lastupdated=__lastupdated__,
                req=req)
    else:
        return page_not_authorized(req=req, text=auth[1], navtrail=navtrail_previous_links)
Esempio n. 3
0
def index(req,
          ln=CFG_SITE_LANG,
          action='',
          bsrID='',
          sm_name='',
          sm_def_type='',
          sm_def_value='',
          sm_washer='',
          sm_locale=''):
    """
    Display the initial(main) page
    """
    navtrail_previous_links = bsc.getnavtrail()

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

    auth = bsc.check_user(req, 'cfgbibsort')
    if not auth[0]:
        action = wash_url_argument(action, 'str')
        bsrID = wash_url_argument(bsrID, 'int')
        sm_name = wash_url_argument(sm_name, 'str')
        sm_def_type = wash_url_argument(sm_def_type, 'str')
        sm_def_value = wash_url_argument(sm_def_value, 'str')
        sm_washer = wash_url_argument(sm_washer, 'str')
        sm_locale = wash_url_argument(sm_locale, 'str')
        return page(title="BibSort Admin Interface",
                    body=bsc.perform_index(ln, action, bsrID, sm_name,
                                           sm_def_type, sm_def_value,
                                           sm_washer, sm_locale),
                    uid=uid,
                    language=ln,
                    navtrail=navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
    else:
        return page_not_authorized(req=req,
                                   text=auth[1],
                                   navtrail=navtrail_previous_links)
Esempio n. 4
0
def modifytranslations(req, ln=CFG_SITE_LANG, bsrID='', trans=None, confirm=0):
    """
    Display the modify translations page
    """
    navtrail_previous_links = bsc.getnavtrail()+ """&gt; <a class="navtrail" href="%s/admin/bibsort/bibsortadmin.py/">BibSort Admin Interface</a> """ % (CFG_SITE_URL)

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

    auth = bsc.check_user(req,'cfgbibsort')
    if not auth[0]:
        bsrID = wash_url_argument(bsrID, 'int')
        confirm = wash_url_argument(confirm, 'int')
        return page(title="Modify translations",
                    body=bsc.perform_modifytranslations(ln, bsrID, trans, confirm),
                    uid=uid,
                    language=ln,
                    navtrail = navtrail_previous_links,
                    lastupdated=__lastupdated__,
                    req=req)
    else:
        return page_not_authorized(req=req, text=auth[1], navtrail=navtrail_previous_links)