Changeset 2692 for package_branches


Ignore:
Timestamp:
Dec 20, 2009, 9:45:47 PM (14 years ago)
Author:
broder
Message:

Unauthenticated front page

Location:
package_branches/invirt-web/cherrypy-rebased/code
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/cherrypy-rebased/code/main.fcgi

    r2681 r2692  
    55import os
    66import sys
    7 from main import InvirtWeb
     7from main import InvirtWeb, InvirtUnauthWeb
    88
    99dev = False
     
    2626         })
    2727    app.merge(conf_file)
     28    unauthApp = cherrypy.tree.mount(InvirtUnauthWeb(),
     29                                    '/unauth',
     30                                    {'/': {'tools.invirtwebstate.on': True}})
     31    unauthApp.merge(conf_file)
    2832    cherrypy.config.update(conf_file)
    2933
     
    3539        cherrypy.engine.start(blocking=False)
    3640        from flup.server.fcgi import WSGIServer
    37         server = WSGIServer(app)
     41        server = WSGIServer(cherrypy.tree)
    3842        server.run()
  • package_branches/invirt-web/cherrypy-rebased/code/main.py

    r2691 r2692  
    4747
    4848from view import View
     49
     50class InvirtUnauthWeb(View):
     51    @cherrypy.expose
     52    @cherrypy.tools.mako(filename="/unauth.mako")
     53    def index(self):
     54        return {'simple': True}
    4955
    5056class InvirtWeb(View):
     
    655661    return d
    656662
    657 def unauthFront(_, _2, _3, fields):
    658     """Information for unauth'd users."""
    659     return templates.unauth(searchList=[{'simple' : True,
    660             'hostname' : socket.getfqdn()}])
    661 
    662 mapping = dict(
    663                unauth=unauthFront)
     663mapping = dict()
    664664
    665665def printHeaders(headers):
  • package_branches/invirt-web/cherrypy-rebased/code/templates/unauth.mako

    r2691 r2692  
    1 #from skeleton import skeleton
    2 #extends skeleton
     1<%page expression_filter="h"/>
     2<%inherit file="skeleton.mako" />
    33
     4<%def name="title()">
     5Intro
     6</%def>
    47
    5 #def title
    6 Intro
    7 #end def
    8 
    9 #def body
    108<h1>XVM &mdash; Virtual Servers for MIT </h1>
    119
     
    1917<p>MIT users:</p>
    2018<blockquote><big><a
    21 href="https://$hostname/"><strong><font color="green">&rarr;</font> Log in to XVM now</strong>
     19href="https://${config.web.hostname}/"><strong><font color="green">&rarr;</font> Log in to XVM now</strong>
    2220</a></big></blockquote>
    2321<p>You'll need an <a href="http://ca.mit.edu/">MIT personal
     
    5755<p>Questions and feedback welcome at <a
    5856href="mailto:xvm@mit.edu">xvm@mit.edu</a>.</p>
    59 
    60 #end def
Note: See TracChangeset for help on using the changeset viewer.