Account unblocked too early
modctek - September 18, 2008 - 21:59
| Project: | Invite |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs review |
Description
With my website user account creation settings set to to "requires admin approval" and using the Invitation module, my invitees are able to create an account, after which they receive the standard "your account is pending admin approval." However, on the website, the accounts are listed as active. The only way I can force the website to send the initial login email with the one-time link is to block, then unblock the new accounts. Is this by design?

#1
This looks like a bug, will have to investigate.
#2
Judging by the following code in
_invite_accept(), this appears to be by design;<?php// Unblock user account.
db_query("UPDATE {users} SET status = 1 WHERE uid = %d", $account->uid);
?>
But I can't imagine why this would make sense. Possibly because the user's email address has already been confirmed, but clicking the invite email? This doesn't make sense though either, since the user may have registered using a different email address to the one the invite was sent to.
I'm happy to patch this and have time over the next few days. Please advise the best way forward.
#3
#4
#5
In a patch file...