Index: /package_branches/invirt-web/cherrypy/code/main.py
===================================================================
--- /package_branches/invirt-web/cherrypy/code/main.py	(revision 2481)
+++ /package_branches/invirt-web/cherrypy/code/main.py	(revision 2482)
@@ -62,4 +62,13 @@
                                                  'from invirt import database']
 
+    def __getattr__(self, name):
+        if name in ("admin", "overlord"):
+            if not cherrypy.request.login in getAfsGroupMembers(config.adminacl, config.authz[0].cell):
+                raise InvalidInput('username', cherrypy.request.login,
+                                   'Not in admin group %s.' % config.adminacl)
+            cherrypy.request.state = State(cherrypy.request.login, isadmin=True)
+            return self
+        else:
+            return super(InvirtWeb, self).__getattr__(name)
 
     @cherrypy.expose
@@ -701,21 +710,7 @@
             'hostname' : socket.getfqdn()}])
 
-def admin(username, state, path, fields):
-    if path == '':
-        return ({'Status': '303 See Other',
-                 'Location': 'admin/'},
-                "You shouldn't see this message.")
-    if not username in getAfsGroupMembers(config.adminacl, 'athena.mit.edu'):
-        raise InvalidInput('username', username,
-                           'Not in admin group %s.' % config.adminacl)
-    newstate = State(username, isadmin=True)
-    newstate.environ = state.environ
-    return handler(username, newstate, path, fields)
-
 mapping = dict(
                modify=modify,
-               unauth=unauthFront,
-               admin=admin,
-               overlord=admin)
+               unauth=unauthFront)
 
 def printHeaders(headers):
Index: /package_branches/invirt-web/cherrypy/code/templates/skeleton.mako
===================================================================
--- /package_branches/invirt-web/cherrypy/code/templates/skeleton.mako	(revision 2481)
+++ /package_branches/invirt-web/cherrypy/code/templates/skeleton.mako	(revision 2482)
@@ -6,9 +6,9 @@
 <html>
 <head><title>${self.title()} &mdash; XVM</title>
-  <base href="${cherrypy.request.base}" />
-  <link href="static/favicon.ico" type="image/x-icon" rel="shortcut icon">
-  <link rel="stylesheet" href="static/style.css" type="text/css" />
-  <link rel="stylesheet" href="static/layout.css" type="text/css" media="screen" />
-  <script type="text/javascript" src="static/prototype.js"></script>
+  <base href="${cherrypy.request.base}${"/admin/" if cherrypy.request.state.isadmin else ""}" />
+  <link href="/static/favicon.ico" type="image/x-icon" rel="shortcut icon">
+  <link rel="stylesheet" href="/static/style.css" type="text/css" />
+  <link rel="stylesheet" href="/static/layout.css" type="text/css" media="screen" />
+  <script type="text/javascript" src="/static/prototype.js"></script>
   <script type="text/javascript">
 var helpWin = null;
@@ -50,5 +50,9 @@
 % if not simple:
 % if cherrypy.request.login:
-<p class="loggedin">Welcome, <span class="name">${cherrypy.request.login}</span>.</p>
+<p class="loggedin">Welcome, <span class="name">${cherrypy.request.login}</span>.
+% if cherrypy.request.state.isadmin:
+You are currently authenticated as an administrator.
+% endif
+</p>
 % endif
 
Index: /package_branches/invirt-web/cherrypy/code/view.py
===================================================================
--- /package_branches/invirt-web/cherrypy/code/view.py	(revision 2481)
+++ /package_branches/invirt-web/cherrypy/code/view.py	(revision 2482)
@@ -113,5 +113,6 @@
 def invirtwebstate_init():
     """Initialize the cherrypy.request.state object from Invirt"""
-    cherrypy.request.state = State(cherrypy.request.login)
+    if not hasattr(cherrypy.request, "state"):
+        cherrypy.request.state = State(cherrypy.request.login)
 
 cherrypy.tools.invirtwebstate = cherrypy.Tool('on_start_resource', invirtwebstate_init, priority=100)
