[Checkins]
SVN: PluggableAuthService/branches/z3-events/PluggableAuthService.py
Fire some events
Wichert Akkerman
wichert at wiggy.net
Sun Dec 3 08:33:41 EST 2006
Log message for revision 71384:
Fire some events
Changed:
U PluggableAuthService/branches/z3-events/PluggableAuthService.py
-=-
Modified: PluggableAuthService/branches/z3-events/PluggableAuthService.py
===================================================================
--- PluggableAuthService/branches/z3-events/PluggableAuthService.py 2006-12-03 13:27:29 UTC (rev 71383)
+++ PluggableAuthService/branches/z3-events/PluggableAuthService.py 2006-12-03 13:33:40 UTC (rev 71384)
@@ -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(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(login, new_password))
+
+
security.declarePublic('logout')
def logout(self, REQUEST):
"""Publicly accessible method to log out a user
More information about the Checkins
mailing list