[CMF-checkins] SVN: CMF/trunk/CMF - fixed credentialsChanged (don't use self.REQUEST)

Yvo Schubbe y.2007- at wcm-solutions.de
Sun Jun 24 03:55:56 EDT 2007


Log message for revision 77003:
  - fixed credentialsChanged (don't use self.REQUEST)

Changed:
  U   CMF/trunk/CMFCore/MembershipTool.py
  U   CMF/trunk/CMFCore/interfaces/_tools.py
  U   CMF/trunk/CMFDefault/skins/zpt_control/change_password.py

-=-
Modified: CMF/trunk/CMFCore/MembershipTool.py
===================================================================
--- CMF/trunk/CMFCore/MembershipTool.py	2007-06-24 07:49:57 UTC (rev 77002)
+++ CMF/trunk/CMFCore/MembershipTool.py	2007-06-24 07:55:55 UTC (rev 77003)
@@ -316,21 +316,23 @@
         return _checkPermission(permissionName, object)
 
     security.declarePublic('credentialsChanged')
-    def credentialsChanged(self, password):
+    def credentialsChanged(self, password, REQUEST=None):
         '''
         Notifies the authentication mechanism that this user has changed
         passwords.  This can be used to update the authentication cookie.
         Note that this call should *not* cause any change at all to user
         databases.
         '''
+        if REQUEST is None:
+            raise TypeError('new REQUEST argument required')
+
         if not self.isAnonymousUser():
             acl_users = self.acl_users
             user = _getAuthenticatedUser(self)
             name = user.getUserName()
             # this really does need to be the user name, and not the user id,
             # because we're dealing with authentication credentials
-            req = self.REQUEST
-            p = getattr(req, '_credentials_changed_path', None)
+            p = getattr(REQUEST, '_credentials_changed_path', None)
             if p is not None:
                 # Use an interface provided by CookieCrumbler.
                 change = self.restrictedTraverse(p)

Modified: CMF/trunk/CMFCore/interfaces/_tools.py
===================================================================
--- CMF/trunk/CMFCore/interfaces/_tools.py	2007-06-24 07:49:57 UTC (rev 77002)
+++ CMF/trunk/CMFCore/interfaces/_tools.py	2007-06-24 07:55:55 UTC (rev 77003)
@@ -683,7 +683,7 @@
         o Permission:  Public
         """
 
-    def credentialsChanged(password):
+    def credentialsChanged(password, REQUEST=None):
         """ Notify the authentication mechanism that this user has
             changed passwords.
 

Modified: CMF/trunk/CMFDefault/skins/zpt_control/change_password.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_control/change_password.py	2007-06-24 07:49:57 UTC (rev 77002)
+++ CMF/trunk/CMFDefault/skins/zpt_control/change_password.py	2007-06-24 07:55:55 UTC (rev 77003)
@@ -16,6 +16,6 @@
 if member.getProperty('last_login_time') == DateTime('1999/01/01'):
     member.setProperties(last_login_time='2000/01/01')
 
-mtool.credentialsChanged(password)
+mtool.credentialsChanged(password, context.REQUEST)
 
 return context.setStatus(True, _(u'Password changed.'))



More information about the CMF-checkins mailing list