コード例 #1
0
 def _setPropValue(self, id, value):
     BasePlugin._setPropValue(self, id, value)
     if id == 'match_roles':
         self._compile_matchs()
         if value and len(self._compiled) != len(self.match_roles):
             raise ValueError('match_roles contains invalid parameters!')
         notify(ConfigurationChangedEvent(self))
コード例 #2
0
 def _setPropValue(self, id, value):
     BasePlugin._setPropValue(self, id, value)
     if id == 'ip_roles':
         self._compile_subnets()
         if value and len(self._compiled) != len(self.ip_roles):
             raise ValueError(
                 'ip_roles contains invalid subnets and/or roles!')
         notify(ConfigurationChangedEvent(self))
コード例 #3
0
 def _setPropValue(self, id, value):
     BasePlugin._setPropValue(self, id, value)
     if id == 'match_roles':
         self._compile_matchs()
         if value and len(self._compiled) != len(self.match_roles):
             raise ValueError(
                 'match_roles contains invalid parameters!')
         notify(ConfigurationChangedEvent(self))
コード例 #4
0
 def _setPropValue(self, id, value):
     BasePlugin._setPropValue(self, id, value)
     if id == 'ip_roles':
         self._compile_subnets()
         if value and len(self._compiled) != len(self.ip_roles):
             raise ValueError(
                 'ip_roles contains invalid subnets and/or roles!')
         notify(ConfigurationChangedEvent(self))
コード例 #5
0
    def test_get_plugin_with_bad_plugin(self):
        from pas.plugins.headers.utils import get_plugin
        from pas.plugins.headers.utils import PLUGIN_ID
        from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin

        pas = api.portal.get_tool("acl_users")
        pas._delObject(PLUGIN_ID)
        pas._setObject(PLUGIN_ID, BasePlugin())
        self.assertIsNone(get_plugin(self.portal))
コード例 #6
0
    def test_uninstall_with_bad_plugin(self):
        # When a different plugin with 'our' id is found, we do not remove it.
        from pas.plugins.headers.utils import PLUGIN_ID
        from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin

        pas = api.portal.get_tool("acl_users")
        pas._delObject(PLUGIN_ID)
        pas._setObject(PLUGIN_ID, BasePlugin())
        from pas.plugins.headers.setuphandlers import uninstall

        uninstall(self.portal)
        self.assertIn(PLUGIN_ID, pas.objectIds())
コード例 #7
0
    def test_double_install(self):
        # A double install should not cause trouble.
        from pas.plugins.headers.utils import PLUGIN_ID
        from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin

        pas = api.portal.get_tool("acl_users")
        pas._delObject(PLUGIN_ID)
        pas._setObject(PLUGIN_ID, BasePlugin())
        from pas.plugins.headers.setuphandlers import post_install

        with self.assertRaises(ValueError):
            post_install(self.portal)
コード例 #8
0
    def __init__(self, id, title=None):
        BasePlugin.__init__(self)

        self._setId(id)
        self.title = title
        self._config = _configDefaults
コード例 #9
0
    def __init__(self, id, title=None):
        BasePlugin.__init__(self)

        self._setId(id)
        self.title = title
        self._config = PersistentDict(configDefaults)
コード例 #10
0
 def __init__(self, id, host, email_domain):
     BasePlugin.__init__(self)
     self.host = unicode(host)
コード例 #11
0
    def __init__(self, id, title=None):
        BasePlugin.__init__(self)

        self._setId(id)
        self.title = title
        self._config = _configDefaults