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

« back to all changes in this revision

Viewing changes to ivle/dispatch/request.py

  • Committer: me at id
  • Date: 2009-01-14 23:21:43 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1140
ivle.conf, ivle.dispatch: Redo some of Nick's changes made between the
    creation of the 'setup-refactor' branch and its merging into trunk.

svn merge support is absolutely awful and decided to clobber those
    changes without bothering to tell anybody. Thankyou Subversion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
253
253
            # This includes binary strings.
254
254
            self.apache_req.write(string, flush)
255
255
 
 
256
    def logout(self):
 
257
        """Log out the current user by destroying the session state.
 
258
        Then redirect to the top-level IVLE page."""
 
259
        # List of cookies that IVLE uses (to be removed at logout)
 
260
        ivle_cookies = ["ivleforumcookie", "clipboard"]
 
261
        
 
262
        if hasattr(self, 'session'):
 
263
            self.session.invalidate()
 
264
            self.session.delete()
 
265
            # Invalidates all IVLE cookies
 
266
            all_cookies = Cookie.get_cookies(self)
 
267
            for cookie in all_cookies:
 
268
                if cookie in ivle_cookies:
 
269
                    self.add_cookie(Cookie.Cookie(cookie,'',expires=1,path='/'))
 
270
        self.throw_redirect(common.util.make_path('')) 
 
271
 
 
272
 
256
273
    def flush(self):
257
274
        """Flushes the output buffer."""
258
275
        self.apache_req.flush()