- Timestamp:
- 21 Apr 2008, 16:31:47 (17 years ago)
- Location:
- WAeUP_SRP/base/skins/waeup_student
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_student/getMemberInfo.py
r3456 r3458 21 21 member_id = str(member) 22 22 path_info = request.get('PATH_INFO').split('/') 23 if mtool.isAnonymousUser(): 23 # if mtool.isAnonymousUser(): 24 # return None 25 # info = {} 26 # requested_id = context.getStudentId() 27 # if requested_id and not context.isStaff() and member_id != requested_id: 28 # logger.info('%s tried to access personal object of %s' % (member_id,requested_id)) 29 # student_id = requested_id 30 # return None 31 # elif context.isStaff(): 32 # student_id = requested_id 33 # else: 34 # student_id = member_id 35 36 info = context.waeup_tool.getAccessInfo(context) 37 student_id = info['student_id'] 38 if student_id is None: 24 39 return None 25 info = {}26 requested_id = context.getStudentId()27 if requested_id and not context.isStaff() and member_id != requested_id:28 logger.info('%s tried to access personal object of %s' % (member_id,requested_id))29 student_id = requested_id30 return None31 elif context.isStaff():32 student_id = requested_id33 else:34 student_id = member_id35 36 40 37 41 students_object = context.portal_url.getPortalObject().campus.students 38 42 student = getattr(students_object, student_id) 39 43 40 if hasattr(student,"application") and hasattr(student,"personal") and hasattr(student,"clearance"): 41 info['student'] = student 42 info['id'] = student_id 43 info['review_state'] = context.getStudentReviewState() 44 info['per'] = getattr(student,'personal',None) 45 info['app'] = student.application 46 per_doc = info['per_doc'] = student.personal.getContent() 47 info['app_doc'] = student.application.getContent() 48 info['clear_doc'] = student.clearance.getContent() 49 info['password'] = context.waeup_tool.getCredential(student_id) 50 info['student_name'] = "%s %s %s" % (per_doc.firstname,per_doc.middlename,per_doc.lastname) 51 52 # if info['per_doc'].email: 53 # info['email'] = info['per_doc'].email 54 # else: 55 # info['email'] = info['app_doc'].app_email 56 57 if info['app_doc'].app_email: 58 info['email'] = info['app_doc'].app_email 59 else: 60 info['email'] = info['per_doc'].email 61 62 msg=""" 44 complete_msg=""" 63 45 Your SRP Member Details 64 46 ----------------------- 65 47 66 Fullname: % s67 Student Id: % s68 Matriculation Number: % s69 Registration Number: % s70 Registration Status: % s71 Email Address in Application Data: % s72 Email Address in Personal Data: % s73 Date of Birth: % s74 Password: '% s'48 Fullname: %(student_name)s 49 Student Id: %(id)s 50 Matriculation Number: %(matric_no)s 51 Registration Number: %(jamb_reg_no)s 52 Registration Status: %(review_state)s 53 Email Address in Application Data: %(app_email)s 54 Email Address in Personal Data: %(per_email)s 55 Date of Birth: %(birthday)s 56 Password: '%(password)s' 75 57 76 58 """ 59 short_msg=""" 60 Your SRP Member Details 61 ----------------------- 77 62 78 info['message'] = msg % ( 79 info['student_name'], 80 student_id, 81 info['clear_doc'].matric_no, 82 info['app_doc'].jamb_reg_no, 83 info['review_state'], 84 info['app_doc'].app_email, 85 info['per_doc'].email, 86 info['clear_doc'].birthday, 87 info['password'] 88 ) 63 Fullname: %(student_name)s 64 Student Id: %(id)s 65 Password: %(password)s 66 67 """ 68 student_record = context.students_catalog.getRecordByKey(student_id) 69 if hasattr(student,"application") and hasattr(student,"personal") and hasattr(student,"clearance"): 70 #info['student'] = student 71 info['id'] = student_id 72 info['review_state'] = student_record.review_state 73 #info['per'] = getattr(student,'personal',None) 74 #per_doc = info['per_doc'] = student.personal.getContent() 75 #info['app_doc'] = student.application.getContent() 76 info['jamb_reg_no'] = student_record.jamb_reg_no 77 #info['clear_doc'] = student.clearance.getContent() 78 info['matric_no'] = student_record.matric_no 79 info['password'] = context.waeup_tool.getCredential(student_id) 80 info['student_name'] = student_record.name 81 info['birthday'] = student.clearance.getContent().birthday 82 app_email = info['app_email'] = student.application.getContent().app_email 83 per_email = info['per_email'] = student_record.email 84 if app_email: 85 info['email'] = app_email 86 else: 87 info['email'] = per_email 88 info['message'] = complete_msg % info 89 info['with_email'] = bool(info['email']) 89 90 else: 90 91 info['student'] = student 91 info['student_name'] = 'N/A' 92 92 info['id'] = student_id 93 93 info['review_state'] = wf.getInfoFor(student,'review_state',None) 94 94 info['password'] = context.waeup_tool.getCredential(student_id) 95 95 info['email'] = 'N/A' 96 97 msg=""" 98 Your SRP Member Details 99 ----------------------- 100 101 Fullname: %s 102 Student Id: %s 103 Password: %s 104 105 """ 106 107 info['message'] = msg % ( 108 'N/A', 109 student_id, 110 info['password'] 111 ) 112 113 114 115 116 96 info['message'] = short_msg % info 97 info['with_email'] = False 117 98 return info -
WAeUP_SRP/base/skins/waeup_student/mail_password_form.pt
r2059 r3458 27 27 </td> 28 28 <td> 29 <span tal:condition="info/student/Title" tal:content="info/student/Title" /> 30 <span tal:condition="not:info/student/Title">N/A</span> 29 <span tal:replace="info/student_name"></span> 31 30 </td> 32 31 </tr> … … 61 60 </td> 62 61 </tr> 63 <tr tal:condition=" python: info['email'] and info['email']!='N/A'">62 <tr tal:condition="info/with_email"> 64 63 <td> </td> 65 64 <td><input name="Submit" type="submit" class="standalone" value="Submit" /><br /><br /></td> 66 65 </tr> 67 66 68 <tr tal:condition="not:info/ email">67 <tr tal:condition="not:info/with_email"> 69 68 <td> </td> 70 69 <td><strong tal:condition="not:info/email">
Note: See TracChangeset for help on using the changeset viewer.