Ticket #1711 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

A user loses his credentials if change his password from the directory

Reported by: tracguest Assigned to: fguillaume
Priority: P2 Milestone: CPS 3.4.4
Component: CPSDirectory Version: 3.4.0
Severity: normal Keywords:
Cc:

Description

When a user change his password from the directory loses his credentials and a window login is shown by the web browser.

There are two solutions:

* In the function renderEditEntryDetailed of BaseDirectory?.py add the following italic lines

            if not ds.hasError(id_field) and dm.data[id_field] != id:
                ds.setError(id_field, 'cpsschemas_err_readonly')
                ok = 0
            if ok:
                dm._commit()
            else:
                layout_mode = layout_mode_err
             
            # If the user has changed his password, send the credentials again
            ''name = self.portal_membership.getAuthenticatedMember().getId()
            if request.form['id'] == name:
                if request.form['widget__confirm'] != '':
                   self.cookie_authentication.credentialsChanged('', name, request["widget__confirm"])''                
          
        else:
            ok = 1
        rendered = self._renderLayout(layout_structure, ds,
                                      layout_mode=layout_mode, ok=ok, **kw)

* The other solutions is modify the page template cpsdirectory_entry_edit_form.pt adding the following lines at the end of the first "tal:block define":

  user_name python: context.portal_membership.getAuthenticatedMember().getId();
  same_user python: validate and request['id'] == user_name or nothing;
  credentials_changed python: same_user and request['widget__confirm'] != '' or nothing;
  dummy python: credentials_changed and context.cookie_authentication.credentialsChanged('', user_name, request['widget__confirm']) or nothing;

Change History

03/13/07 11:46:31 changed by div

  • status changed from new to closed.
  • resolution set to fixed.

Fixed by [51325]

03/13/07 11:47:46 changed by madarche

  • milestone changed from CPS 3.4.5 to CPS 3.4.4.