Changeset 2700 for package_branches


Ignore:
Timestamp:
Dec 20, 2009, 9:46:18 PM (15 years ago)
Author:
broder
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-rebased/code/view.py

    r2699 r2700  
    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.