Account activation triggers both Account activation email and Password Recovery email
tomho - October 15, 2009 - 18:34
| Project: | Password policy |
| Version: | 6.x-1.0-alpha2 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs review |
Description
When password policy module is installed, my drupal setup is sending off both Account activation email and password recovery email to new users who got their accounts set from "block" to "active" state.
Deleting the password rules i set in the password policy module did not fix it, once i uninstalled the module the behaviour goes back to normal.
Anyone know a quick fix?
Thanks,
Tom

#1
#2
Has anyone looked at this?
Seems like a really critical bug if it is triggering wrong emails.
#3
Confirmed, happens only when unblocked from /user/%/edit, doesn't when done via /admin/user/expired or bulk operations, the culprit is call to
_password_policy_unblock()from op inhook_user(), which is redundant since in D6 there is following code inuser_save():<?php// Send emails after we have the new user object.
if (isset($array['status']) && $array['status'] != $account->status) {
// The user's status is changing; conditionally send notification email.
$op = $array['status'] == 1 ? 'status_activated' : 'status_blocked';
_user_mail_notify($op, $user);
}
?>
Attached patch fixes that, also changed
_password_policy_unblock()for consistency.#4
Forgot to check status.