[Zope-CVS] CVS: Products/PluggableAuthService/plugins - ZODBUserManager.py:1.11 ZODBRoleManager.py:1.5 ZODBGroupManager.py:1.5 SessionAuthHelper.py:1.5 SearchPrincipalsPlugin.py:1.4 ScriptablePlugin.py:1.5 RecursiveGroupsPlugin.py:1.6 LocalRolePlugin.py:1.5 InlineAuthHelper.py:1.4 HTTPBasicAuthHelper.py:1.8 DynamicGroupsPlugin.py:1.5 DomainAuthHelper.py:1.5 DelegatingMultiPlugin.py:1.5 CookieAuthHelper.py:1.15 BasePlugin.py:1.6

Zachery Bir zbir at urbanape.com
Wed Jul 6 14:49:06 EDT 2005


Update of /cvs-repository/Products/PluggableAuthService/plugins
In directory cvs.zope.org:/tmp/cvs-serv29036/plugins

Modified Files:
	ZODBUserManager.py ZODBRoleManager.py ZODBGroupManager.py 
	SessionAuthHelper.py SearchPrincipalsPlugin.py 
	ScriptablePlugin.py RecursiveGroupsPlugin.py 
	LocalRolePlugin.py InlineAuthHelper.py HTTPBasicAuthHelper.py 
	DynamicGroupsPlugin.py DomainAuthHelper.py 
	DelegatingMultiPlugin.py CookieAuthHelper.py BasePlugin.py 
Log Message:
Merging per-plugin id mangling and Zope 2.7/2.8 Interface compatibility code


=== Products/PluggableAuthService/plugins/ZODBUserManager.py 1.10 => 1.11 ===
--- Products/PluggableAuthService/plugins/ZODBUserManager.py:1.10	Fri May 27 14:55:45 2005
+++ Products/PluggableAuthService/plugins/ZODBUserManager.py	Wed Jul  6 14:49:05 2005
@@ -27,7 +27,7 @@
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
-from Products.PluggableAuthService.utils import createViewName
+from Products.PluggableAuthService.utils import createViewName, classImplements
 from Products.PluggableAuthService.interfaces.plugins \
     import IAuthenticationPlugin
 from Products.PluggableAuthService.interfaces.plugins \
@@ -59,10 +59,6 @@
 
     """ PAS plugin for managing users in the ZODB.
     """
-    __implements__ = ( IAuthenticationPlugin
-                     , IUserEnumerationPlugin
-                     , IUserAdderPlugin
-                     )
 
     meta_type = 'ZODB User Manager'
 
@@ -472,6 +468,12 @@
                                '?manage_tabs_message=%s'
                              % ( self.absolute_url(), message )
                              )
+
+classImplements( ZODBUserManager
+               , IAuthenticationPlugin
+               , IUserEnumerationPlugin
+               , IUserAdderPlugin
+               )
 
 InitializeClass( ZODBUserManager )
 


=== Products/PluggableAuthService/plugins/ZODBRoleManager.py 1.4 => 1.5 ===
--- Products/PluggableAuthService/plugins/ZODBRoleManager.py:1.4	Mon Aug 30 11:27:52 2004
+++ Products/PluggableAuthService/plugins/ZODBRoleManager.py	Wed Jul  6 14:49:05 2005
@@ -23,6 +23,7 @@
 
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
+from Products.PluggableAuthService.utils import classImplements
 from Products.PluggableAuthService.interfaces.plugins \
     import IRolesPlugin
 from Products.PluggableAuthService.interfaces.plugins \
@@ -54,11 +55,6 @@
 
     """ PAS plugin for managing roles in the ZODB.
     """
-    __implements__ = ( IRolesPlugin
-                     , IRoleEnumerationPlugin
-                     , IRoleAssignerPlugin
-                     )
-
     meta_type = 'ZODB Role Manager'
 
     security = ClassSecurityInfo()
@@ -439,6 +435,12 @@
                            + '&manage_tabs_message=%s'
                            ) % ( self.absolute_url(), role_id, message )
                          )
+
+classImplements( ZODBRoleManager
+               , IRolesPlugin
+               , IRoleEnumerationPlugin
+               , IRoleAssignerPlugin
+               )
 
 
 InitializeClass( ZODBRoleManager )


