Closed (fixed)
Project:
Invite
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
5 Jan 2007 at 01:13 UTC
Updated:
18 Mar 2007 at 00:45 UTC
Jump to comment: Most recent file
Currently, if a person wants to use invite for an "Invite a friend" link on a site that has open registration, a mail is still sent with a reg code. Additionally, when anyone registers on the site watchdog logs a bad invite error. It should be possible to disable invite code generation in these cases.
Robin
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | invite.module.rej_.txt | 6.99 KB | jillelaine |
| #12 | invite.module.47.patch | 17.18 KB | smk-ka |
| #11 | invite.module.5.patch | 17.29 KB | smk-ka |
| #8 | invite_user_watchdog_fixed_47.txt | 860 bytes | knseibert |
| #7 | invite_user_watchdog_fixed.txt | 867 bytes | knseibert |
Comments
Comment #1
AjK commentedComment #2
jillelaine commentedThe title of this issue isn't clear: I'd label it "Watchdog error: registration code failed".
I think this is the same issue I see: when I manually add a new user via admin > users > add user, I see this error in watchdog: "User username registration code failed" with a Type of "invite". The user is added successfully, but the error is confusing. I'm using 4.7.x-1.2 code.
This same error also appears when a user manually registers on the site.
Hmmm, I'm tempted to say this is should be a "bug report"...not a "feature request"? Maintainers, I'll leave it up to you to change that designation as you see fit. You've been busy in the queue! Awesome and thank you!
Comment #3
AjK commentedThat sounds like a bug to me too. Jill, don't be affraid to change the issue status, we don't bite (well, most of us don't) :)
Comment #4
AjK commentedSome thoughts on this.
Even with "open registration" we still need to send the invite code. The reason for this is that several other modules use the invite API to "note when an invatation has been used". Some modules award points to the invitee when the guest signs up. So the invite code is still required.
The "bad invite" error in the log is the real bug here. When I get a chance I'll look into it (unless someone wants to supply a patch ;)
--Andy
Comment #5
knseibert commentedHi AjK,
i'm took a look at it. First thing i noticed is that in version 5 the "invite_only" setting on the user settings page is missing. That is due to a different $form_id value in invite_form_alter().
Patch attached.
Furthermore i think that the watchdog error message should only be generated in case invite_only is set.
What do you think?
Comment #6
knseibert commented- i'm took
+ i took
:)
Comment #7
knseibert commentedOk, just in case that this is the way to go, i have attached a patch (version 5) to do the following:
- check if invite_only is set.
- check if current user does NOT have "administer users" permission.
If both are true generate the watchdog error message. In all other cases don't.
I think the error message only makes sense if invite_only is set. If that is the case administrators should still be able to create users.
Feedback appreciated.
Comment #8
knseibert commentedAnd the patch for 4.7
Comment #9
smk-ka commentedThank you, submitted the patch from comment #5 (form_alter id) for the 5.x branch and without the debugging stuff.
The solution concerning the watchdog message is wrong, because when we're in invite-only mode, we'll never get that far: the user will already be blocked before even showing the registration form. A simple
if (isset($edit['invite_code']))solves this issue.However, a deeper look at the invite module reveals several flaws that need to be addressed, therefore I've chosen to take over the fixing. For example, invitations are never checked if they have expired before accepting a new user registration. And the target roles system seems to be also broken.
I'm currently about to prepare a comprehensive patch that also includes fixes for the issues mentioned above. Would be nice if some of you can help me testing it.
--
Stefan Kudwien
www.unleashedmind.com
Comment #10
smk-ka commentedOk, here it is. The list of changes:
user_password(), thus containing a wider range of characters.Comment #11
smk-ka commentedPatch for the 5.x branch.
Comment #12
smk-ka commentedPatch backported to the 4.7.x branch. Untested.
Comment #13
jillelaine commentedI am using invite-4.7.x-1.2.tar.gz posted on Jan 18, 2007. I applied the above patch for invite 4.7 on my test site. Here is the result:
I'll attach the .rej file to this comment (renamed to rej.txt as .rej files are not allowed as an attachment type).
ah, I see there is a newer invite module for 4.7.x, invite-4.7.x-1.4.tar.gz, posted on Feb 11, 2007. I'll download this newer version and patch it...and then post back. Thank you for working on this module! It's a keeper.
Comment #14
jillelaine commentedhmmmm, okay, I patched against invite-4.7.x-1.4.tar.gz dated Feb 11, 2007 (which is listed as the 'official release' at this moment http://drupal.org/project/invite). Here is the result.
Here is the contents of the .rej file
okay, back to the download page (view all releases). If I scroll down the page, second from the bottom of the list, I see that there is an even newer release: invite-4.7.x-1.x-dev.tar.gz dated Feb 16, 2007. Wow, y'all been busy!
So I patched against invite-4.7.x-1.x-dev. Here is the result:
yippee! Looks like we have a wiener! Ah, lesson learned here: patch version invite-4.7.x-1.x-dev.tar.gz dated Feb 16, 2007.
I'll test the patched module functionality on my live site this week and get back to you (I'm not able to send invite emails from my test bed). Thanks again for all your work.
Comment #15
smk-ka commentedA small update:
1. I've just committed a patch to prevent the misleading watchdog error: http://drupal.org/cvs?commit=59059.
2. I finally do regret that I captured a rather random thread for announcing a much too large patch. I'm in the process of breaking it down into smaller pieces.
3. This allows me to close this issue.
--
Stefan Kudwien
www.unleashedmind.com
Comment #16
(not verified) commented