Commit 75d80edb authored by Ivan Tyagov's avatar Ivan Tyagov

Apply changes in r27234

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27239 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2300038e
...@@ -25,7 +25,7 @@ from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlug ...@@ -25,7 +25,7 @@ from Products.PluggableAuthService.interfaces.plugins import IAuthenticationPlug
IUserEnumerationPlugin IUserEnumerationPlugin
from Products.ERP5Type.Cache import CachingMethod from Products.ERP5Type.Cache import CachingMethod
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Security.ERP5UserManager import ERP5UserManager, SUPER_USER from Products.ERP5Security.ERP5UserManager import ERP5UserManager, SUPER_USER, _AuthenticationFailure
manage_addERP5RemoteUserManagerForm = PageTemplateFile( manage_addERP5RemoteUserManagerForm = PageTemplateFile(
...@@ -75,7 +75,7 @@ class ERP5RemoteUserManager(ERP5UserManager): ...@@ -75,7 +75,7 @@ class ERP5RemoteUserManager(ERP5UserManager):
user_list = self.getUserByLogin(login) user_list = self.getUserByLogin(login)
if not user_list: if not user_list:
return None raise _AuthenticationFailure()
user = user_list[0] user = user_list[0]
...@@ -106,15 +106,18 @@ class ERP5RemoteUserManager(ERP5UserManager): ...@@ -106,15 +106,18 @@ class ERP5RemoteUserManager(ERP5UserManager):
finally: finally:
setSecurityManager(sm) setSecurityManager(sm)
return None raise _AuthenticationFailure()
_authenticateCredentials = CachingMethod(_authenticateCredentials, _authenticateCredentials = CachingMethod(_authenticateCredentials,
id='ERP5RemoteUserManager_authenticateCredentials', id='ERP5RemoteUserManager_authenticateCredentials',
cache_factory='erp5_content_short') cache_factory='erp5_content_short')
return _authenticateCredentials( try:
login=credentials.get('login'), return _authenticateCredentials(
password=credentials.get('password'), login=credentials.get('login'),
path=self.getPhysicalPath()) password=credentials.get('password'),
path=self.getPhysicalPath())
except _AuthenticationFailure:
return None
classImplements( ERP5RemoteUserManager classImplements( ERP5RemoteUserManager
, IAuthenticationPlugin , IAuthenticationPlugin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment