Posted by modctek on September 18, 2008 at 9:59pm
| Project: | Invite |
| Version: | 6.x-2.0-beta2 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
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?
Comments
#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...
#6
Hi: I need this patch, or some other way to address this bug.
However the patch seems to be meant to apply against invite.module 1.25.2.6. But the version in the alpha1 release on the project page seems to be 1.25.2.5
So, I am wondering if this is meant to be applied to the alpha1 version, or to some now outdated dev version.
I am also wondering how come there has been no action on this thread for 6 months. This seems a pretty major bug. Is the module being supported? Any tips how to get a module that does not suffer from this problem?
Help would be really appreciated from any knowledgeable drupalite.
#7
Hello,
I was wondering if this is still an issue?
#8
6.X-2.x-beta2 without the patch by Bevan
Accouun state "Active" emediatly after invitation acceptation. Setting "requires admin aproval" has no effect.
#9
patching of invite.module failed
the bug was solved in Invite 5.x-1.6, 2007-03-12
- Fixed unblocking of new user accounts, which was not limited to invite only
mode. This broke sites where administrator approval for new user accounts is
required.
#10
Kindly bumping.
#11
Agreed this definitely needs looking at. I have exactly the same setup detailed by OP.
Patch at #5 works perfectly - thanks Bevan.
However, I'm not sure why this was there in the first place. It does look like this has been around for ages...since version 5...see here: http://drupal.org/node/118313
So I'm guessing that this line must do something useful ;-)
Anyway, perhaps the way forward is to change invite.module invite_process function to something like this:
function invite_process($invite, $account) {
// Update the invitation record.
db_query("UPDATE {invite} SET email = '%s', invitee = %d, joined = %d WHERE reg_code = '%s'", $account->mail, $account->uid, time(), $invite->reg_code);
// Delete all invites to these e-mail addresses, except this one.
db_query("DELETE FROM {invite} WHERE (email = '%s' OR email = '%s') AND reg_code <> '%s'", $invite->email, $account->mail, $invite->reg_code);
// Add all users who invited this particular e-mail address to the
// notification queue.
db_query("INSERT INTO {invite_notifications} (uid, invitee) SELECT uid, %d from {invite} WHERE (email = '%s' OR email = '%s') AND canceled = 0", $account->uid, $invite->email, $account->mail);
// Unblock the user account if users are able to register with no approval.
if (variable_get('user_register','') == 1 {
db_query("UPDATE {users} SET status = 1 WHERE uid = %d", $account->uid);
}
// Determine target roles for invited user.
$roles = invite_target_roles($invite);
// Allow other modules to act on the role escalation.
$args = array('invitee' => $account, 'inviter' => $invite->inviter, 'roles' => &$roles);
module_invoke_all('invite', 'escalate', $args);
return $roles;
}
Cheers,
Crom