Changeset 1376


Ignore:
Timestamp:
30 Jan 2007, 16:53:16 (18 years ago)
Author:
joachim
Message:

D profiles/default/schemas/epayment.xml
was replaced by payment.xml
M profiles/default/layouts/student_schoolfee.xml
use order_id from payment-schema
M skins/waeup_epayment/pay_by_sc.py
use payment-schema
M Widgets.py
invalid PIN number length when length of pin-number != 10

Location:
WAeUP_SRP/trunk
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Widgets.py

    r1343 r1376  
    693693        datastructure[widget_id+'_b'] = b
    694694        datastructure[widget_id+'_n'] = n
    695 
    696 ###)
     695    ###)
    697696
    698697    def validate(self, datastructure, **kw): ###(
     
    710709        pins = self.portal_pins
    711710        pin = "%(prefix)s%(b)s%(n)s" % vars()
     711        pin_str = "%(prefix)s-%(b)-s%(n)s" % vars()
    712712        do = 1
    713713        s_id = str(self.portal_membership.getAuthenticatedMember())
     
    716716            do = 0
    717717            err ='You are not a Student. PIN neither checked nor used.'
    718             s_logger.info('"%s","tried to use Scratchcard", "%s"' % (s_id,pin))
     718            s_logger.info('"%s","tried to use Scratchcard", "%s"' % (s_id,pin_str))
     719        elif len(n) != 10:
     720            do = 0
     721            err = 'Invalid PIN-Number length %d' % len(n)
     722            s_logger.info('"%s","Invalid PIN-Number length", "%d"' % (s_id,len(n)))
    719723        elif self.reference == "":
    720724            ref = s_id
     
    724728                do = 0
    725729                datastructure.setError(widget_id, 'Errors in other data, PIN neither checked nor used.')
    726                 s_logger.info('"%s", "%s","entered wrong data together with pin", "%s"' % (s_id,ref,pin))
     730                s_logger.info('"%s", "%s","entered wrong data together with pin", "%s"' % (s_id,ref,pin_str))
    727731        while do:
    728732            ok = pins.searchAndSetRecord(pin,ref,prefix)
    729733            if ok < -2 or ok > 2:
    730734                err = 'Unknown error, please report!'
    731                 s_logger.info('"%s","%s", "caused unknown error with pin", "%s"' % (s_id,ref,pin))
     735                s_logger.info('"%s","%s", "caused unknown error with pin", "%s"' % (s_id,ref,pin_str))
    732736                break
    733737            elif ok == -2:
    734738                err = 'Service already activated but with a different PIN.'
    735                 s_logger.info('"%s","%s", "repeatedly activated service but with different pin", "%s"' % (s_id,ref,pin))
     739                s_logger.info('"%s","%s", "repeatedly activated service but with different pin", "%s"' % (s_id,ref,pin_str))
    736740                break
    737741            elif ok == -1:
    738742                err = 'Invalid PIN'
    739                 s_logger.info('"%s","%s", "entered invalid pin", "%s"' % (s_id,ref,pin))
     743                s_logger.info('"%s","%s", "entered invalid pin", "%s"' % (s_id,ref,pin_str))
    740744                break
    741745            if ok == 0:
    742746                err = 'PIN already used.'
    743                 s_logger.info('"%s","%s", "entered used pin", "%s"' % (s_id,ref,pin))
     747                s_logger.info('"%s","%s", "entered used pin", "%s"' % (s_id,ref,pin_str))
    744748                break
    745749            if ok >= 1:
     
    748752                    if self.reference == "jamb_reg_no":
    749753                        err = "You are already logged in."
    750                         s_logger.info('"%s","%s", "checked admission though logged in", "%s"' % (s_id,ref,pin))
     754                        s_logger.info('"%s","%s", "checked admission though logged in", "%s"' % (s_id,ref,pin_str))
    751755                        break
    752756                    if ok == 1:
    753                         s_logger.info('"%s","%s", "successfully used pin", "%s"' % (s_id,ref,pin))
     757                        s_logger.info('"%s","%s", "successfully used pin", "%s"' % (s_id,ref,pin_str))
    754758                    else:
    755                         s_logger.info('"%s","%s", "repeatedly used pin", "%s"' % (s_id,ref,pin))
     759                        s_logger.info('"%s","%s", "repeatedly used pin", "%s"' % (s_id,ref,pin_str))
    756760                    break
    757761                else:
    758762                    student = getStudentByRegNo(self,ref)
    759                     s_logger.info('"%s","%s","successfully used pin","%s"' % (s_id,ref,pin))
     763                    s_logger.info('"%s","%s","successfully used pin","%s"' % (s_id,ref,pin_str))
    760764                if student is None:
    761765                    err = "Student not found."
     
    767771                        if hasattr(self.portal_directories.students,s_id):
    768772                            err = "Please login with your Student Id %s and 10-digit PIN." % s_id
    769                             s_logger.info('"%s","%s", "repeatedly checked admission with pin", "%s"' % (s_id,ref,pin))
     773                            s_logger.info('"%s","%s", "repeatedly checked admission with pin", "%s"' % (s_id,ref,pin_str))
    770774                            break
    771775                        else:
    772                             s_logger.info('"%s","%s","(non-member) repeatedly checked admission with pin", "%s"' % (s_id,ref,pin))
     776                            s_logger.info('"%s","%s","(non-member) repeatedly checked admission with pin", "%s"' % (s_id,ref,pin_str))
    773777                    else:
    774778                        err = "Unknown error" % s_id
    775                         s_logger.info('"%s","%s", "repeatedly activated service with pin", "%s"' % (s_id,ref,pin))
     779                        s_logger.info('"%s","%s", "repeatedly activated service with pin", "%s"' % (s_id,ref,pin_str))
    776780                        break
    777781                try:
    778782                    student.getContent().makeStudentMember(s_id,password=pin[4:])
    779                     s_logger.info('"%s","%s", "has been created using pin", "%s"' % (s_id,ref,pin))
     783                    s_logger.info('"%s","%s", "has been created using pin", "%s"' % (s_id,ref,pin_str))
    780784                except:
    781785                    err = "Please login with your Student Id %s and 10-digit PIN." % s_id
    782                     s_logger.info('"%s","%s", "could not be made a member with pin", "%s"' % (s_id,ref,pin))
     786                    s_logger.info('"%s","%s", "could not be made a member with pin", "%s"' % (s_id,ref,pin_str))
    783787                    break
    784788            break
  • WAeUP_SRP/trunk/profiles/default/layouts/student_schoolfee.xml

    r1286 r1376  
    1010  <property name="title">Schoolfee Scratch Card</property>
    1111  <property name="fields">
    12    <element value="payment_id"/>
     12   <element value="order_id"/>
    1313  </property>
    1414  <property name="label">Access Code</property>
  • WAeUP_SRP/trunk/skins/waeup_epayment/pay_by_sc.py

    r1371 r1376  
    3333validate = request.has_key("cpsdocument_create_button")
    3434res,psm,ds = lt.renderLayout(layout_id= 'student_schoolfee',
    35                       schema_id= 'epayment',
     35                      schema_id= 'payment',
    3636                      context=context,
    3737                      mapping=validate and request,
Note: See TracChangeset for help on using the changeset viewer.