Hello,
Wow, this module extends the OG functionality quite a bit! Nice work!
I was wondering if there is a way to automate the Invitation process for "Invite-only" groups. Right now when a group is Invite-only, and the group admin clicks on "Invite friend" link, the default URL takes them to an Access Denied page (http://dev.site.net/og/subscribe/2178).
The alternative is for the admin to take a code and manually send a private message to the member, then have that member come to a code submission page and enter the code. Then the user can potentially invite others, so the to keep the group invite rights, admin has to come up with a list of codes and auto-expire them after each use.
This somehow seems less than ideal.
I'm wanting to replicate the standard invite-only group functionality a la Flickr, where all a group admin has to do is click "Invite friend", enter the username and click Send. And all the user has to do is click on a link in the automatically generated email with a unique code.
Has anyone seen anything like that being developed? If not, I would like to develop that, as it's a much needed functionality for our community portal.
Here's the basic idea:
* Replace the code-entering interface on group page edit form with a simple ON/OFF checkbox.
* Create an interface where the invite code can be taken from the url (/og/GID/join/asdf89u98309u23r).
* Auto-generate the registration code upon a new invite and store it like a regular code.
* Include the URL with the invite code in the invitation email.
* Trigger the code auto-delete sequence when user joins.
Many parts of this are already in place, so it seems like it is quite doable to extend the functionality.
Any ideas on where to start?
Best,
Andrey.
Comments
Comment #1
somebodysysop commentedIf I understand you, you wish to replace the current "Registration Code" functionality in OGR with an auto-generated code that works in conjunction with the "invite friend" feature.
Currently when you click on the "invite friend" link, you can enter a "Personal message:". In this personal message, you can enter a code that can be used by these individuals to register and automatically subscribe to the group.
The current "Registration Code" functionality, in my opinion, is not automated in the way you suggest, but far more robust in terms of accomodating a variety of circumstances. For this reason, I would not be inclined to replace it with your suggestion.
Comment #2
mr.andrey commentedHi @SomebodySysop,
I see you point. It's more flexible in a sense that other members and not just admins can invite users, and it's up to the admin to decide... other ways too. Though a bit more complex. I was thinking of extending the functionality to have auto-codes as an additional option.
One problem with the current setup is when you send the invite, the email says to go to og/subscribe/GID, and if the group is invite-only, it gives Access Denied. I wonder if there is a way to change the !group_url token to make it go to the "enter code" page when group is invite-only or have "enter code" as an option on the same page? Or maybe have a special invite page for invite-only groups that changes the message...
Any ideas?
Thanks,
Andrey.
Comment #3
somebodysysop commentedThe URL to enter a registration code is: og/regcode
As in: http://www.yoursite.com/og/regcode
So, use that URL instead of !group_url token in Organic Groups Configuration (admin/og/og), Admin->Organic groups->Email settings->Invite user email body.
This will work for authenticated users. When anonymous users get to this page, they will see a link which says that they must register/login to use registration code. By following this link, they will get to the registration page which will display the option to enter a registration code. Note that "anonymous" users must have the "use registration codes" permission for this to work.
Also there is a "Register Codes" block available for use by authenticated users. It only appears when you:
a. Place the block, titled "Register Codes", someplace on your page, preferably underneath the Group Details block
b. In OGR Settings, place check in "Allow Group Admins to set Registration Codes", then Save configuration.
c. In the group Edit page form for the desired group(s), place check in "Set registration codes to allow users to join this group?". Then, enter the code(s) to be used.
d. In Access Control, give authenticated users the "use registration codes" permission.
Now, when an authenticated user comes to the group home page, he will see the "Enter registration code" link.
Hope this helps.
Details on using Registration Codes are here: http://drupal.org/node/217229
Comment #4
mr.andrey commentedMany thanks, this is very helpful.
Comment #5
mr.andrey commentedHi there,
One problem here is that some groups use reg codes and some don't. The !group_url token is the one needed for non-reg-code groups and the og/regcode is needed for reg-codes ones.
The only workaround I see at the moment is to include the regcode block on the "content top" on the og/subscribe/GID page. This way groups with no reg codes will just join, and users with reg codes will get the block, though they will also get the Access Denied error right below that, which is less than ideal.
Is there another way to have both work in a more intuitive and simple way?
Thanks,
Andrey.
Comment #6
somebodysysop commentedWhere exactly does a user get an "Access Denied" message in this process? I've not seen this.
Comment #7
mr.andrey commentedIf the user wants to join a reg-code invite-only group through og/subscribe/GID, they will get an Access Denied error.
If the user wants to join a non-reg-code open group through og/regcode, they have no code, so they can't join.
What URL should I use in the invite email? Members will want to send invites to both reg-code and non-reg-code groups.
Andrey.
Comment #8
somebodysysop commentedAny idea why they are getting this error here? Is the regcode block causing it?
Comment #9
mr.andrey commentedThe error is simply due to the group being an invite-only group. It's supposed to give Access Denied because users can't join invite-only groups. Putting the OGR block on top of the page gives users the option to enter the reg code, but it doesn't make the error go away.
So the question here is what URL to give to the users in the automatic invite emails? og/subscribe/GID doesn't work for regcode/invite-only groups, and og/regcode doesn't work for non-regcode/open groups.
Andrey.
Comment #10
mr.andrey commentedChanging this to 3.1, since that's what I'm using now.
Comment #11
somebodysysop commentedMy recommendations:
1. As the OG maintainer to make the invite email section configurable by group as opposed to a default for all groups. If that doesn't work:
2. Create a page. Make it public. Put two links on it: One for regcode/invite-only groups and one for non-regcode/open groups. In the invite email, point to this page with something like:
http://www.yoursite.com/node/nid?sub=gid
Write some PHP to configure to grab the "sub" value ($gid = $_GET['sub'])
Insert the $gid value into the og/subscribe/gid link.
There you have it: One page to cover both circumstances.
Comment #12
mr.andrey commentedThanks for the info.
I was actually thinking of doing a _form_alter on the invite form, putting all of the text into the personal message textbox, and doing a check to see if the group uses regcodes. If it does, give one link, if not give another.
This way the admins can customize their invite text as they want, and there is a proper link for each case. I think I'll also do a check-if-group-admin and give the actual reg-code values so they are handy.
Andrey.
Comment #13
mr.andrey commentedThis is what I have for the form alter. It's a rather specific example to my particular configuration, but I think it's very thorough in terms of holding the group admin's hand through different cases.
Comment #14
somebodysysop commentedWhen OGR 3.2 is released, if you're still interested in this, I suggest you submit a patch for that release.
Comment #15
mr.andrey commentedSure, here's what I use now.
Insert this into your _form_alter script in template.php:
note: we do not use the "closed" group option at all - modify this to your own needs.
Best,
Andrey.
Comment #16
somebodysysop commentedThanks!
Comment #17
somebodysysop commentedComment #18
chaps2 commentedI've submitted a patch for og 6.x here http://drupal.org/node/282810#comment-1435332 that gets close to what mr.andrey was originally after. It works for moderated groups. The fact that you can't send invites from an invite-only group is a different issue...
I looked into using og_user_roles and registration codes but I think they address a broader requirement that is necessarily more cumbersome.
Comment #19
sunAfter the rise of the rewritten OGUR 4.x for Drupal 6, in which many unrelated features of OGUR were removed, and nearing a release of Drupal 7, I'm closing down old issues.