[ZCM] [ZC] 836/ 1 Request "Changing password from acl_users fails using 2.6.0-->2.6.1 patch"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin@zope.org
Tue, 04 Mar 2003 23:06:49 -0500


Issue #836 Update (Request) "Changing password from acl_users fails using 2.6.0-->2.6.1 patch"
 Status Pending, Zope/bug+solution medium
To followup, visit:
  http://collector.zope.org/Zope/836

==============================================================
= Request - Entry #1 by ernieong on Mar 4, 2003 11:06 pm


Uploaded:  "User.py"
 - http://collector.zope.org/Zope/836/User.py/view
Problem
=======

When changing a user's password via the acl_users/manage_users, upon submitting the form for a particular user (eg. updated password), the script fails. Here's the traceback:

<BEGIN>
    *  Module ZPublisher.Publish, line 98, in publish
    * Module ZPublisher.mapply, line 88, in mapply
    * Module ZPublisher.Publish, line 39, in call_object
    * Module AccessControl.User, line 943, in manage_users
    * Module AccessControl.User, line 900, in _changeUser
    * Module AccessControl.User, line 1037, in _doChangeUser

NameError: global name 'pw' is not defined
<END>

Solution
========

I _think_ I found the solution - the problem has not recurred since - but it really requires further testing. The problem lies with line 1037 of lib\python\AccessControl\User.py (see traceback above).

Changing it from: if self.encrypt_passwords and not self._isPasswordEncrypted(pw):

to: if self.encrypt_passwords and not self._isPasswordEncrypted(password):

solves the problem.

I've attached the revised version below.

cheers,
ernie.

==============================================================