=== Products/PluggableAuthService/plugins/ZODBGroupManager.py 1.4 => 1.5 ===
--- Products/PluggableAuthService/plugins/ZODBGroupManager.py:1.4	Mon Aug 30 11:25:46 2004
+++ Products/PluggableAuthService/plugins/ZODBGroupManager.py	Wed Jul  6 14:49:05 2005
@@ -22,6 +22,7 @@
 from BTrees.OOBTree import OOBTree
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
+from Products.PluggableAuthService.utils import classImplements
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.interfaces.plugins \
     import IGroupEnumerationPlugin
@@ -50,10 +51,6 @@
 
     """ PAS plugin for managing groups, and groups of groups in the ZODB
     """
-    __implements__ = ( IGroupEnumerationPlugin
-                     , IGroupsPlugin
-                     )
-
     meta_type = 'ZODB Group Manager'
 
     security = ClassSecurityInfo()
@@ -118,6 +115,8 @@
                 info[ 'properties_url' ] = '%s?%s' % ( e_url, p_qs )
                 info[ 'members_url' ] = '%s?%s' % ( e_url, m_qs )
 
+                info[ 'id' ] = '%s%s' % (self.prefix, info['id'])
+
                 if not group_filter or group_filter( info ):
                     group_info.append( info )
 
@@ -131,7 +130,8 @@
 
         """ See IGroupsPlugin.
         """
-        return tuple( self._principal_groups.get( principal.getId(), () ) )
+        unadorned = self._principal_groups.get( principal.getId(), () )
+        return tuple(['%s%s' % (self.prefix, x) for x in unadorned])
 
     #
     #   (notional)IZODBGroupManager interface
@@ -441,6 +441,11 @@
                                + '&manage_tabs_message=%s'
                                ) % ( self.absolute_url(), group_id, message )
                              )
+
+classImplements( ZODBGroupManager
+               , IGroupEnumerationPlugin
+               , IGroupsPlugin
+               )
 
 InitializeClass( ZODBGroupManager )
 


=== Products/PluggableAuthService/plugins/SessionAuthHelper.py 1.4 => 1.5 ===
--- Products/PluggableAuthService/plugins/SessionAuthHelper.py:1.4	Sat Nov 20 13:44:13 2004
+++ Products/PluggableAuthService/plugins/SessionAuthHelper.py	Wed Jul  6 14:49:05 2005
@@ -21,6 +21,7 @@
 from App.class_init import default__class_init__ as InitializeClass
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
+from Products.PluggableAuthService.utils import classImplements
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.interfaces.plugins import \
         ILoginPasswordHostExtractionPlugin, \
@@ -46,11 +47,6 @@
 
 class SessionAuthHelper(BasePlugin):
     """ Multi-plugin for managing details of Session Authentication. """
-    __implements__ = ( ILoginPasswordHostExtractionPlugin
-                     , ICredentialsUpdatePlugin
-                     , ICredentialsResetPlugin
-                     )
-
     meta_type = 'Session Auth Helper'
     security = ClassSecurityInfo()
 
@@ -97,13 +93,18 @@
         """ Respond to change of credentials. """
         request.SESSION.set('__ac_name', login)
         request.SESSION.set('__ac_password', new_password)
-        
+
     security.declarePrivate('resetCredentials')
     def resetCredentials(self, request, response):
         """ Empty out the currently-stored session values """
         request.SESSION.set('__ac_name', '')
         request.SESSION.set('__ac_password', '')
 
+classImplements( SessionAuthHelper
+               , ILoginPasswordHostExtractionPlugin
+               , ICredentialsUpdatePlugin
+               , ICredentialsResetPlugin
+               )
 
 InitializeClass(SessionAuthHelper)
 


=== Products/PluggableAuthService/plugins/SearchPrincipalsPlugin.py 1.3 => 1.4 ===
--- Products/PluggableAuthService/plugins/SearchPrincipalsPlugin.py:1.3	Thu Aug 12 11:15:54 2004
+++ Products/PluggableAuthService/plugins/SearchPrincipalsPlugin.py	Wed Jul  6 14:49:05 2005
@@ -29,6 +29,7 @@
 from AccessControl.SpecialUsers import emergency_user
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
+from Products.PluggableAuthService.utils import classImplements
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.interfaces.plugins import \
      IUserEnumerationPlugin, IGroupEnumerationPlugin
@@ -59,8 +60,6 @@
     security = ClassSecurityInfo()
     meta_type = 'Search Principals Plugin'
 
