Example #1
0
def getSelectedSetup():
    if 'setup' in session:
        selectedSetup = session['setup']
        if selectedSetup in gWebConfig.getSetups():
            return selectedSetup
        else:
            return gWebConfig.getDefaultSetup()
    else:
        return gWebConfig.getDefaultSetup()
Example #2
0
def getSelectedSetup():
    if "setup" in session:
        selectedSetup = session["setup"]
        if selectedSetup in gWebConfig.getSetups():
            return selectedSetup
        else:
            return gWebConfig.getDefaultSetup()
    else:
        return gWebConfig.getDefaultSetup()
Example #3
0
def checkUserCredentials():
    routesDict = request.environ['pylons.routes_dict']
    environ = request.environ
    if 'dsetup' in routesDict:
        routesDict['dsetup'] = __checkSetup(routesDict['dsetup'])
    else:
        routesDict['dsetup'] = gWebConfig.getDefaultSetup()
    userDN, userName = __checkDN(environ)
    if 'dgroup' not in routesDict:
        routesDict['dgroup'] = 'visitor'
    userGroup, availableGroups = __checkGroup(userName, routesDict['dgroup'])
    routesDict['dgroup'] = userGroup
    environ['DIRAC.userCredentials'] = {
        'DN': userDN,
        'username': userName,
        'group': userGroup,
        'availableGroups': availableGroups
    }
Example #4
0
def checkUserCredentials():
    routesDict = request.environ["pylons.routes_dict"]
    environ = request.environ
    if "dsetup" in routesDict:
        routesDict["dsetup"] = __checkSetup(routesDict["dsetup"])
    else:
        routesDict["dsetup"] = gWebConfig.getDefaultSetup()
    userDN, userName = __checkDN(environ)
    if "dgroup" not in routesDict:
        routesDict["dgroup"] = "visitor"
    userGroup, availableGroups = __checkGroup(userName, routesDict["dgroup"])
    routesDict["dgroup"] = userGroup
    environ["DIRAC.userCredentials"] = {
        "DN": userDN,
        "username": userName,
        "group": userGroup,
        "availableGroups": availableGroups,
    }
    if userDN and userName == "anonymous":
        userCN = __getCN(environ)
        if userCN:
            environ["DIRAC.userCredentials"]["CN"] = userCN
Example #5
0
def __checkSetup(setup):
    if setup not in gWebConfig.getSetups():
        return gWebConfig.getDefaultSetup()
    return setup
Example #6
0
def getSelectedSetup():
    setup = request.environ['pylons.routes_dict']['dsetup']
    if setup not in gWebConfig.getSetups():
        return gWebConfig.getDefaultSetup()
    return setup
Example #7
0
def __checkSetup(setup):
    if setup not in gWebConfig.getSetups():
        return gWebConfig.getDefaultSetup()
    return setup
Example #8
0
def getSelectedSetup():
    setup = request.environ["pylons.routes_dict"]["dsetup"]
    if setup not in gWebConfig.getSetups():
        return gWebConfig.getDefaultSetup()
    return setup