Ignore:
Timestamp:
May 9, 2008, 2:10:57 AM (17 years ago)
Author:
price
Message:

front page for non-MIT users (and other unath'd)

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  
    601601    return templates.info(searchList=[d])
    602602
     603def unauthFront(_, fields):
     604    """Information for unauth'd users."""
     605    return templates.unauth(searchList=[{'simple' : True}])
     606
    603607mapping = dict(list=listVms,
    604608               vnc=vnc,
     
    607611               info=info,
    608612               create=create,
    609                help=helpHandler)
     613               help=helpHandler,
     614               unauth=unauthFront)
    610615
    611616def printHeaders(headers):
     
    618623def getUser():
    619624    """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]
    622629
    623630def main(operation, user, fields):
     
    675682        sys.exit(0)
    676683
     684    if u is None:
     685        operation = 'unauth'
     686
    677687    if operation.startswith('/'):
    678688        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()
    22for _name in __all__:
    33    try:
Note: See TracChangeset for help on using the changeset viewer.