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

« back to all changes in this revision

Viewing changes to www/dispatch/request.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:
27
27
import mod_python
28
28
from mod_python import (util, Session, Cookie)
29
29
import conf
 
30
import plugins.console
30
31
 
31
32
class Request:
32
33
    """An IVLE request object. This is presented to the IVLE apps as a way of
209
210
        """Writes out the HTTP and HTML headers before any real data is
210
211
        written."""
211
212
        self.headers_written = True
 
213
        
 
214
        # app is the App object for the chosen app
 
215
        if self.app is None:
 
216
            app = conf.apps.app_url[conf.apps.default_app]
 
217
        else:
 
218
            app = conf.apps.app_url[self.app]
 
219
 
 
220
        # Write any final modifications to header content
 
221
        if app.useconsole and self.user:
 
222
            plugins.console.insert_scripts_styles(self.scripts, self.styles, \
 
223
                self.scripts_init)
 
224
 
212
225
        # Prepare the HTTP and HTML headers before the first write is made
213
226
        if self.content_type != None:
214
227
            self.apache_req.content_type = self.content_type