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

« back to all changes in this revision

Viewing changes to ivle/dispatch/request.py

  • Committer: Matt Giuca
  • Date: 2009-01-19 08:14:25 UTC
  • mfrom: (1084)
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: matt.giuca@gmail.com-20090119081425-h1jmx8o141bqnwl8
Merged changes from trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
267
267
            # This includes binary strings.
268
268
            self.apache_req.write(string, flush)
269
269
 
 
270
    def logout(self):
 
271
        """Log out the current user by destroying the session state.
 
272
        Then redirect to the top-level IVLE page."""
 
273
        # List of cookies that IVLE uses (to be removed at logout)
 
274
        ivle_cookies = ["ivleforumcookie", "clipboard"]
 
275
        
 
276
        if hasattr(self, 'session'):
 
277
            self.session.invalidate()
 
278
            self.session.delete()
 
279
            # Invalidates all IVLE cookies
 
280
            all_cookies = Cookie.get_cookies(self)
 
281
            for cookie in all_cookies:
 
282
                if cookie in ivle_cookies:
 
283
                    self.add_cookie(Cookie.Cookie(cookie,'',expires=1,path='/'))
 
284
        self.throw_redirect(ivle.util.make_path('')) 
 
285
 
 
286
 
270
287
    def flush(self):
271
288
        """Flushes the output buffer."""
272
289
        self.apache_req.flush()