~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/dispatch/__init__.py

  • Committer: dcoles
  • Date: 2008-07-16 00:44:14 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:882
Console: To fix bug [ 2018542 ] 'Console shown regardless of login status'
Moved out of html (really not related) and into __init__ for appending some 
stuff to the footer and request for writing the css styles. A bit nasty across 
two modules, but at least they're in one package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
import login
45
45
from common import (util, forumutil)
46
46
import traceback
 
47
import plugins.console
47
48
 
48
49
def handler(req):
49
50
    """Handles a request which may be to anywhere in the site except media.
145
146
 
146
147
    # When done, write out the HTML footer if the app has requested it
147
148
    if req.write_html_head_foot:
 
149
        # Show the console if required
 
150
        if logged_in and app.useconsole:
 
151
            req.write('<!-- USE CONSOLE!!! -->\n')
 
152
            plugins.console.present(req, windowpane=True)
148
153
        html.write_html_foot(req)
149
154
 
150
155
    # Note: Apache will not write custom HTML error messages here.