## Script (Python) "getPersonalInfo" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## # $Id: getApplicationInfo.py 1161 2006-12-31 07:50:50Z henrik $ """ return Info about the current Student """ import logging logger = logging.getLogger('Skins.getPersonalInfo') request = context.REQUEST # mtool = context.portal_membership # wf = context.portal_workflow # member = mtool.getAuthenticatedMember() # member_id = str(member) # path_info = request.get('PATH_INFO').split('/') # ##from Products.zdb import set_trace # ##set_trace() # if mtool.isAnonymousUser(): # return None # info = {} # requested_id = context.getStudentId() # if requested_id and not context.isStaff() and member_id != requested_id: # logger.info('%s tried to access personal object of %s' % (member_id,requested_id)) # student_id = requested_id # return None # elif context.isStaff(): # student_id = requested_id # else: # student_id = member_id info = context.waeup_tool.getAccessInfo(context) student_id = info['student_id'] if student_id is None: return None students_object = context.portal_url.getPortalObject().campus.students student = getattr(students_object, student_id) info['student'] = student ##res = context.portal_catalog(id = student_id) ##if res: ## info['review_state'] = res[0].review_state info['id'] = student_id info['review_state'] = context.getStudentReviewState() info['per'] = student.personal info['per_doc'] = student.personal.getContent() return info