Changeset 4610 for waeup/branches/ulif-layout/src
- Timestamp:
- 2 Jan 2010, 02:16:52 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-layout/src/waeup/browser/pages.py
r4609 r4610 6 6 from waeup.interfaces import IUniversity, IWAeUPObject 7 7 from waeup.widgets.interfaces import ITableProvider 8 from zope.app.security.interfaces import (IAuthentication, 9 IUnauthenticatedPrincipal, 10 ILogout) 11 from zope.component import getUtility 8 12 9 13 grok.templatedir('templates') 10 14 11 15 # 12 # Login pages...16 # Login/logout pages... 13 17 # 14 18 … … 33 37 return 34 38 self.redirect(self.camefrom) 39 return 35 40 self.flash('You entered wrong credentials!') 36 41 … … 50 55 grok.template('loginstudentpage') 51 56 title = u'Student Login' 57 58 class LogoutPage(WAeUPPage): 59 """A logout page. Calling this page will log the current user out. 60 """ 61 grok.context(IWAeUPObject) 62 grok.name('logout') 63 64 def update(self): 65 if not IUnauthenticatedPrincipal.providedBy(self.request.principal): 66 auth = getUtility(IAuthentication) 67 ILogout(auth).logout(self.request) 68 self.flash("You have been logged out. Thanks for using WAeUP SRP!") 69 self.redirect(self.url(self.context)) 52 70 53 71
Note: See TracChangeset for help on using the changeset viewer.