From e1fa27cf2da93f2a5bc18aa7a0c8169e4454368e Mon Sep 17 00:00:00 2001 From: Quentin Smith Date: Sun, 31 Jan 2010 23:45:01 -0500 Subject: [PATCH] Work around quirk of CherryPy dispatching that causes username munging to not happen by the time dispatching happens svn path=/trunk/packages/invirt-web/; revision=2979 --- code/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/main.py b/code/main.py index 7044167..0b8af46 100755 --- a/code/main.py +++ b/code/main.py @@ -97,6 +97,9 @@ class InvirtWeb(View): return d def __getattr__(self, name): + # At the point __getattr__ is called, tools haven't been run. Make sure the user is logged in. + cherrypy.tools.remote_user_login.callable() + if name in ("admin", "overlord"): if not cherrypy.request.login in getAfsGroupMembers(config.adminacl, config.authz.afs.cells[0].cell): raise InvalidInput('username', cherrypy.request.login, -- 1.7.9.5