source: WAeUP_SRP/trunk/skins/waeup_default/getDocumentInfo.py @ 14309

Last change on this file since 14309 was 3492, checked in by joachim, 17 years ago

fix traceback for anonymous users,
do not show log-message, when student views academic session.

File size: 950 bytes
Line 
1## Script (Python) "getDocumentInfo"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=student=None
8##title=
9##
10# $Id:getDocumentInfo.py 486 2006-09-06 10:09:39Z joachim $
11"""
12return Info about a document
13"""
14try:
15    from Products.zdb import set_trace
16except:
17    def set_trace():
18        pass
19
20request = context.REQUEST
21
22#wf = context.portal_workflow
23#path_info = request.get('PATH_INFO').split('/')
24
25# mtool = context.portal_membership
26# if mtool.isAnonymousUser():
27#     return None
28
29info = context.waeup_tool.getAccessInfo(context)
30#set_trace()
31
32student_id = info['student_id']
33# if not info['is_staff'] and student_id is None:
34#     return info
35    #return None
36
37titles = context.getStudentObjectTitles()
38info['title'] = titles.get(context.portal_type,'') or context.title_or_id
39try:
40    info['doc'] = context.getContent()
41except:
42    return None
43return info
44
Note: See TracBrowser for help on using the repository browser.