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

« back to all changes in this revision

Viewing changes to www/dispatch/request.py

  • Committer: mattgiuca
  • Date: 2008-07-15 09:18:02 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:877
pulldown_subj/__init__.py: Added "enrol_user" function which pulls down a user
    and also enrols them in the database.
Added script enrolallusers.py which scriptulously performs automatic
enrolments of all users in the system, similar to remakeallusers.

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
31
30
 
32
31
class Request:
33
32
    """An IVLE request object. This is presented to the IVLE apps as a way of
185
184
        # Split the given path into the app (top-level dir) and sub-path
186
185
        # (after first stripping away the root directory)
187
186
        path = common.util.unmake_path(req.uri)
188
 
        (self.app, self.path) = (common.util.split_path(path))
 
187
        if self.publicmode:
 
188
            self.app = None
 
189
            (_, self.path) = (common.util.split_path(path))
 
190
        else:
 
191
            (self.app, self.path) = (common.util.split_path(path))
189
192
        self.user = None
190
193
        self.hostname = req.hostname
191
194
        self.headers_in = req.headers_in
206
209
        """Writes out the HTTP and HTML headers before any real data is
207
210
        written."""
208
211
        self.headers_written = True
209
 
        
210
 
        # app is the App object for the chosen app
211
 
        try:
212
 
            app = conf.apps.app_url[self.app]
213
 
        except KeyError:
214
 
            app = None
215
 
 
216
 
        # Write any final modifications to header content
217
 
        if app and app.useconsole and self.user:
218
 
            plugins.console.insert_scripts_styles(self.scripts, self.styles, \
219
 
                self.scripts_init)
220
 
 
221
212
        # Prepare the HTTP and HTML headers before the first write is made
222
213
        if self.content_type != None:
223
214
            self.apache_req.content_type = self.content_type