Changeset 3858 for WAeUP_SRP/trunk
- Timestamp:
- 17 Jan 2009, 07:29:24 (16 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/CHANGES.txt
r3824 r3858 134 134 ----------------- 135 135 - implement configuration object (step 1) 136 137 1.27 (2009-01-17) 138 ----------------- 139 - implement password notification module -
WAeUP_SRP/trunk/WAeUPTool.py
r3840 r3858 182 182 "Manager" in roles) 183 183 info['is_clearanceofficer'] = not is_student and ("ClearanceOfficer" in roles) 184 is_allowed = info['is_allowed'] = not is_anonymous184 #is_allowed = info['is_allowed'] = not is_anonymous 185 185 requested_id = context.getStudentId() 186 186 student_id = None 187 if is_allowed:188 if not is_student and requested_id:189 student_id 190 el if not is_allowed and (not is_staff or member_id != requested_id):187 if not is_anonymous and requested_id: 188 if (is_student and member_id == requested_id) or is_staff: 189 student_id = requested_id 190 else: 191 191 logger.info('%s tried to access %s of %s' % (member_id,context.portal_type,requested_id)) 192 else:193 student_id = member_id194 192 info['student_id'] = student_id 195 193 return info … … 570 568 ###) 571 569 572 security.declareP rotected(View,'getCredential') ###(570 security.declarePublic('getCredential') ###( 573 571 def getCredential(self,student_id): 574 572 student_entry = getattr(self.portal_directories.students,student_id,None) 575 if not self.isStaff(): 576 mtool = self.portal_membership 577 member = mtool.getAuthenticatedMember() 578 logger = logging.getLogger('WAeUPTool.getCredential') 579 logger.info('%s tried to access password of %s' % (member,student_id)) 580 return None 573 #import pdb;pdb.set_trace() 574 #if not self.isStaff(): 575 # mtool = self.portal_membership 576 # member = mtool.getAuthenticatedMember() 577 # logger = logging.getLogger('WAeUPTool.getCredential') 578 # logger.info('%s tried to access password of %s' % (member,student_id)) 579 # return None 581 580 if student_entry is None: 582 581 return None -
WAeUP_SRP/trunk/Widgets.py
r3847 r3858 2474 2474 2475 2475 widgetRegistry.register(DiscFileWidget) 2476 2477 2478 class RegMatricNoWidget(CPSStringWidget): ###( 2479 """ RegMatricNo Widget""" 2480 meta_type = "RegMatricNo Widget" 2481 def validate(self, datastructure, **kw): 2482 """Validate datastructure and update datamodel.""" 2483 valid = CPSStringWidget.validate(self, datastructure, **kw) 2484 widget_id = self.getWidgetId() 2485 value = datastructure[widget_id].upper() 2486 err = 0 2487 #import pdb;pdb.set_trace() 2488 if not valid: 2489 err = 'Invalid number' 2490 else: 2491 student_record = self.students_catalog(jamb_reg_no = value) 2492 if len(student_record) < 1: 2493 student_record = self.students_catalog(matric_no = value) 2494 if len(student_record) < 1: 2495 err = 'No student record with this registration or matric number' 2496 else: 2497 datastructure['record'] = student_record[0] 2498 #import pdb;pdb.set_trace() 2499 else: 2500 datastructure['record'] = student_record[0] 2501 #import pdb;pdb.set_trace() 2502 if err: 2503 datastructure.setError(widget_id, err) 2504 else: 2505 datamodel = datastructure.getDataModel() 2506 datamodel[self.fields[0]] = value 2507 2508 return not err 2509 2510 InitializeClass(RegMatricNoWidget) 2511 2512 widgetRegistry.register(RegMatricNoWidget) 2513 2514 class CheckEmailWidget(CPSStringWidget): ###( 2515 """ CheckEmail Widget""" 2516 meta_type = "CheckEmail Widget" 2517 def validate(self, datastructure, **kw): 2518 """Validate datastructure and update datamodel.""" 2519 if datastructure.errors: 2520 return 2521 valid = CPSStringWidget.validate(self, datastructure, **kw) 2522 widget_id = self.getWidgetId() 2523 value = datastructure[widget_id].upper() 2524 err = 0 2525 #import pdb;pdb.set_trace() 2526 if not valid: 2527 err = 'Invalid string' 2528 else: 2529 email_cat = datastructure['record'].email.upper() 2530 if email_cat != value: 2531 err = 'Email address does not match' 2532 else: 2533 pass 2534 if err: 2535 datastructure.setError(widget_id, err) 2536 else: 2537 datamodel = datastructure.getDataModel() 2538 datamodel[self.fields[0]] = value 2539 2540 return not err 2541 2542 InitializeClass(CheckEmailWidget) 2543 2544 widgetRegistry.register(CheckEmailWidget) 2545 2476 2546 ###) 2477 2547 -
WAeUP_SRP/trunk/profiles/default/layouts.xml
r3824 r3858 117 117 <object name="student_gown" meta_type="CPS Layout"/> 118 118 <object name="configuration" meta_type="CPS Layout"/> 119 <object name="retrieve_password" meta_type="CPS Layout"/> 119 120 120 121 </object> -
WAeUP_SRP/trunk/profiles/default/schemas.xml
r3824 r3858 89 89 <object name="waeup_common" meta_type="CPS Schema"/> 90 90 <object name="configuration" meta_type="CPS Schema"/> 91 <object name="retrieve_password" meta_type="CPS Schema"/> 91 92 92 93 -
WAeUP_SRP/trunk/skins/waeup_student/getMemberInfo.py
r3458 r3858 37 37 student_id = info['student_id'] 38 38 if student_id is None: 39 return None39 return 'You are not allowed to access this information!' 40 40 41 41 students_object = context.portal_url.getPortalObject().campus.students -
WAeUP_SRP/trunk/skins/waeup_student/login_student.pt
r2606 r3858 58 58 59 59 </form> 60 61 <br /> 62 63 <a href=/retrieve_password>Forgot your Id or Password?</a> 60 64 61 <br /> 65 <br /><br /> 62 66 63 67 <p i18n:translate="help_login_aware_logout">
Note: See TracChangeset for help on using the changeset viewer.