- Timestamp:
- May 9, 2008, 2:10:57 AM (16 years ago)
- Location:
- trunk/packages/sipb-xen-www/code
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-www/code/main.py
r507 r510 601 601 return templates.info(searchList=[d]) 602 602 603 def unauthFront(_, fields): 604 """Information for unauth'd users.""" 605 return templates.unauth(searchList=[{'simple' : True}]) 606 603 607 mapping = dict(list=listVms, 604 608 vnc=vnc, … … 607 611 info=info, 608 612 create=create, 609 help=helpHandler) 613 help=helpHandler, 614 unauth=unauthFront) 610 615 611 616 def printHeaders(headers): … … 618 623 def getUser(): 619 624 """Return the current user based on the SSL environment variables""" 620 username = os.environ['SSL_CLIENT_S_DN_Email'].split("@")[0] 621 return username 625 email = os.environ.get('SSL_CLIENT_S_DN_Email', None) 626 if email is None: 627 return None 628 return email.split("@")[0] 622 629 623 630 def main(operation, user, fields): … … 675 682 sys.exit(0) 676 683 684 if u is None: 685 operation = 'unauth' 686 677 687 if operation.startswith('/'): 678 688 operation = operation[1:] -
trunk/packages/sipb-xen-www/code/templates/__init__.py
r236 r510 1 __all__ = 'info command error help invalid list vnc'.split()1 __all__ = 'info command error help invalid list unauth vnc'.split() 2 2 for _name in __all__: 3 3 try:
Note: See TracChangeset
for help on using the changeset viewer.