Ignore:
Timestamp:
16 Aug 2010, 10:32:46 (14 years ago)
Author:
uli
Message:

Use different fields when authenticating applicants.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/jambtables
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/jambtables/authentication.py

    r5441 r5444  
    3838    IApplicantPrincipalInfo, IApplicantPrincipal, IApplicantSessionCredentials,
    3939    IJAMBApplicantSessionCredentials)
     40from waeup.sirp.jambtables.util import get_applicant_data
    4041
    4142class PortalUser(grok.Role):
     
    8485    # def __init__(self, reg_no, access_code):
    8586    def __init__(self, access_code, jamb_reg_no=None):
    86         self.id = princial_id(access_code, jamb_reg_no)
     87        self.id = principal_id(access_code, jamb_reg_no)
    8788        self.title = u'Applicant'
    8889        self.description = u'An Applicant'
     
    155156        return self.access_code
    156157
     158    def getLogin(self):
     159        """Stay compatible with non-applicant authenticators.
     160        """
     161        return None
     162
     163    def getPassword(self):
     164        """Stay compatible with non-applicant authenticators.
     165        """
     166        return None
     167   
    157168class JAMBApplicantCredentials(ApplicantCredentials):
    158169    """Credentials class for JAMB-screened applicants.
     
    177188
    178189    loginpagename = 'login'
    179     accesscode_field = 'form.access_code'
     190    accesscode_prefix_field = 'form.prefix'
     191    accesscode_series_field = 'form.ac_series'
     192    accesscode_number_field = 'form.ac_number'
    180193    jamb_reg_no_field = 'form.jamb_reg_no'
    181194
     
    188201        sessionData = session.get(
    189202            'zope.pluggableauth.browserplugins')
    190         access_code = request.get(self.accesscode_field, None)
     203        access_code_prefix = request.get(self.accesscode_prefix_field, None)
     204        access_code_series = request.get(self.accesscode_series_field, None)
     205        access_code_no = request.get(self.accesscode_number_field, None)
    191206        jamb_reg_no = request.get(self.jamb_reg_no_field, None)
     207        access_code = '%s-%s-%s' % (
     208            access_code_prefix, access_code_series, access_code_no)
     209        if None in [access_code_prefix, access_code_series, access_code_no]:
     210            access_code = None
    192211        credentials = None
    193212
     213        print "CRED2: %s, %s" % (access_code, jamb_reg_no)
    194214        if access_code and jamb_reg_no:
    195215            credentials = JAMBApplicantCredentials(
  • main/waeup.sirp/trunk/src/waeup/sirp/jambtables/browser_templates/login_pde.pt

    r5328 r5444  
    1212        <td width="30%"><label for="reg_no">JAMB Registration Number</label></td>
    1313        <td>
    14           <input type="text" name="reg_no"
     14          <input type="text" name="form.jamb_reg_no"
    1515                 value="" tal:attributes="value view/reg_no" /></td>
    1616      </tr>
    1717      <tr>
    18         <td><label for="ac_series">Access Code</label></td>
     18        <input type="hidden" name="form.prefix" value="PUDE" />
     19        <td><label for="form.ac_series">Access Code</label></td>
    1920        <td>
    20           PUDE-<input name="ac_series" type="text" size="3" maxlength="3"
     21          PUDE-<input name="form.ac_series" type="text" size="3" maxlength="3"
    2122                      value="" tal:attributes="value view/ac_series"
    22           />-<input name="ac_number" type="text" size="10" maxlength="10"
     23          />-<input name="form.ac_number" type="text" size="10" maxlength="10"
    2324                    value="" tal:attributes="value view/ac_number" />
    2425        </td>
Note: See TracChangeset for help on using the changeset viewer.