def htmlSetups(): selectedSetup = "<strong>%s</strong>" % credentials.getSelectedSetup() availableSetups = [ (setupName, diracURL(controller="web/userdata", action="changeSetup", id=setupName)) for setupName in gWebConfig.getSetups() ] return yuiWidgets.dropDownMenu("UserSetupPos", selectedSetup, availableSetups)
def htmlUserInfo(): username = credentials.getUsername() if not username or username == "anonymous": htmlData = "Anonymous" else: selectedGroup = credentials.getSelectedGroup() availableGroups = [(groupName, diracURL(controller='web/userdata', action='changeGroup', id=groupName)) for groupName in credentials.getAvailableGroups()] htmlData = "%s@%s" % (username, yuiWidgets.dropDownMenu("UserGroupPos", selectedGroup, availableGroups)) dn = credentials.getUserDN() if dn: htmlData += " (%s)" % dn else: if 'REQUEST_URI' in request.environ: uri = str(request.environ['REQUEST_URI']) else: uri = "" htmlData += " (<a href='https://%s%s'>certificate login</a>)" % (str( request.environ['HTTP_HOST']), uri) return htmlData
def htmlSetups(): selectedSetup = "<strong>%s</strong>" % credentials.getSelectedSetup() availableSetups = [(setupName, diracURL(controller='web/userdata', action='changeSetup', id=setupName)) for setupName in gWebConfig.getSetups()] return yuiWidgets.dropDownMenu("UserSetupPos", selectedSetup, availableSetups)
def htmlUserInfo(): username = credentials.getUsername() if not username or username == "anonymous": htmlData = "Anonymous" else: selectedGroup = credentials.getSelectedGroup() availableGroups = [ ( groupName, diracURL( controller = 'web/userdata', action = 'changeGroup', id = groupName ) ) for groupName in credentials.getAvailableGroups() ] htmlData = "%s@%s" % ( username, yuiWidgets.dropDownMenu( "UserGroupPos", selectedGroup, availableGroups ) ) dn = credentials.getUserDN() if dn: htmlData += " (%s)" % dn else: if 'REQUEST_URI' in request.environ: uri = str( request.environ[ 'REQUEST_URI' ] ) else: uri = "" htmlData += " (<a href='https://%s%s'>certificate login</a>)" % ( str( request.environ[ 'HTTP_HOST' ] ), uri ) return htmlData