Commit 1c70e11e authored by Rafael Monnerat's avatar Rafael Monnerat

Included draft method (copied from erp5_credentials) to check if SingleSignOn is enabled.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39986 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b55d31f6
...@@ -50,6 +50,8 @@ from DateTime import DateTime ...@@ -50,6 +50,8 @@ from DateTime import DateTime
from Products.PluggableAuthService.interfaces.plugins import \ from Products.PluggableAuthService.interfaces.plugins import \
IAuthenticationPlugin IAuthenticationPlugin
from Products.ERP5Type.Cache import CachingMethod from Products.ERP5Type.Cache import CachingMethod
from Products.ERP5Wizard.PAS.ERP5RemoteUserManager import ERP5RemoteUserManager
from Products.PluggableAuthService.PluggableAuthService import PluggableAuthService as PluggableAuthServiceTool
# global (RAM) cookie storage # global (RAM) cookie storage
cookiejar = cookielib.CookieJar() cookiejar = cookielib.CookieJar()
...@@ -953,3 +955,22 @@ class WizardTool(BaseTool): ...@@ -953,3 +955,22 @@ class WizardTool(BaseTool):
portal_preferences = getToolByName(self, 'portal_preferences') portal_preferences = getToolByName(self, 'portal_preferences')
if portal_preferences.getActivePreference() is not None: if portal_preferences.getActivePreference() is not None:
portal_preferences.setPreference(preference_id, value) portal_preferences.setPreference(preference_id, value)
security.declarePublic(Permissions.AccessContentsInformation,
'isSingleSignOnEnabled')
def isSingleSignOnEnabled(self):
"""
Check that a ERP5 Remote User manager is
present as authentication plugin
"""
acl_users = getattr(self.getPortalObject(), 'acl_users')
if isinstance(acl_users , PluggableAuthServiceTool):
# List plugin which make authentication
plugin_list = acl_users.plugins.listPlugins(IAuthenticationPlugin)
for plugin_name, plugin_value in plugin_list:
# Try to find an ERP5RemoteUserManager
if isinstance(plugin_value, ERP5RemoteUserManager):
# ERP5RemoteUserManager was found but remains verify if
# the plugin is enabled or not.
return True
return False
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