To duplicate, invite a user. Then, once the user has accepted the invitation and registered, go in and delete the user account. If you go into the Invite page, there should be a button to delete the invitation, but it is not there. This happens when the "Allow deletion of joined users" option is checked. I already saw this: http://drupal.org/node/85708, but this article applies to the 4.7 vers right?

CommentFileSizeAuthor
#4 invite-delete.47.patch9.68 KBsmk-ka
#3 invite_delete.5.patch9.66 KBsmk-ka

Comments

smk-ka’s picture

Assigned: Unassigned » smk-ka

IMHO, the invitation should be deleted together with the user account, as this would allow us to trigger a 'cancel' event via the Invite API. For example, the userpoints module would then decrease the points the referrer once received when the invitation was sent and/or the invitee registered.

However, a deeper look at the invite module reveals several flaws that need to be addressed, so this patch will be a bigger one attempting to generally clean the code a bit.
--
Stefan Kudwien
www.unleashedmind.com

smk-ka’s picture

The list of changes:

  • Invite.module now properly reacts on the delete user event and removes invited users and the user in question from the invite table. This will additionally cause a 'cancel' event to be fired by the Invite API.
  • Registered users are now deleted by their user id, because their e-mail address may have changed (every user can freely change its e-mail address).
  • invite_delete() now checks that the user to be removed really had been invited by the current user. Formerly, it was possible for a maliscious user to arbitrarily delete invitations, if he knew the e-mail address of an invitee.
  • The invitation code expiry time has formerly been added twice, causing an invitation to be listed as 'pending' when it actually was expired. However, the entire expiry system didn't really exist until this separate patch implemented it. This patch will actually only correct the display on the user's invitations page.
  • Database schema has been updated.
    • Orphaned invitees and inviters will be deleted when the schema gets updated.
    • As above, for every orphaned user an Invite API 'cancel' event will be generated.
    • Be sure to go to http://www.example.com/update.php after patching.
smk-ka’s picture

StatusFileSize
new9.66 KB

Patch for the 5.x branch.

smk-ka’s picture

StatusFileSize
new9.68 KB

Patch backported to 4.7.x branch. Untested.

smk-ka’s picture

Status: Active » Needs review
smk-ka’s picture

Committed a fix for the original issue.

I'm currently in the process of splitting the above over-large patch into smaller chunks, which makes it easier to test. Kindly forget it for now and closing this issue...
--
Stefan Kudwien
www.unleashedmind.com

smk-ka’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)