0

I'm developing a simple troubleshooting menu on Drupal 7 to allow users request a new password or cancel their account depending on some factor. To do so I basically call

$mail = drupal_mail('user', $op, $account->mail, $language, $params);

using the corresponding $op.

I have a problem with the most basic thing, which is accessing the account cancellation form after sending the email with the corresponding URL. The cancellation page keeps giving me "Access denied", even if I am admin.

I checked the permissions and I've already allowed all users to "Cancel own user account", so that's discarded.

The emails are going through just fine and sending a one-time-login-link worked flawlessly. I just can't seem to open the account cancellation link.

Any ideas?

  • Are those user(s) already authenticated when they click the link? – Kevin Jan 16 at 15:50
  • yes. I am precisely using drupal_mail instead of _user_mail_notify to avoid problems with users who haven't validated their account and are still blocked. – Cándido Otero Jan 16 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.