Changeset 867 for trunk/packages


Ignore:
Timestamp:
Aug 4, 2008, 11:20:25 PM (16 years ago)
Author:
price
Message:

rename overlord -> admin mode

Location:
trunk/packages/sipb-xen-www
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-www/code/main.py

    r866 r867  
    596596    return templates.unauth(searchList=[{'simple' : True}])
    597597
    598 def overlord(username, state, path, fields):
     598def admin(username, state, path, fields):
    599599    if path == '':
    600600        return ({'Status': '303 See Other',
    601                  'Location': 'overlord/'},
     601                 'Location': 'admin/'},
    602602                "You shouldn't see this message.")
    603603    if not username in getAfsGroupMembers('system:xvm', 'athena.mit.edu'):
    604         raise InvalidInput('username', username, 'Not an overlord.')
    605     newstate = State(username, overlord=True)
     604        raise InvalidInput('username', username,
     605                           'Not in admin group %s.' % 'system:xvm')
     606    newstate = State(username, isadmin=True)
    606607    newstate.environ = state.environ
    607608    return handler(username, newstate, path, fields)
     
    619620               help=helpHandler,
    620621               unauth=unauthFront,
    621                overlord=overlord,
     622               admin=admin,
    622623               errortest=throwError)
    623624
  • trunk/packages/sipb-xen-www/code/validation.py

    r865 r867  
    126126def haveAccess(user, state, machine):
    127127    """Return whether a user has administrative access to a machine"""
    128     return state.overlord or user in cache_acls.accessList(machine)
     128    return state.isadmin or user in cache_acls.accessList(machine)
    129129
    130130def owns(user, machine):
     
    158158                           "Minimum %s MiB" % MIN_MEMORY_SINGLE)
    159159    max_val = maxMemory(owner, g, machine, on)
    160     if not g.overlord and memory > max_val:
     160    if not g.isadmin and memory > max_val:
    161161        raise InvalidInput('memory', memory,
    162162                           'Maximum %s MiB for %s' % (max_val, owner))
     
    167167    try:
    168168        disk = float(disk)
    169         if not g.overlord and disk > maxDisk(owner, machine):
     169        if not g.isadmin and disk > maxDisk(owner, machine):
    170170            raise InvalidInput('disk', disk,
    171171                               "Maximum %s G" % maxDisk(owner, machine))
  • trunk/packages/sipb-xen-www/code/webcommon.py

    r864 r867  
    3939class State(object):
    4040    """State for a request"""
    41     def __init__(self, user, overlord=False):
     41    def __init__(self, user, isadmin=False):
    4242        self.username = user
    43         self.overlord = overlord
     43        self.isadmin = isadmin
    4444
    4545    def getMachines(self):
    46         if self.overlord:
     46        if self.isadmin:
    4747            return Machine.select()
    4848        else:
  • trunk/packages/sipb-xen-www/files/etc/apache2/sites-available/default

    r848 r867  
    1313        RewriteEngine On
    1414        RewriteRule ^/static(.*) - [L]
    15         RewriteRule ^/overlord/static(.*) /static/$1 [L]
     15        RewriteRule ^/admin/static(.*) /static/$1 [L]
    1616        RewriteRule ^/trac.fcgi(.*) - [L]
    1717        RewriteRule ^/trac/chrome/common(.*) /usr/share/trac/htdocs$1 [L]
  • trunk/packages/sipb-xen-www/files/etc/apache2/sites-available/ssl

    r848 r867  
    2020        RewriteRule ^/favicon.ico - [L]
    2121        RewriteRule ^/static(.*) - [L]
    22         RewriteRule ^/overlord/static(.*) /static/$1 [L]
     22        RewriteRule ^/admin/static(.*) /static/$1 [L]
    2323        RewriteRule ^/trac.fcgi(.*) - [L]
    2424        RewriteRule ^/trac/chrome/common(.*) /usr/share/trac/htdocs$1 [L]
Note: See TracChangeset for help on using the changeset viewer.