#45 — password reset not working

State In progress
Version:
Area Functionality
Issue type Bug
Severity Important
Submitted by Michael Redmann
Submitted on Aug 01, 2007
Responsible Ross Patterson
Target release:
Plone 3.0 rc2, membrane trunk, remember trunk

When trying to reset the password for a user registered with member_auto_workflow an error is thrown:

Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Products.CMFFormController.FSControllerPageTemplate, line 90, in __call__
  Module Products.CMFFormController.BaseControllerPageTemplate, line 28, in _call
  Module Products.CMFFormController.ControllerBase, line 232, in getNext
   - __traceback_info__: ['id = prefs_users_overview', 'status = success', 'button=Modify', 'errors={}', 'context=<PloneSite at Plone>', 'kwargs={}', 'next_action=None', '']
  Module Products.CMFFormController.Actions.TraverseTo, line 38, in __call__
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Products.CMFFormController.FSControllerPythonScript, line 104, in __call__
  Module Products.CMFFormController.Script, line 145, in __call__
  Module Products.CMFCore.FSPythonScript, line 140, in __call__
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.CMFCore.FSPythonScript, line 196, in _exec
  Module None, line 29, in prefs_user_manage
   - <FSControllerPythonScript at /Plone/prefs_user_manage>
   - Line 29
  Module Products.remember.tools.registration, line 95, in mailPassword
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.CMFCore.FSPageTemplate, line 216, in _exec
  Module Products.CMFCore.FSPageTemplate, line 155, in pt_render
  Module Products.PageTemplates.PageTemplate, line 89, in pt_render
  Module zope.pagetemplate.pagetemplate, line 117, in pt_render
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 586, in do_setLocal_tal
  Module zope.tales.tales, line 696, in evaluate
   - URL: file:/opt/Plone-3.0/zinstance/Products/PasswordResetTool/skins/PasswordReset/mail_password_template.pt
   - Line 1, Column 0
   - Expression: <PythonExpr request.RESPONSE.setHeader('Content-Type', 'text/plain; charset=%s' % options['charset'])>
   - Names:
      {'container': <PloneSite at /Plone>,
       'context': <RegistrationTool at /Plone/portal_registration>,
       'default': <object object at 0xb7c72528>,
       'here': <RegistrationTool at /Plone/portal_registration>,
       'loop': {},
       'nothing': None,
       'options': {'args': (<RegistrationTool at /Plone/portal_registration>,
                            <HTTPRequest, URL=http://192.168.0.103:8080/Plone/prefs_users_overview>),
                   'member': <SampleRemember at /Plone/portal_memberdata/test01 used for /Plone/acl_users>,
                   'member_email': 'ubuntu@test.com',
                   'member_id': 'test01'},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xc52e10c>,
       'request': <HTTPRequest, URL=http://192.168.0.103:8080/Plone/prefs_users_overview>,
       'root': <Application at >,
       'template': <FSPageTemplate at /Plone/mail_password_template used for /Plone/portal_registration>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>}
  Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
   - __traceback_info__: request.RESPONSE.setHeader('Content-Type', 'text/plain; charset=%s' % options['charset'])
  Module PythonExpr, line 1, in <expression>
  Module AccessControl.ZopeGuards, line 67, in guarded_getitem
KeyError: 'charset'
Steps to reproduce:
Plone 3.0 rc2, membrane trunk, remember trunk
install SampleMember
self register testuser
try to reset password
Added by Michael Redmann on Aug 21, 2007 07:44 PM
Same error with Plone 3.0 final and current membrane/remember-trunks
Added by Michael Redmann on Sep 16, 2007 09:34 PM
Current Setup: Plone-3.0.1, remember trunk, membrane trunk - same problem ...

The error seems to be caused by some wrong parameters in the call to mail_password_template in:
remember/tools/registration.py

With the attached patch, password reset is working again. It also seems to work without the complete 'mailPassword' function, which is overwriting 'mailPassword' of RegistrationTool.py, what is the pitfall here ?

ok - it is only working nearly with the applied patch :) - the next error comes when a user-profile is not public but private ... problem seems to be that portal_skins/PasswordReset/mail_password_template can't access the member-information of a private user-profile.

As a workaround i put variables with email and fullname information in the call to mail_password_template and customize mail_password_template to use these parameters instead of trying to query them by itself.

Any other solution ?




Added by Ross Patterson on Feb 26, 2010 11:18 AM
Issue state: UnconfirmedConfirmed
Severity: MediumImportant
Responsible manager: (UNASSIGNED)rossp
Target release: None2.0
I've added test coverage for password reset to trunk a while ago and fixed the bugs. It will be released with 2.0.
Added by Ross Patterson on Feb 26, 2010 11:21 AM
Issue state: ConfirmedIn progress

No responses can be added.