Changeset 999 for WAeUP_SRP/trunk/skins/waeup_custom
- Timestamp:
- 6 Dec 2006, 10:46:32 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py
r998 r999 45 45 member = mtool.getAuthenticatedMember() 46 46 47 if True or not redirect_url or redirect_url.endswith('/logged_out'): 48 if not is_anon: 49 if "Student" in member.getRoles(): 50 to_waeup_student_home = True 51 #info = context.getStudentInfo() 52 #student = info['student'] 53 students = context.portal_url.getPortalObject().campus.students 54 student = getattr(students,str(member)) 55 student_app = getattr(student,'application') 56 student_pume = getattr(student,'pume',None) 57 s_review_state = wftool.getInfoFor(student,'review_state',None) 58 a_review_state = wftool.getInfoFor(student_app,'review_state',None) 59 #if info['review_state'] in ("student_created","admitted") and\ 60 #wftool.getInfoFor(info['app'],'review_state',None) == 'created' : 61 if s_review_state in ("student_created","admitted") and\ 62 a_review_state == 'created' : 63 #student.content_status_modify(workflow_action="enter_clearance_pin") 64 #wftool.doActionFor(info['app'],'open') 65 wftool.doActionFor(student_app,'open') 66 #wftool.doActionFor(info['pume'],'close') 67 #if info['pume'] is not None: 68 if student_pume is not None: 69 #wftool.doActionFor(info['pume'],'close') 70 wftool.doActionFor(student_pume,'close') 47 if not is_anon: 48 if "Student" in member.getRoles(): 49 to_waeup_student_home = True 50 students = context.portal_url.getPortalObject().campus.students 51 student = getattr(students,str(member)) 52 student_app = getattr(student,'application') 53 student_pume = getattr(student,'pume',None) 54 s_review_state = wftool.getInfoFor(student,'review_state',None) 55 a_review_state = wftool.getInfoFor(student_app,'review_state',None) 56 app_doc = student_app.getContent() 57 #from Products.zdb import set_trace 58 #set_trace() 59 if s_review_state in ("student_created","admitted") and\ 60 a_review_state == 'created' : 61 wftool.doActionFor(student_app,'open') 62 if student_pume is not None: 63 wftool.doActionFor(student_pume,'close') 64 da = {} 65 pin = request.get('pin') 66 if not pin: 67 jamb_reg_no = app_doc.jamb_reg_no 68 for reg_no in (jamb_reg_no,jamb_reg_no.lower(),jamb_reg_no.upper()): 69 res = context.portal_pins(student=reg_no) 70 if len(res) > 0: 71 break 72 if len(res) > 0: 73 p = res[0].pin 74 if len(p) > 10: 75 pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:]) 76 else: 77 pin = p 78 da['app_ac_pin'] = pin 79 da['app_ac_date'] = current 80 app_doc.edit(mapping = da) 81 elif s_review_state in ("admitted") and a_review_state == 'opened' and\ 82 not app_doc.app_ac_pin: 83 jamb_reg_no = app_doc.jamb_reg_no 84 for reg_no in (jamb_reg_no,jamb_reg_no.lower(),jamb_reg_no.upper()): 85 res = context.portal_pins(student=reg_no) 86 if len(res) > 0: 87 break 88 if len(res) > 0: 89 p = res[0].pin 90 if len(p) > 10: 91 pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:]) 92 else: 93 pin = p 71 94 da = {} 72 pin = request.get('pin')73 app_doc = student_app.getContent()74 if not pin:75 app_doc = student_app.getContent()76 jamb_reg_no = app_doc.jamb_reg_no77 res = context.portal_pins(student=jamb_reg_no)78 if len(res) == 1:79 p = res[0].pin80 if len(p) > 10:81 pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:])82 else:83 pin = p84 ## email = request.get('email')85 #app_doc = info['app_doc']86 95 da['app_ac_pin'] = pin 87 ## da['app_email'] = email88 da['app_ac_date'] = current89 96 app_doc.edit(mapping = da) 90 ## dc = {} 91 ## dc['clr_ac_pin'] = pin 92 ## dc['entry_date'] = current 93 ## dc['session'] = "%s" % current.year() 94 ## dc['lga'] = app_doc.jamb_lga 95 ## info['clear_doc'].edit(mapping = dc) 96 elif "Manager" in member.getRoles(): 97 pass 98 else: 99 to_member_home, to_workspaces = checkRedirect(portal, mtool) 100 if (not to_member_home) and (not to_workspaces): 101 redirect_to_portal = True 102 else: 103 redirect_url = unquote(redirect_url) 104 # One can be redirected from an http page while the login is done from an 105 # https page. This is a fix for #1205. 106 # A better option here would be to replace the previous portal_absolute_url 107 # prefix in the redirect_url by the current portal absolute URL. 108 if not redirect_url.startswith(portal_absolute_url): 109 if not is_anon: 110 to_member_home, to_workspaces = checkRedirect(portal, mtool) 111 if (not to_member_home) and (not to_workspaces): 112 redirect_to_portal = True 97 elif "Manager" in member.getRoles(): 98 pass 99 else: 100 to_member_home, to_workspaces = checkRedirect(portal, mtool) 101 if (not to_member_home) and (not to_workspaces): 102 redirect_to_portal = True 113 103 114 104 if to_waeup_student_home:
Note: See TracChangeset for help on using the changeset viewer.