-    __implements__ = ( IUserEnumerationPlugin, IGroupEnumerationPlugin )
-
     _properties = ( { 'id' : 'delegate'
                     , 'label' : ' Delegate Path'
                     , 'type' : 'string'
@@ -126,6 +125,10 @@
                                , sort_by=sort_by
                                , max_results=max_results
                                , **kw )
-    
+
+classImplements( SearchPrincipalsPlugin
+               , IUserEnumerationPlugin
+               , IGroupEnumerationPlugin
+               )
 
 InitializeClass(SearchPrincipalsPlugin)


=== Products/PluggableAuthService/plugins/ScriptablePlugin.py 1.4 => 1.5 ===
--- Products/PluggableAuthService/plugins/ScriptablePlugin.py:1.4	Sat Nov 20 12:53:44 2004
+++ Products/PluggableAuthService/plugins/ScriptablePlugin.py	Wed Jul  6 14:49:05 2005
@@ -16,6 +16,7 @@
 
 $Id$
 """
+from sets import Set
 from urllib import quote_plus
 from OFS.Folder import Folder
 from AccessControl import ClassSecurityInfo
@@ -23,7 +24,8 @@
 from App.class_init import default__class_init__ as InitializeClass
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from BasePlugin import BasePlugin
-from Products.PluggableAuthService.utils import directlyProvides
+from Products.PluggableAuthService.utils import \
+     directlyProvides, classImplements, providedBy, implementedBy
 
 import Products
 
@@ -57,10 +59,8 @@
 
     meta_type = 'Scriptable Plugin'
 
-    __implements__ = Folder.__implements__ + BasePlugin.__implements__
-
     manage_options = ( ( Folder.manage_options[0], )
-                     + ( { 'label': 'Interfaces', 
+                     + ( { 'label': 'Interfaces',
                            'action': 'manage_editInterfacesForm', }
                          ,
                        )
@@ -69,7 +69,7 @@
 
     security.declareProtected( ManageUsers, 'manage_editInterfacesForm' )
     manage_editInterfacesForm = PageTemplateFile(
-        'www/spEditInterfaces', globals(), 
+        'www/spEditInterfaces', globals(),
         __name__='manage_editInterfacesForm')
 
     def __creatable_by_emergency_user__( self ):
@@ -79,6 +79,12 @@
         self._id = self.id = id
         self.title = title
 
+    security.declareProtected( ManageUsers, 'hasMethod')
+    def hasMethod(self, method_name):
+        """ Do we implement this method directly?
+        """
+        return method_name in self.objectIds()
+
     security.declarePublic('all_meta_types')
     def all_meta_types(self):
         """ What objects can be contained here? """
@@ -93,27 +99,24 @@
 
     security.declareProtected( ManageUsers, '_delOb' )
     def _delOb( self, id ):
-        """ 
+        """
             Override ObjectManager's _delOb to account for removing any
-            interface assertions the object might implement. 
+            interface assertions the object might implement.
         """
         myId = self.getId()
         pas_instance = self._getPAS()
         plugins = pas_instance._getOb( 'plugins' )
+        curr_interfaces = Set(providedBy(self))
 
-        del_interfaces = filter( lambda x: id in x.names()
-                               , self.__implements__ )
-
-        trimmed_interfaces = [ x for x in self.__implements__ if
-                               x not in ( del_interfaces +
-                                          self.__class__.__implements__ ) ]
+        del_interfaces = Set([x for x in providedBy(self) if id in x.names()])
 
         for interface in del_interfaces:
             if myId in plugins.listPluginIds( interface ):
                 plugins.deactivatePlugin( interface, myId )
 
         delattr( self, id )
-        directlyProvides( self, *trimmed_interfaces )
+
+        directlyProvides( self, *(list(curr_interfaces - del_interfaces)) )
 
     security.declareProtected( ManageUsers, 'manage_updateInterfaces' )
     def manage_updateInterfaces( self, interfaces, RESPONSE=None ):
@@ -127,12 +130,23 @@
         for interface in interfaces:
             new_interfaces.append( plugins._getInterfaceFromName( interface ) )
 
-        directlyProvides( self, *new_interfaces )
+        klass_interfaces = [x for x in implementedBy(ScriptablePlugin)]
+        directlyProvides( self, *(klass_interfaces + new_interfaces) )
 
         if RESPONSE is not None:
             RESPONSE.redirect('%s/manage_workspace'
                               '?manage_tabs_message='
                               'Interfaces+updated.'
                             % self.absolute_url())
+
+try:
+    from Products.Five.bridge import fromZ2Interface
+except ImportError:
+    ScriptablePlugin.__implements__ = (
+        Folder.__implements__ + BasePlugin.__implements__)
+else:
+    classImplements( ScriptablePlugin
+                   , *(implementedBy(Folder) + implementedBy(BasePlugin))
+                   )
 
 InitializeClass(ScriptablePlugin)


=== Products/PluggableAuthService/plugins/RecursiveGroupsPlugin.py 1.5 => 1.6 ===
--- Products/PluggableAuthService/plugins/RecursiveGroupsPlugin.py:1.5	Fri Oct  1 17:29:46 2004
+++ Products/PluggableAuthService/plugins/RecursiveGroupsPlugin.py	Wed Jul  6 14:49:05 2005
@@ -22,6 +22,7 @@
 from BTrees.OOBTree import OOBTree
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
+from Products.PluggableAuthService.utils import classImplements
 from Products.PluggableAuthService.PropertiedUser import PropertiedUser
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.interfaces.plugins \
@@ -63,8 +64,6 @@
 
     """ PAS plugin for recursively flattening a collection of groups
     """
-    __implements__ = ( IGroupsPlugin, )
-
     meta_type = 'Recursive Groups Plugin'
 
     security = ClassSecurityInfo()
@@ -96,3 +95,7 @@
                 set.extend( new_groups )
 
         return tuple( seen )
+
+classImplements( RecursiveGroupsPlugin, IGroupsPlugin )
+
+InitializeClass(RecursiveGroupsPlugin)


=== Products/PluggableAuthService/plugins/LocalRolePlugin.py 1.4 => 1.5 ===
--- Products/PluggableAuthService/plugins/LocalRolePlugin.py:1.4	Sat Nov 20 12:46:27 2004
+++ Products/PluggableAuthService/plugins/LocalRolePlugin.py	Wed Jul  6 14:49:05 2005
@@ -25,6 +25,8 @@
 
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 
+from Products.PluggableAuthService.utils import classImplements
+
 manage_addLocalRolePluginForm = PageTemplateFile(
     'www/lrpAdd', globals(), __name__='manage_addLocalRolePluginForm' )
 
@@ -45,8 +47,6 @@
         assignments made on the root object.
     """
 
-    __implements__ = BasePlugin.__implements__ + ( IRolesPlugin, )
-    
     meta_type = 'Local Role Plugin'
     security = ClassSecurityInfo()
 
@@ -69,6 +69,6 @@
             return None
         return local_roles.get( principal.getId() )
 
-InitializeClass( LocalRolePlugin )
+classImplements( LocalRolePlugin, IRolesPlugin )
 
-    
+InitializeClass( LocalRolePlugin )


=== Products/PluggableAuthService/plugins/InlineAuthHelper.py 1.3 => 1.4 ===
--- Products/PluggableAuthService/plugins/InlineAuthHelper.py:1.3	Sun Oct 17 04:27:32 2004
+++ Products/PluggableAuthService/plugins/InlineAuthHelper.py	Wed Jul  6 14:49:05 2005
@@ -26,6 +26,7 @@
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.PageTemplates.ZopePageTemplate import manage_addPageTemplate
 
+from Products.PluggableAuthService.utils import classImplements
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.interfaces.plugins import \
         ILoginPasswordHostExtractionPlugin, IChallengePlugin,  \
@@ -54,10 +55,6 @@
 
 class InlineAuthHelper(Folder, BasePlugin):
     """ Multi-plugin for managing details of Inline Authentication. """
-    __implements__ = ( ILoginPasswordHostExtractionPlugin
-                     , IChallengePlugin
-                     )
-
     meta_type = 'Inline Auth Helper'
     security = ClassSecurityInfo()
 
@@ -117,6 +114,11 @@
 
     def _setBody(self, body, *args, **kw):
         pass
+
+classImplements( InlineAuthHelper
+               , ILoginPasswordHostExtractionPlugin
+               , IChallengePlugin
+               )
 
 InitializeClass(InlineAuthHelper)
 


=== Products/PluggableAuthService/plugins/HTTPBasicAuthHelper.py 1.7 => 1.8 ===
--- Products/PluggableAuthService/plugins/HTTPBasicAuthHelper.py:1.7	Sat Oct 16 16:15:47 2004
+++ Products/PluggableAuthService/plugins/HTTPBasicAuthHelper.py	Wed Jul  6 14:49:05 2005
@@ -23,6 +23,7 @@
 from App.class_init import default__class_init__ as InitializeClass
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
+from Products.PluggableAuthService.utils import classImplements
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.interfaces.plugins import \
         ILoginPasswordHostExtractionPlugin, \
@@ -52,11 +53,6 @@
 
     """ Multi-plugin for managing details of HTTP Basic Authentication.
     """
-    __implements__ = ( ILoginPasswordHostExtractionPlugin
-                     , IChallengePlugin
-                     , ICredentialsResetPlugin
-                     )
-
     meta_type = 'HTTP Basic Auth Helper'
 
     security = ClassSecurityInfo()
@@ -116,5 +112,11 @@
         """
         # XXX:  Does this need to check whether we have an HTTP response?
         response.unauthorized()
+
+classImplements( HTTPBasicAuthHelper
+               , ILoginPasswordHostExtractionPlugin
+               , IChallengePlugin
+               , ICredentialsResetPlugin
+               )
 
 InitializeClass( HTTPBasicAuthHelper )


=== Products/PluggableAuthService/plugins/DynamicGroupsPlugin.py 1.4 => 1.5 ===
--- Products/PluggableAuthService/plugins/DynamicGroupsPlugin.py:1.4	Mon Nov  8 17:35:45 2004
+++ Products/PluggableAuthService/plugins/DynamicGroupsPlugin.py	Wed Jul  6 14:49:05 2005
@@ -40,7 +40,7 @@
 
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 
-from Products.PluggableAuthService.utils import createViewName
+from Products.PluggableAuthService.utils import createViewName, classImplements
 
 
 manage_addDynamicGroupsPluginForm = PageTemplateFile(
@@ -178,7 +178,6 @@
 
       'request' -- the request object.
     """
-    __implements__ = ( IGroupsPlugin, IGroupEnumerationPlugin )
     meta_type = 'Dynamic Groups Plugin'
 
     security = ClassSecurityInfo()
@@ -196,11 +195,12 @@
 
         """ See IGroupsPlugin.
         """
+        grps = []
         DGD = DynamicGroupDefinition.meta_type
-        return[ group.getId() for  group in self.objectValues( DGD )
-                    if group.active and group( principal, request ) ]
-
-
+        for group in self.objectValues( DGD ):
+            if group.active and group( principal, request ):
+                grps.append('%s%s' % (self.prefix, group.getId()))
+        return grps
 
     security.declareProtected( ManageGroups, 'enumerateGroups' )
     def enumerateGroups( self
@@ -257,6 +257,8 @@
             info[ 'properties_url' ] = url
             info[ 'members_url' ] = url
 
+            info[ 'id' ] = '%s%s' % (self.prefix, info['id'])
+
             if not group_filter or group_filter( info ):
                 if info[ 'active' ]:
                     group_info.append( info )
@@ -295,7 +297,10 @@
         try:
             original = self._getOb( group_id )
         except AttributeError:
-            raise KeyError, group_id
+            try:
+                original = self._getOb( group_id[len(self.prefix):] )
+            except AttributeError:
+                raise KeyError, group_id
 
         if not isinstance( original, DynamicGroupDefinition ):
             raise KeyError, group_id
@@ -502,6 +507,11 @@
             RESPONSE.redirect( '%s/manage_groups?manage_tabs_message=%s'
                              % ( self.absolute_url(), message )
                              )
+
+classImplements( DynamicGroupsPlugin
+               , IGroupsPlugin
+               , IGroupEnumerationPlugin
+               )
 
 InitializeClass( DynamicGroupsPlugin )
 


=== Products/PluggableAuthService/plugins/DomainAuthHelper.py 1.4 => 1.5 ===
--- Products/PluggableAuthService/plugins/DomainAuthHelper.py:1.4	Mon Aug 30 09:22:41 2004
+++ Products/PluggableAuthService/plugins/DomainAuthHelper.py	Wed Jul  6 14:49:05 2005
@@ -29,6 +29,7 @@
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 # PluggableAuthService imports
+from Products.PluggableAuthService.utils import classImplements
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.interfaces.plugins import \
     IAuthenticationPlugin, IRolesPlugin
@@ -56,8 +57,6 @@
     security = ClassSecurityInfo()
     meta_type = 'Domain Authentication Plugin'
 
-    __implements__ = (IAuthenticationPlugin, IRolesPlugin)
-
     security.declareProtected(manage_users, 'manage_map')
     manage_map = PageTemplateFile('www/daMatches', globals())
 
@@ -292,6 +291,10 @@
             else:
                 return self.manage_genericmap(manage_tabs_message=msg)
 
+classImplements( DomainAuthHelper
+               , IAuthenticationPlugin
+               , IRolesPlugin
+               )
 
 InitializeClass(DomainAuthHelper)
 


=== Products/PluggableAuthService/plugins/DelegatingMultiPlugin.py 1.4 => 1.5 ===
--- Products/PluggableAuthService/plugins/DelegatingMultiPlugin.py:1.4	Mon Aug 30 09:22:41 2004
+++ Products/PluggableAuthService/plugins/DelegatingMultiPlugin.py	Wed Jul  6 14:49:05 2005
@@ -31,6 +31,7 @@
 from AccessControl.SpecialUsers import emergency_user
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
+from Products.PluggableAuthService.utils import classImplements
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.interfaces.plugins import \
     IAuthenticationPlugin, IUserEnumerationPlugin, IRolesPlugin, \
@@ -66,11 +67,6 @@
     security = ClassSecurityInfo()
     meta_type = 'Delegating Multi Plugin'
 
-    __implements__ = ( IAuthenticationPlugin, IUserEnumerationPlugin
-                     , IRolesPlugin, ICredentialsUpdatePlugin
-                     , ICredentialsResetPlugin, IPropertiesPlugin
-                     )
-
     manage_options = ( BasePlugin.manage_options[:1]
                      + Folder.manage_options
                      )
@@ -236,6 +232,15 @@
                     pass
 
         return tuple(result)
+
+classImplements( DelegatingMultiPlugin
+               , IAuthenticationPlugin
+               , IUserEnumerationPlugin
+               , IRolesPlugin
+               , ICredentialsUpdatePlugin
+               , ICredentialsResetPlugin
+               , IPropertiesPlugin
+               )
 
 
 InitializeClass(DelegatingMultiPlugin)


=== Products/PluggableAuthService/plugins/CookieAuthHelper.py 1.14 => 1.15 ===
--- Products/PluggableAuthService/plugins/CookieAuthHelper.py:1.14	Thu Feb  3 19:31:00 2005
+++ Products/PluggableAuthService/plugins/CookieAuthHelper.py	Wed Jul  6 14:49:05 2005
@@ -27,6 +27,7 @@
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
 
+from Products.PluggableAuthService.utils import classImplements
 from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
 from Products.PluggableAuthService.interfaces.plugins import \
         ILoginPasswordHostExtractionPlugin, IChallengePlugin,  \
@@ -56,11 +57,6 @@
 
 class CookieAuthHelper(Folder, BasePlugin):
     """ Multi-plugin for managing details of Cookie Authentication. """
-    __implements__ = ( ILoginPasswordHostExtractionPlugin
-                     , IChallengePlugin
-                     , ICredentialsUpdatePlugin
-                     , ICredentialsResetPlugin
-                     )
 
     meta_type = 'Cookie Auth Helper'
     cookie_name = '__ginger_snap'
@@ -240,6 +236,12 @@
 
         return response.redirect(came_from)
 
+classImplements( CookieAuthHelper
+               , ILoginPasswordHostExtractionPlugin
+               , IChallengePlugin
+               , ICredentialsUpdatePlugin
+               , ICredentialsResetPlugin
+               )
 
 InitializeClass(CookieAuthHelper)
 


=== Products/PluggableAuthService/plugins/BasePlugin.py 1.5 => 1.6 ===
--- Products/PluggableAuthService/plugins/BasePlugin.py:1.5	Fri May 27 14:55:45 2005
+++ Products/PluggableAuthService/plugins/BasePlugin.py	Wed Jul  6 14:49:05 2005
@@ -25,6 +25,7 @@
 
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
+from Products.PluggableAuthService.utils import classImplements, implementedBy
 from Products.PluggableAuthService.permissions import ManageUsers
 
 class BasePlugin(SimpleItem, PropertyManager):
@@ -34,8 +35,6 @@
 
     security = ClassSecurityInfo()
 
-    __implements__ = SimpleItem.__implements__
-
     manage_options = ( ( { 'label': 'Activate',
                            'action': 'manage_activateInterfacesForm', }
                          ,
@@ -104,5 +103,14 @@
     def _getPAS( self ):
         """ Canonical way to get at the PAS instance from a plugin """
         return aq_parent( aq_inner( self ) )
+
+try:
+    from Products.Five.bridge import fromZ2Interface
+except ImportError:
+    BasePlugin.__implements__ = SimpleItem.__implements__
+else:
+    classImplements( BasePlugin
+                   , *implementedBy(SimpleItem)
+                   )
 
 InitializeClass(BasePlugin)



More information about the Zope-CVS mailing list