示例#1
0
文件: who.py 项目: gelie/bungeni_src
 def get_principal_by_login(self, login):
     try:
         return principalRegistry.getPrincipalByLogin(login)
     except PrincipalLookupError:
         pass
     except KeyError:
         pass
示例#2
0
 def get_principal_by_login(self, login):
     try:
         return principalRegistry.getPrincipalByLogin(login)
     except PrincipalLookupError:
         pass
     except KeyError:
         pass
示例#3
0
文件: auth.py 项目: bendavis78/zope
 def authenticateCredentials(self, credentials):
     """Return principal info if credentials can be authenticated
     """
     if not isinstance(credentials, dict):
         return None
     if not ('login' in credentials and 'password' in credentials):
         return None
     principal = None
     login, password = credentials['login'], credentials['password']
     try:
         principal = principalRegistry.getPrincipalByLogin(login)
     except KeyError:
         return
     if principal and principal.validate(password):
         return PrincipalInfo(u'' + principal.id, principal.getLogin(),
                              principal.title, principal.description)
     return