Ignore:
Timestamp:
28 Nov 2011, 21:04:57 (13 years ago)
Author:
Henrik Bettermann
Message:

Implement SIRPPrincipalInfo and SIRPPrincipal classes which provide ordinary principals with an extra email and phone attribute.

File:
1 edited

Legend:

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

    r7221 r7233  
    2828from zope.publisher.interfaces.http import IHTTPRequest
    2929from zope.session.interfaces import ISession
    30 from waeup.sirp.authentication import PrincipalInfo, get_principal_role_manager
     30from waeup.sirp.authentication import SIRPPrincipalInfo, get_principal_role_manager
    3131from waeup.sirp.interfaces import (
    3232    IAuthPluginUtility, IUserAccount, IPasswordValidator)
     
    5454    def email(self):
    5555        return self.context.email
     56
     57    @property
     58    def phone(self):
     59        return self.context.phone
    5660
    5761    @property
     
    127131        if not account.checkPassword(credentials['password']):
    128132            return None
    129         return PrincipalInfo(id=account.name,
     133        return SIRPPrincipalInfo(id=account.name,
    130134                             title=account.title,
    131                              description=account.description)
     135                             description=account.description,
     136                             email=account.email,
     137                             phone=account.phone)
    132138
    133139    def principalInfo(self, id):
    134140        """Get a principal identified by `id`.
    135141
    136         This one is required by IAuthenticatorPlugin.
    137         """
    138         account = self.getAccount(id)
    139         if account is None:
    140             return None
    141         return PrincipalInfo(id=account.name,
    142                              title=account.title,
    143                              description=account.description)
     142        This one is required by IAuthenticatorPlugin but not needed here
     143        (see respective docstring in applicants package).
     144        """
     145        return None
    144146
    145147    def getAccount(self, login):
Note: See TracChangeset for help on using the changeset viewer.