Commit d90f1a08 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Vincent Pelletier

erp5_credential: do not hardcode plugin class names.

parent 2f1dd643
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Products import PluggableAuthService from Products import PluggableAuthService
from Products.ERP5Security.ERP5UserManager import ERP5UserManager
try: try:
from Products.ERP5Wizard.PAS.ERP5RemoteUserManager import ERP5RemoteUserManager from Products.ERP5Wizard.PAS.ERP5RemoteUserManager import ERP5RemoteUserManager
except ImportError: except ImportError:
...@@ -56,17 +55,7 @@ def isLocalLoginAvailable(self, login): ...@@ -56,17 +55,7 @@ def isLocalLoginAvailable(self, login):
acl_users = getToolByName(portal, 'acl_users') acl_users = getToolByName(portal, 'acl_users')
if isinstance(acl_users,PluggableAuthServiceTool): if isinstance(acl_users,PluggableAuthServiceTool):
#List plugin which make user enumeration user enumeration return not acl_users.searchUsers(login=login, exact_match=True)
plugin_list = acl_users.plugins.listPlugins(IUserEnumerationPlugin)
for plugin_name, plugin_value in plugin_list:
#we check with instance of ERP5UserManager and ZODBUserManager
if isinstance(plugin_value, (ERP5UserManager,ZODBUserManager,)):
user_list = plugin_value.enumerateUsers(id=login,
exact_match=True)
if len(user_list) > 0:
return False
return True
return None return None
def isSingleSignOnEnable(self): def isSingleSignOnEnable(self):
......
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