Changeset 2519
- Timestamp:
- Oct 29, 2009, 1:36:34 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
package_branches/invirt-web/cherrypy/code/view.py
r2518 r2519 103 103 def require_login(): 104 104 """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: 106 106 raise cherrypy.HTTPError(403, 107 107 "You are not authorized to access that resource") … … 122 122 user = environ.get('REMOTE_USER') 123 123 if user is None: 124 cherrypy.request.login = None 124 125 return 125 else:126 cherrypy.request.login = None # clear what cherrypy put there127 126 128 127 if environ.get('AUTH_TYPE') == 'Negotiate': 129 128 # Convert the krb5 principal into a krb4 username 130 129 if not user.endswith('@%s' % config.kerberos.realm): 131 cherrypy.request.login = False # failed to login130 cherrypy.request.login = None 132 131 else: 133 132 cherrypy.request.login = user.split('@')[0].replace('/', '.')
Note: See TracChangeset
for help on using the changeset viewer.