3 __author__
= "Florian Friesdorf <flo@chaoflow.net>"
4 __docformat__
= "plaintext"
6 from StringIO
import StringIO
8 from Products
.CMFCore
.utils
import getToolByName
9 from Products
.PluggableAuthService
.interfaces
.plugins \
10 import IAuthenticationPlugin
11 from Products
.PlonePAS
.Extensions
.Install
import activatePluginInterfaces
14 def _setupPlugins(portal
, out
):
16 Install and prioritize the Paula PAS plug-ins.
18 uf
= getToolByName(portal
, 'acl_users')
20 paula
= uf
.manage_addProduct
['paula.plonepas']
21 existing
= uf
.objectIds()
23 if 'paula_auth' not in existing
:
24 paula
.addAuthenticationPlugin('paula_auth')
25 print >> out
, "Added Paula PAS Authentication Plugin."
26 activatePluginInterfaces(portal
, 'paula_auth', out
)
29 #plugins.movePluginsUp(IAuthenticationPlugin, ['paula'])
31 if 'paula_properties' not in existing
:
32 paula
.addPropertiesPlugin('paula_properties')
33 print >> out
, "Added Paula PAS Properties Plugin."
34 activatePluginInterfaces(portal
, 'paula_properties', out
)
36 if 'paula_groups' not in existing
:
37 paula
.addGroupsPlugin('paula_groups')
38 print >> out
, "Added Paula PAS Groups Plugin."
39 activatePluginInterfaces(portal
, 'paula_groups', out
)
42 def setupPlugins(context
):
43 """initialize paula plugins
45 if context
.readDataFile('paula-pasplugins-setup-plugins.txt') is None:
48 portal
= context
.getSite()
50 _setupPlugins(portal
, out
)
51 logger
= context
.getLogger("plugins")
52 logger
.info(out
.getvalue())