svn path=/trunk/packages/sipb-xen-www/; revision=867
"""Information for unauth'd users."""
return templates.unauth(searchList=[{'simple' : True}])
"""Information for unauth'd users."""
return templates.unauth(searchList=[{'simple' : True}])
-def overlord(username, state, path, fields):
+def admin(username, state, path, fields):
if path == '':
return ({'Status': '303 See Other',
if path == '':
return ({'Status': '303 See Other',
- 'Location': 'overlord/'},
"You shouldn't see this message.")
if not username in getAfsGroupMembers('system:xvm', 'athena.mit.edu'):
"You shouldn't see this message.")
if not username in getAfsGroupMembers('system:xvm', 'athena.mit.edu'):
- raise InvalidInput('username', username, 'Not an overlord.')
- newstate = State(username, overlord=True)
+ raise InvalidInput('username', username,
+ 'Not in admin group %s.' % 'system:xvm')
+ newstate = State(username, isadmin=True)
newstate.environ = state.environ
return handler(username, newstate, path, fields)
newstate.environ = state.environ
return handler(username, newstate, path, fields)
create=create,
help=helpHandler,
unauth=unauthFront,
create=create,
help=helpHandler,
unauth=unauthFront,
errortest=throwError)
def printHeaders(headers):
errortest=throwError)
def printHeaders(headers):
def haveAccess(user, state, machine):
"""Return whether a user has administrative access to a machine"""
def haveAccess(user, state, machine):
"""Return whether a user has administrative access to a machine"""
- return state.overlord or user in cache_acls.accessList(machine)
+ return state.isadmin or user in cache_acls.accessList(machine)
def owns(user, machine):
"""Return whether a user owns a machine"""
def owns(user, machine):
"""Return whether a user owns a machine"""
raise InvalidInput('memory', memory,
"Minimum %s MiB" % MIN_MEMORY_SINGLE)
max_val = maxMemory(owner, g, machine, on)
raise InvalidInput('memory', memory,
"Minimum %s MiB" % MIN_MEMORY_SINGLE)
max_val = maxMemory(owner, g, machine, on)
- if not g.overlord and memory > max_val:
+ if not g.isadmin and memory > max_val:
raise InvalidInput('memory', memory,
'Maximum %s MiB for %s' % (max_val, owner))
return memory
raise InvalidInput('memory', memory,
'Maximum %s MiB for %s' % (max_val, owner))
return memory
"""Parse and validate limits for disk for a given owner and machine."""
try:
disk = float(disk)
"""Parse and validate limits for disk for a given owner and machine."""
try:
disk = float(disk)
- if not g.overlord and disk > maxDisk(owner, machine):
+ if not g.isadmin and disk > maxDisk(owner, machine):
raise InvalidInput('disk', disk,
"Maximum %s G" % maxDisk(owner, machine))
disk = int(disk * 1024)
raise InvalidInput('disk', disk,
"Maximum %s G" % maxDisk(owner, machine))
disk = int(disk * 1024)
class State(object):
"""State for a request"""
class State(object):
"""State for a request"""
- def __init__(self, user, overlord=False):
+ def __init__(self, user, isadmin=False):
- self.overlord = overlord
return Machine.select()
else:
return Machine.query().join('acl').select_by(user=self.username)
return Machine.select()
else:
return Machine.query().join('acl').select_by(user=self.username)
RewriteEngine On
RewriteRule ^/static(.*) - [L]
RewriteEngine On
RewriteRule ^/static(.*) - [L]
- RewriteRule ^/overlord/static(.*) /static/$1 [L]
+ RewriteRule ^/admin/static(.*) /static/$1 [L]
RewriteRule ^/trac.fcgi(.*) - [L]
RewriteRule ^/trac/chrome/common(.*) /usr/share/trac/htdocs$1 [L]
RewriteRule ^/trac/login(.*) https://xvm.mit.edu/trac/login$1 [L]
RewriteRule ^/trac.fcgi(.*) - [L]
RewriteRule ^/trac/chrome/common(.*) /usr/share/trac/htdocs$1 [L]
RewriteRule ^/trac/login(.*) https://xvm.mit.edu/trac/login$1 [L]
RewriteEngine On
RewriteRule ^/favicon.ico - [L]
RewriteRule ^/static(.*) - [L]
RewriteEngine On
RewriteRule ^/favicon.ico - [L]
RewriteRule ^/static(.*) - [L]
- RewriteRule ^/overlord/static(.*) /static/$1 [L]
+ RewriteRule ^/admin/static(.*) /static/$1 [L]
RewriteRule ^/trac.fcgi(.*) - [L]
RewriteRule ^/trac/chrome/common(.*) /usr/share/trac/htdocs$1 [L]
RewriteRule ^/trac(.*) /var/www/trac/trac.fcgi$1 [L]
RewriteRule ^/trac.fcgi(.*) - [L]
RewriteRule ^/trac/chrome/common(.*) /usr/share/trac/htdocs$1 [L]
RewriteRule ^/trac(.*) /var/www/trac/trac.fcgi$1 [L]