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))
 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