Changeset 5444 for main/waeup.sirp
- Timestamp:
- 16 Aug 2010, 10:32:46 (14 years ago)
- 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 38 38 IApplicantPrincipalInfo, IApplicantPrincipal, IApplicantSessionCredentials, 39 39 IJAMBApplicantSessionCredentials) 40 from waeup.sirp.jambtables.util import get_applicant_data 40 41 41 42 class PortalUser(grok.Role): … … 84 85 # def __init__(self, reg_no, access_code): 85 86 def __init__(self, access_code, jamb_reg_no=None): 86 self.id = princi al_id(access_code, jamb_reg_no)87 self.id = principal_id(access_code, jamb_reg_no) 87 88 self.title = u'Applicant' 88 89 self.description = u'An Applicant' … … 155 156 return self.access_code 156 157 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 157 168 class JAMBApplicantCredentials(ApplicantCredentials): 158 169 """Credentials class for JAMB-screened applicants. … … 177 188 178 189 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' 180 193 jamb_reg_no_field = 'form.jamb_reg_no' 181 194 … … 188 201 sessionData = session.get( 189 202 '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) 191 206 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 192 211 credentials = None 193 212 213 print "CRED2: %s, %s" % (access_code, jamb_reg_no) 194 214 if access_code and jamb_reg_no: 195 215 credentials = JAMBApplicantCredentials( -
main/waeup.sirp/trunk/src/waeup/sirp/jambtables/browser_templates/login_pde.pt
r5328 r5444 12 12 <td width="30%"><label for="reg_no">JAMB Registration Number</label></td> 13 13 <td> 14 <input type="text" name=" reg_no"14 <input type="text" name="form.jamb_reg_no" 15 15 value="" tal:attributes="value view/reg_no" /></td> 16 16 </tr> 17 17 <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> 19 20 <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" 21 22 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" 23 24 value="" tal:attributes="value view/ac_number" /> 24 25 </td>
Note: See TracChangeset for help on using the changeset viewer.