From 1a47ac9182c8368ce6bbac518dc7700ad6c1cbb1 Mon Sep 17 00:00:00 2001 From: helmutm Date: Sat, 2 May 2009 20:45:55 +0000 Subject: [PATCH] ignore case (optionally) in password check git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3367 fd906abe-77d9-0310-91a1-e0d9ade77398 --- organize/auth.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/organize/auth.py b/organize/auth.py index cd94083..b1819df 100644 --- a/organize/auth.py +++ b/organize/auth.py @@ -54,6 +54,7 @@ class PersonBasedAuthenticator(Persistent, Contained): implements(IAuthenticatorPlugin, IPersonBasedAuthenticator) passwordKey = 'loops.organize.password' + ignoreCase = True def __init__(self, prefix=''): self.prefix = unicode(prefix) @@ -77,10 +78,14 @@ class PersonBasedAuthenticator(Persistent, Contained): if login and password: pa = self.getPrincipalAnnotations( getParent(self).prefix + self.prefix + login) + if self.ignoreCase: + password = password.lower() return pa.get(self.passwordKey) == password return None def setPassword(self, login, password): + if self.ignoreCase: + password = password.lower() pa = self.getPrincipalAnnotations( getParent(self).prefix + self.prefix + login) pa[self.passwordKey] = password