Changeset 2519 for package_branches


Ignore:
Timestamp:
Oct 29, 2009, 1:36:34 AM (15 years ago)
Author:
price
Message:

Replace weird username logic with the old logic.

remote_user_login() was just like the old getUser(), but different
in puzzling ways.

File:
1 edited

Legend:

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

    r2518 r2519  
    103103def require_login():
    104104    """If the user isn't logged in, raise 403 with an error."""
    105     if cherrypy.request.login is False:
     105    if not cherrypy.request.login:
    106106        raise cherrypy.HTTPError(403,
    107107            "You are not authorized to access that resource")
     
    122122    user = environ.get('REMOTE_USER')
    123123    if user is None:
     124        cherrypy.request.login = None
    124125        return
    125     else:
    126         cherrypy.request.login = None # clear what cherrypy put there
    127126
    128127    if environ.get('AUTH_TYPE') == 'Negotiate':
    129128        # Convert the krb5 principal into a krb4 username
    130129        if not user.endswith('@%s' % config.kerberos.realm):
    131             cherrypy.request.login = False # failed to login
     130            cherrypy.request.login = None
    132131        else:
    133132            cherrypy.request.login = user.split('@')[0].replace('/', '.')
Note: See TracChangeset for help on using the changeset viewer.