Ignore:
Timestamp:
Aug 9, 2009, 6:45:27 PM (15 years ago)
Author:
quentin
Message:

Get login information from Apache, if available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/cherrypy/code/main.py

    r2396 r2397  
    691691    return templates.error(searchList=[d])
    692692
    693 def getUser(environ):
    694     """Return the current user based on the SSL environment variables"""
    695     user = environ.get('REMOTE_USER')
    696     if user is None:
    697         return
    698    
    699     if environ.get('AUTH_TYPE') == 'Negotiate':
    700         # Convert the krb5 principal into a krb4 username
    701         if not user.endswith('@%s' % config.kerberos.realm):
    702             return
    703         else:
    704             return user.split('@')[0].replace('/', '.')
    705     else:
    706         return user
    707 
    708693def handler(username, state, path, fields):
    709694    operation, path = pathSplit(path)
Note: See TracChangeset for help on using the changeset viewer.