Ignore:
Timestamp:
Sep 28, 2009, 3:04:32 AM (15 years ago)
Author:
quentin
Message:

Unauthenticated front page

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

Legend:

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

    r2415 r2484  
    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/code/main.py

    r2483 r2484  
    5353from view import View
    5454import ajaxterm
     55
     56class InvirtUnauthWeb(View):
     57    @cherrypy.expose
     58    @cherrypy.tools.mako(filename="/unauth.mako")
     59    def index(self):
     60        return {'simple': True}
    5561
    5662class InvirtWeb(View):
     
    710716    return d
    711717
    712 def unauthFront(_, _2, _3, fields):
    713     """Information for unauth'd users."""
    714     return templates.unauth(searchList=[{'simple' : True,
    715             'hostname' : socket.getfqdn()}])
    716 
    717 mapping = dict(
    718                unauth=unauthFront)
     718mapping = dict()
    719719
    720720def printHeaders(headers):
  • package_branches/invirt-web/cherrypy/code/templates/unauth.mako

    r2483 r2484  
    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.