Changeset 1077
- Timestamp:
- 18 Dec 2006, 19:44:57 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_default/isSectionOfficer.py
r911 r1077 10 10 # $Id: isManager.py 888 2006-11-17 21:28:48Z henrik $ 11 11 12 if context.isStudent(): 13 return False 12 14 mtool = context.portal_membership 13 15 roles = mtool.getAuthenticatedMember().getRolesInContext(context) 14 return "SectionManager" in roles or\ 15 "Manager" in roles or\ 16 "SectionOfficer" in roles 16 return "SectionOfficer" in roles or\ 17 "SectionManager" in roles or\ 18 "Manager" in roles 19 -
WAeUP_SRP/trunk/skins/waeup_default/isStaff.py
r911 r1077 10 10 # $Id: $ 11 11 12 if context.portal_membership.isAnonymousUser(): 13 return False 14 return not context.isStudent() 15 12 16 mtool = context.portal_membership 13 17 member = mtool.getAuthenticatedMember() -
WAeUP_SRP/trunk/skins/waeup_default/isStudent.py
r1042 r1077 10 10 # $Id$ 11 11 12 #session = context.REQUEST.SESSION 13 #roles = member.getRolesInContext(context) 14 #return "Student" in roles 15 16 mtool = context.portal_membership 17 member = mtool.getAuthenticatedMember() 18 member_id = str(member) 19 if len(member_id) == 7: 20 try: 21 int(member_id[1:]) 22 return True 23 except: 24 return False 12 member_id = str(context.portal_membership.getAuthenticatedMember()) 13 if len(member_id) != 7: 14 return False 15 try: 16 int(member_id[1:]) 17 return True 18 except: 19 return False -
WAeUP_SRP/trunk/skins/waeup_student/getStudentName.py
r1071 r1077 12 12 return Info about the current Student 13 13 """ 14 import logging15 logger = logging.getLogger('getApplicationInfo')16 17 request = context.REQUEST18 14 mtool = context.portal_membership 19 wf = context.portal_workflow20 15 member = mtool.getAuthenticatedMember() 21 member_id = str(member)22 path_info = request.get('PATH_INFO').split('/')23 24 16 if mtool.isAnonymousUser(): 25 17 return None 26 27 18 info = {} 28 19 #from Products.zdb import set_trace 29 20 #set_trace() 30 student_id = context.getStudentId() 31 if not student_id: 21 if context.isStaff(): 22 return member.getProperty('fullname',None) 23 if not context.isStudent(): 32 24 return None 33 res = context.students_catalog(id = st udent_id)25 res = context.students_catalog(id = str(member)) 34 26 if len(res) != 1: 35 27 return None -
WAeUP_SRP/trunk/skins/waeup_student/getStudentWorkflowInfo.py
r1072 r1077 12 12 return Info about the current Student 13 13 """ 14 import logging15 logger = logging.getLogger('getApplicationInfo')16 17 request = context.REQUEST18 14 mtool = context.portal_membership 19 15 wf = context.portal_workflow 20 16 member = mtool.getAuthenticatedMember() 21 17 member_id = str(member) 22 path_info = request.get('PATH_INFO').split('/')23 24 18 if mtool.isAnonymousUser(): 25 19 return None 26 20 info = {} 27 #from Products.zdb import set_trace 28 #set_trace() 29 requested_id = context.getStudentId() 30 if member_id != requested_id: 31 logger.info('"%s", "tried to access", "%s"' % (member_id,requested_id)) 21 if not context.isStudent(): 32 22 return None 33 23 student_id = member_id 34 35 36 24 students_object = context.portal_url.getPortalObject().campus.students 37 25 student = getattr(students_object, student_id) -
WAeUP_SRP/trunk/skins/waeup_student/raise_objection.py
r1001 r1077 13 13 """ 14 14 import DateTime 15 import logging 16 logger = logging.getLogger('raise_objection') 17 18 wf = context.portal_workflow 19 info = context.getStudentInfo() 20 if not info: 21 logger.info('"%s", "tried to access", "%s"' % (context.portal_membership.getAuthenticatedMember(),requested_id)) 22 return context.admission_form() 15 23 current = DateTime.DateTime() 16 request = context.REQUEST17 wf = context.portal_workflow18 mtool = context.portal_membership19 member = mtool.getAuthenticatedMember()20 roles = member.getRoles()21 22 info = context.getStudentInfo()23 24 24 info['app_doc'].edit(mapping={'objection_date':current,}) 25 25 if info['review_state'] == "admitted":
Note: See TracChangeset for help on using the changeset viewer.