def getSelectedSetup(): if 'setup' in session: selectedSetup = session['setup'] if selectedSetup in gWebConfig.getSetups(): return selectedSetup else: return gWebConfig.getDefaultSetup() else: return gWebConfig.getDefaultSetup()
def getSelectedSetup(): if "setup" in session: selectedSetup = session["setup"] if selectedSetup in gWebConfig.getSetups(): return selectedSetup else: return gWebConfig.getDefaultSetup() else: return gWebConfig.getDefaultSetup()
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 }
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
def __checkSetup(setup): if setup not in gWebConfig.getSetups(): return gWebConfig.getDefaultSetup() return setup
def getSelectedSetup(): setup = request.environ['pylons.routes_dict']['dsetup'] if setup not in gWebConfig.getSetups(): return gWebConfig.getDefaultSetup() return setup
def getSelectedSetup(): setup = request.environ["pylons.routes_dict"]["dsetup"] if setup not in gWebConfig.getSetups(): return gWebConfig.getDefaultSetup() return setup