示例#1
0
def getMainPageLoggedIn(request):
    # check if user has priviliges and if yes allow him to modify
    groups = groupfinder(unauthenticated_userid(request), request)
    with_modify = False
    if groups and 'g:moderator' in groups or 'g:admin' in groups:
        with_modify = True
    return {'welcomepage': 'off', 'with_modify': with_modify}
示例#2
0
def getPage_profileMtb(request):
    try:
        messtischblatt_id = None
        if 'id' in request.params:
            messtischblatt_id = request.params['id']
            log.info('Receive get profile mtb page for id %s.' %
                     messtischblatt_id)

        messtischblatt = Messtischblatt.by_id(messtischblatt_id, request.db)

        user_id = authenticated_userid(request)
        if user_id:
            groups = groupfinder(user_id, request)
            if groups and 'g:moderator' in groups or 'g:admin' in groups:
                return {
                    'with_modify': True,
                    'zoomify_prop': messtischblatt.zoomify_properties,
                    'zoomify_width': messtischblatt.zoomify_width,
                    'zoomify_height': messtischblatt.zoomify_height,
                    'key': messtischblatt.dateiname
                }

        return {
            'zoomify_prop': messtischblatt.zoomify_properties,
            'zoomify_width': messtischblatt.zoomify_width,
            'zoomify_height': messtischblatt.zoomify_height,
            'key': messtischblatt.dateiname
        }
    except:
        log.error(
            'Internal server error while trying to get profile page. Please try again or contact the page administrator.'
        )
        raise InternalAuthentificationError(
            'Internal server error while trying to get profile page. Please try again or contact the page administrator.'
        )
示例#3
0
def getMainPageLoggedIn(request):
    # check if user has priviliges and if yes allow him to modify
    groups = groupfinder(unauthenticated_userid(request), request)
    with_modify = False
    if groups and 'g:moderator' in groups or 'g:admin' in groups:
        with_modify = True       
    return {'welcomepage':'off', 'with_modify':with_modify}
示例#4
0
def getPage_profileMtb(request):
    try:
        messtischblatt_id = None
        if 'id' in request.params:
            messtischblatt_id = request.params['id']
            log.info('Receive get profile mtb page for id %s.'%messtischblatt_id)
        
        messtischblatt = Messtischblatt.by_id(messtischblatt_id, request.db)
        
        user_id = authenticated_userid(request)
        if user_id:
            groups = groupfinder(user_id, request)
            if groups and 'g:moderator' in groups or 'g:admin' in groups:
                return {'with_modify':True, 'zoomify_prop':messtischblatt.zoomify_properties,
                        'zoomify_width':messtischblatt.zoomify_width,'zoomify_height':messtischblatt.zoomify_height,
                        'key':messtischblatt.dateiname}
                
        return {'zoomify_prop':messtischblatt.zoomify_properties,'zoomify_width':messtischblatt.zoomify_width,
                'zoomify_height':messtischblatt.zoomify_height,'key':messtischblatt.dateiname}
    except:
        log.error('Internal server error while trying to get profile page. Please try again or contact the page administrator.')
        raise InternalAuthentificationError('Internal server error while trying to get profile page. Please try again or contact the page administrator.')