Ignore:
Timestamp:
16 Aug 2010, 11:18:41 (14 years ago)
Author:
uli
Message:

Clean up and check access_code before authenticating an applicant.

File:
1 edited

Legend:

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

    r5444 r5446  
    3838    IApplicantPrincipalInfo, IApplicantPrincipal, IApplicantSessionCredentials,
    3939    IJAMBApplicantSessionCredentials)
    40 from waeup.sirp.jambtables.util import get_applicant_data
     40from waeup.sirp.jambtables.util import get_applicant_data, get_access_code
    4141
    4242class PortalUser(grok.Role):
     
    243243
    244244    def authenticateCredentials(self, credentials):
    245         #print "AUTH: ", credentials
    246245        if not isinstance(credentials, dict):
    247246            return None
     
    250249        if not 'jambregno' in credentials.keys():
    251250            credentials['jambregno'] = None
     251        ac = get_access_code(credentials['accesscode'])
     252        if ac is None:
     253            # Invalid access code entered.
     254            # XXX: log this.
     255            return None
    252256        return ApplicantPrincipalInfo(
    253257            credentials['accesscode'], credentials['jambregno']
    254             # credentials['login'], credentials['password']
    255258            )
    256259
Note: See TracChangeset for help on using the changeset viewer.