[Zope-CMF] Password Changing

Tres Seaver tseaver@palladion.com
Tue, 9 Oct 2001 06:13:01 -0400 (EDT)


On Tue, 9 Oct 2001, Kenneth Bolton wrote:

> Hi all,
> 
> I have 2 (two) different zope 2.4.1 sites running CMF 1.1. In both 
> cases, the password_form bonks when I try to change the users password. 
> change_password returns:
> 
> Error Type: NameError
> Error Value: global name 'has' is not defined
> 
> Traceback (innermost last):
>    File /home/ken/Zope-2.4.0-src/lib/python/ZPublisher/Publish.py, line 
> 223, in publish_module
>    File /home/ken/Zope-2.4.0-src/lib/python/ZPublisher/Publish.py, line 
> 187, in publish
>    File /home/ken/Zope-2.4.0-src/lib/python/Zope/__init__.py, line 226, 
> in zpublisher_exception_hook
>      (Object: LockableItem)
>    File /home/ken/Zope-2.4.0-src/lib/python/ZPublisher/Publish.py, line 
> 171, in publish
>    File /home/ken/Zope-2.4.0-src/lib/python/ZPublisher/mapply.py, line 
> 160, in mapply
>      (Object: change_password)
>    File /home/ken/Zope-2.4.0-src/lib/python/ZPublisher/Publish.py, line 
> 112, in call_object
>      (Object: change_password)
>    File 
> /home/ken/Zope-2.4.0-src/lib/python/Shared/DC/Scripts/Bindings.py, line 
> 324, in __call__
>      (Object: change_password)
>    File 
> /home/ken/Zope-2.4.0-src/lib/python/Shared/DC/Scripts/Bindings.py, line 
> 354, in _bindAndExec
>      (Object: change_password)
>    File 
> /home/ken/Zope-2.4.0-src/lib/python/Products/CMFCore/FSPythonScript.py, 
> line 187, in _exec
>      (Object: change_password)
>      (Info: ({'script': <FSPythonScript instance at 8323468>, 'context': 
> <CMFSite instance at 9746e80>, 'container': <CMFSite instance at 
> 9746e80>, 'traverse_subpath': []}, ('password', 'password', []), {}, 
> (None,)))
>    File Script (Python), line 9, in change_password
>    File 
> /home/ken/Zope-2.4.0-src/lib/python/Products/CMFCore/MembershipTool.py, 
> line 354, in credentialsChanged
>      (Object: portal_membership)
>    File /home/ken/Zope-2.4.0-src/lib/python/OFS/Traversable.py, line 233, 
> in restrictedTraverse
>      (Object: portal_membership)
>    File /home/ken/Zope-2.4.0-src/lib/python/OFS/Traversable.py, line 193, 
> in unrestrictedTraverse
>      (Object: ApplicationDefaultPermissions)
> NameError: (see above)
> 
> Has anyone else had this problem? How did you fix it?

This is a bug in Zope 2.4, already fixed in CVS.  Here is the
patch:

--- Zope/lib/python/OFS/Traversable.py  2001/08/30 13:07:49     1.8.4.2
+++ Zope/lib/python/OFS/Traversable.py  2001/09/11 14:29:30     1.8.4.3
@@ -142,6 +142,7 @@
         if not path: return self
 
         get=getattr
+        has=hasattr
         N=None
         M=_marker


Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com