Changeset 6686 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 6 Sep 2011, 08:15:39 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/browser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r6612 r6686 40 40 from waeup.sirp.users import LocalRoleSetEvent 41 41 from waeup.sirp.widgets.restwidget import ReSTDisplayWidget 42 from waeup.sirp.authentication import get_principal_role_manager 42 43 43 44 … … 102 103 camefrom = None 103 104 105 def isStudent(self): 106 prm = get_principal_role_manager() 107 roles = [x[0] for x in prm.getRolesForPrincipal(self.request.principal.id)] 108 return 'waeup.Student' in roles 109 104 110 def update(self, SUBMIT=None, camefrom=None): 105 111 self.camefrom = camefrom … … 107 113 if self.request.principal.id != 'zope.anybody': 108 114 self.flash('You logged in.') 115 if self.isStudent(): 116 rel_link = '/students/%s' % self.request.principal.id 117 self.redirect(self.application_url() + rel_link) 118 return 109 119 if not self.camefrom: 110 120 # User might have entered the URL directly. Let's beam … … 116 126 self.flash('You entered wrong credentials.') 117 127 118 class LoginStaffPage(LoginPage):119 """A login page for staff members.120 """121 grok.name('loginstaff')122 grok.template('loginstaffpage')123 grok.require('waeup.Public')124 title = u'Staff Login'125 126 class LoginStudentPage(LoginPage):127 """A login page for students.128 """129 grok.name('loginstudent')130 grok.template('loginstudentpage')131 grok.require('waeup.Public')132 title = u'Student Login'133 128 134 129 class LogoutPage(WAeUPPage): -
main/waeup.sirp/trunk/src/waeup/sirp/browser/tests/test_permissions.py
r6658 r6686 64 64 public_pages = [ 65 65 # Pages accessible also by the public... 66 '/@@index', '/@@login', '/@@loginstaff', '/@@loginstudent','/@@logout',66 '/@@index', '/@@login', '/@@logout', 67 67 ] 68 68
Note: See TracChangeset for help on using the changeset viewer.