Changeset 629 for trunk/packages/sipb-xen-www/code/main.py
- Timestamp:
- Jun 21, 2008, 9:23:59 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-www/code/main.py
r627 r629 32 32 atexit.register(printError) 33 33 34 sys.path.append('/home/ecprice/.local/lib/python2.5/site-packages')35 36 34 import templates 37 35 from Cheetah.Template import Template … … 137 135 138 136 def parseCreate(username, state, fields): 139 kws = dict([(kw, fields.getfirst(kw)) for kw in 'name description owner memory disksize vmtype cdrom clone_from'.split()])137 kws = dict([(kw, fields.getfirst(kw)) for kw in 'name description owner memory disksize vmtype cdrom autoinstall'.split()]) 140 138 validate = validation.Validate(username, state, strict=True, **kws) 141 139 return dict(contact=username, name=validate.name, description=validate.description, memory=validate.memory, 142 140 disksize=validate.disksize, owner=validate.owner, machine_type=validate.vmtype, 143 141 cdrom=getattr(validate, 'cdrom', None), 144 clone_from=getattr(validate, 'clone_from', None))142 autoinstall=getattr(validate, 'autoinstall', None)) 145 143 146 144 def create(username, state, fields): … … 626 624 def getUser(environ): 627 625 """Return the current user based on the SSL environment variables""" 628 email = environ.get('SSL_CLIENT_S_DN_Email', None) 629 if email is None: 630 return None 631 if not email.endswith('@MIT.EDU'): 632 return None 633 return email[:-8] 626 return environ.get('REMOTE_USER', None) 634 627 635 628 class App:
Note: See TracChangeset
for help on using the changeset viewer.