[Checkins] SVN: PluggableAuthService/branches/z3-events/ Merge our
previous changes
Wichert Akkerman
wichert at wiggy.net
Sat Jun 9 06:36:31 EDT 2007
Log message for revision 76535:
Merge our previous changes
Changed:
U PluggableAuthService/branches/z3-events/PluggableAuthService.py
A PluggableAuthService/branches/z3-events/events.py
-=-
Modified: PluggableAuthService/branches/z3-events/PluggableAuthService.py
===================================================================
--- PluggableAuthService/branches/z3-events/PluggableAuthService.py 2007-06-09 10:35:29 UTC (rev 76534)
+++ PluggableAuthService/branches/z3-events/PluggableAuthService.py 2007-06-09 10:36:31 UTC (rev 76535)
@@ -45,18 +45,15 @@
from ZTUtils import Batch
from App.class_init import default__class_init__ as InitializeClass
-try:
- from OFS.interfaces import IObjectManager
- from OFS.interfaces import ISimpleItem
- from OFS.interfaces import IPropertyManager
-except ImportError: # BBB
- from Products.Five.interfaces import IObjectManager
- from Products.Five.interfaces import ISimpleItem
- from Products.Five.interfaces import IPropertyManager
+from OFS.interfaces import IObjectManager
+from OFS.interfaces import ISimpleItem
+from OFS.interfaces import IPropertyManager
from Products.PluginRegistry.PluginRegistry import PluginRegistry
import Products
+from zope import event
+
from interfaces.authservice import IPluggableAuthService
from interfaces.authservice import _noroles
from interfaces.plugins import IExtractionPlugin
@@ -80,6 +77,9 @@
from interfaces.plugins import IChallengeProtocolChooser
from interfaces.plugins import IRequestTypeSniffer
+from events import UserCreated
+from events import UserCredentialsUpdated
+
from permissions import SearchPrincipals
from PropertiedUser import PropertiedUser
@@ -955,6 +955,9 @@
)
pass
+ event.notify(UserCreated(self, user.getId(), login))
+
+
security.declarePublic('all_meta_types')
def all_meta_types(self):
""" What objects can be put in here?
@@ -1093,6 +1096,10 @@
for updater_id, updater in cred_updaters:
updater.updateCredentials(request, response, login, new_password)
+ # XXX this uses the login name instead of the principal ID!
+ event.notify(UserCredentialsUpdated(self, login, new_password))
+
+
security.declarePublic('logout')
def logout(self, REQUEST):
"""Publicly accessible method to log out a user
Added: PluggableAuthService/branches/z3-events/events.py
===================================================================
--- PluggableAuthService/branches/z3-events/events.py (rev 0)
+++ PluggableAuthService/branches/z3-events/events.py 2007-06-09 10:36:31 UTC (rev 76535)
@@ -0,0 +1,40 @@
+from zope.interface import implements
+from interfaces.events import *
+
+class PASEvent(object):
+ implements(IPASEvent)
+
+ def __init__(self, acl_users, id):
+ self.acl_users=acl_users
+ self.id=id
+
+
+class UserCreated(PASEvent):
+ implements(IUserCreated)
+
+ def __init__(self, acl_users, id, login):
+ self.acl_users=acl_users
+ self.id=id
+ self.login=login
+
+
+class UserDeleted(PASEvent):
+ implements(IUserDeleted)
+
+
+class UserCredentialsUpdated(PASEvent):
+ implements(IUserCredentialsUpdated)
+
+ def __init__(self, acl_users, id, password):
+ self.acl_users=acl_users
+ self.id=id
+ self.password=password
+
+
+class UserPropertiesUpdated(PASEvent):
+ implements(IUserPropertiesUpdated)
+
+ def __init__(self, acl_users, id, properties):
+ self.acl_users=acl_users
+ self.id=id
+ self.properties=properties
Property changes on: PluggableAuthService/branches/z3-events/events.py
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the Checkins
mailing list