Changeset 990
- Timestamp:
- 5 Dec 2006, 12:08:24 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/WAeUPTables.py
r971 r990 141 141 #records = self.searchResults(uid=uid) 142 142 records = self.searchResults(student = student_id) 143 #import pdb;pdb.set_trace() 143 144 if len(records) > 0: 144 145 for r in records: … … 160 161 self.catalog_object(dict2ob(record_data), uid) 161 162 return 1 162 if record.student != student_id:163 if record.student.upper() != student_id.upper(): 163 164 return 0 164 165 if record.student == student_id: -
WAeUP_SRP/trunk/Widgets.py
r989 r990 1 1 #-*- mode: python; mode: fold -*- 2 2 # $Id$ 3 3 from cgi import escape 4 4 from types import * … … 401 401 """the ScratchCardPin""" 402 402 def __init__(self,prefix,batch_no,number): 403 if not batch_no and not number: 404 s = prefix 405 if len(s) > 5: 406 prefix,batch_no,number = s[:3],s[3:-10],s[-10:] 407 else: 408 prefix,batch_no,number = '','',s 403 409 self.p = prefix 404 410 self.b = batch_no … … 428 434 #import pdb;pdb.set_trace() 429 435 if v and type(v) is StringType: 430 p,b,n = v.split('-') 431 v = ScratchCardPin(v,b,n) 436 try: 437 p,b,n = v.split('-') 438 v = ScratchCardPin(p,b,n) 439 except ValueError: 440 v = ScratchCardPin(v,'','') 432 441 if v: 433 442 p = '%s' % v.p … … 496 505 s_id = student.getId() 497 506 if ok == 2: 498 err = "Please login with your Student Id %s and 10-digit PIN." % s_id 499 s_logger.info("Student %s double used Pin %s" % (s_id,pin)) 500 break 501 if self.reference == "jamb_reg_no": 502 res = self.students_catalog(jamb_reg_no = ref) 503 if len(res) > 0: 507 if self.reference == "jamb_reg_no": 508 if hasattr(self.portal_directories.students,s_id): 509 err = "Please login with your Student Id %s and 10-digit PIN." % s_id 510 s_logger.info("Student %s double used Pin %s" % (s_id,pin)) 511 break 512 else: 513 s_logger.info("Student not Member %s double used Pin %s" % (s_id,pin)) 514 else: 504 515 err = "Please login with your Student Id %s and 10-digit PIN." % s_id 505 s_logger.info("Student %s double checked AdmissionPin %s" % (s_id,pin))516 s_logger.info("Student %s double used Pin %s" % (s_id,pin)) 506 517 break 518 ## if self.reference == "jamb_reg_no": 519 ## res = self.students_catalog(jamb_reg_no = ref) 520 ## if len(res) > 0: 521 ## err = "Please login with your Student Id %s and 10-digit PIN." % s_id 522 ## s_logger.info("Student %s double checked Admission Pin %s" % (s_id,pin)) 523 ## break 507 524 try: 508 525 student.getContent().makeStudentMember(s_id,password=pin[4:]) … … 539 556 v = datamodel[self.fields[0]] 540 557 if v and type(v) is StringType: 541 prefix,b,n = v.split('-') 542 v = ScratchCardPin(prefix,b,n) 558 try: 559 p,b,n = v.split('-') 560 v = ScratchCardPin(p,b,n) 561 except ValueError: 562 v = ScratchCardPin(v,'','') 543 563 if v: 544 564 prefix= '%s' % v.p -
WAeUP_SRP/trunk/skins/waeup_custom/logged_in.py
r979 r990 45 45 member = mtool.getAuthenticatedMember() 46 46 47 if not redirect_url or redirect_url.endswith('/logged_out'):47 if True or not redirect_url or redirect_url.endswith('/logged_out'): 48 48 if not is_anon: 49 49 if "Student" in member.getRoles(): … … 60 60 da = {} 61 61 pin = request.get('pin') 62 if not pin: 63 jamb_reg_no = info['app_doc'].jamb_reg_no 64 res = context.portal_pins(student=jamb_reg_no) 65 if len(res) == 1: 66 p = res[0].pin 67 pin = "%s-%s-%s" % (p[:3],p[3:4],p[4:]) 62 68 ## email = request.get('email') 63 69 app_doc = info['app_doc']
Note: See TracChangeset for help on using the changeset viewer.