Changeset 2016
- Timestamp:
- 07/09/08 00:55:06
- Files:
-
- trunk/cherrypy/lib/cptools.py (modified) (3 diffs)
- trunk/cherrypy/test/test_sessionauthenticate.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/cptools.py
r1980 r2016 213 213 pass 214 214 215 def login_screen(self, from_page='..', username='', error_msg='' ):215 def login_screen(self, from_page='..', username='', error_msg='', **kwargs): 216 216 return """<html><body> 217 217 Message: %(error_msg)s … … 225 225 'error_msg': error_msg} 226 226 227 def do_login(self, username, password, from_page='..' ):227 def do_login(self, username, password, from_page='..', **kwargs): 228 228 """Login. May raise redirect, or return True if request handled.""" 229 229 error_msg = self.check_username_and_password(username, password) … … 240 240 raise cherrypy.HTTPRedirect(from_page or "/") 241 241 242 def do_logout(self, from_page='..' ):242 def do_logout(self, from_page='..', **kwargs): 243 243 """Logout. May raise redirect, or return True if request handled.""" 244 244 sess = cherrypy.session trunk/cherrypy/test/test_sessionauthenticate.py
r1614 r2016 11 11 return u'Wrong login/password' 12 12 13 def augment_params(): 14 # A simple tool to add some things to request.params 15 # This is to check to make sure that session_auth can handle request 16 # params (ticket #780) 17 cherrypy.request.params["test"] = "test" 18 19 cherrypy.tools.augment_params = cherrypy.Tool('before_handler', 20 augment_params, None, priority=30) 21 13 22 class Test: 14 23 … … 16 25 'tools.session_auth.on': True, 17 26 'tools.session_auth.check_username_and_password': check, 27 'tools.augment_params.on': True, 18 28 } 19 29 20 def index(self ):30 def index(self, **kwargs): 21 31 return "Hi %s, you are logged in" % cherrypy.request.login 22 32 index.exposed = True

