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

« back to all changes in this revision

Viewing changes to www/dispatch/__init__.py

  • Committer: stevenbird
  • Date: 2008-02-01 03:51:56 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:368
First version of a DTD for XML problem files

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
            # TODO: Nicer 404 message?
60
60
            req.throw_error(Request.HTTP_NOT_FOUND)
61
61
 
 
62
    # Special handling for public mode - just call public app and get out
 
63
    # NOTE: This will not behave correctly if the public app uses
 
64
    # write_html_head_foot, but "serve" does not.
 
65
    if req.publicmode:
 
66
        app = conf.apps.app_url[conf.apps.public_app]
 
67
        apps.call_app(app.dir, req)
 
68
        return req.OK
 
69
 
62
70
    # app is the App object for the chosen app
63
71
    if req.app is None:
64
 
        app = conf.apps.app_url[conf.default_app]
 
72
        app = conf.apps.app_url[conf.apps.default_app]
65
73
    else:
66
74
        app = conf.apps.app_url[req.app]
67
75
 
74
82
        logged_in = True
75
83
 
76
84
    if logged_in:
 
85
        # Keep the user's session alive by writing to the session object.
 
86
        req.get_session().save()
77
87
        # If user did not specify an app, HTTP redirect to default app and
78
88
        # exit.
79
89
        if req.app is None:
80
 
            req.throw_redirect(util.make_path(conf.default_app))
 
90
            req.throw_redirect(util.make_path(conf.apps.default_app))
81
91
 
82
92
        # Set the default title to the app's tab name, if any. Otherwise URL
83
93
        # name.