Last change
on this file since 282 was
197,
checked in by joachim, 19 years ago
|
=creating the WAeUP Tool
|
-
Property svn:keywords set to
Id
|
File size:
940 bytes
|
Line | |
---|
1 | ##parameters=psm=None |
---|
2 | # $Id: temporary_view_all.py 197 2006-02-08 12:47:31Z joachim $ |
---|
3 | |
---|
4 | """ |
---|
5 | """ |
---|
6 | |
---|
7 | member = context.portal_membership.getAuthenticatedMember() |
---|
8 | uname = str(member) |
---|
9 | roles = member.getRoles() |
---|
10 | cat = context.portal_catalog |
---|
11 | request = context.REQUEST |
---|
12 | url0 = request.get('URL0') |
---|
13 | #return context.temporary_view_all_form(psm=psm) |
---|
14 | if context.portal_membership.isAnonymousUser(): |
---|
15 | if not url0.endswith('chat'): |
---|
16 | return context.students.student_view_all_form(psm=psm) |
---|
17 | return context.Chat() |
---|
18 | else: |
---|
19 | if url0.find(uname) > 0 or 'UniversityManager' in roles or 'Manager' in roles: |
---|
20 | return context.temporary_view_all_form(psm=psm) |
---|
21 | elif 'Student' in roles and 'StudentManager' not in roles: |
---|
22 | res = cat(pathindex="/portal/sections/students/%s" % uname) |
---|
23 | for r in res: |
---|
24 | if r.getPath().endswith("students/%s" % uname): |
---|
25 | return r.getObject().student_view_student_form(psm=psm) |
---|
26 | return context.students.student_view_all_form(psm=psm) |
---|
Note: See
TracBrowser for help on using the repository browser.