source: WAeUP-SRP/trunk/skins/waeup_default/temporary_view_all.py @ 272

Last change on this file since 272 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
7member = context.portal_membership.getAuthenticatedMember()
8uname = str(member)
9roles = member.getRoles()
10cat = context.portal_catalog
11request = context.REQUEST
12url0 = request.get('URL0')
13#return context.temporary_view_all_form(psm=psm)
14if context.portal_membership.isAnonymousUser():
15    if not url0.endswith('chat'):
16        return context.students.student_view_all_form(psm=psm)
17    return context.Chat()
18else:
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.