Closed (fixed)
Project:
Registration codes
Version:
5.x-2.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
25 Jun 2007 at 01:51 UTC
Updated:
17 Jun 2009 at 14:58 UTC
I need to be able to use this module to send out codes in sms messages and then have people register using their assigned code but allow only one registration per code and, if possible, store the used code in the user's profile.
I really need this and i need it quickly so am prepared to pay for the development.
I also think it would be a worthy addition to a great module (-:
Comments
Comment #1
colanI agree. This would indeed be an excellent feature; other folks have requested it too. Unfortunately, I don't have time to take on any new paid work until September. I've got some projects that are keeping me busy full-time.
If someone else steps up, or you can find someone to do the work required in coming up with a patch, I'll gladly merge the feature into a future release (as long as it's tested and the code is in line with the Drupal coding standards).
Comment #2
bakwas_internet commentedDid some hacking and finally came up with following code. This is working fine on my system. Can other people test it and give me their feedback.
Comment #3
bakwas_internet commentedThere is one problem with above code. It removes a regcode even if user registration form is not accepted due to some error in some other field(such as email or password etc.). is there any way to check whether form has been filled correctly.
Comment #4
colanI'm moving this down from "critical", which usually means the module is very broken. This is just a feature request, albeit a good one. ;)
Comment #5
colanbakwas_internet: Thanks for working on this. One other thing to be aware of is that this module was originally meant provide a small number of passwords for the site. (This was mentioned by jvermillion.)
In that sense, it was fine to keep these passwords as one or many Drupal variables because there were a small number of them. If the registration codes are to be individually generated, that means that there could be a lot of data. We don't want to keep this much information in a variable or variables because this would take up a lot of memory when there are many users.
The way to properly deal with this, then, would be for this module to have its own database table that will store the information for many users.
Comment #6
Bassel commentedThe new update of the registration code module has been a great improvement, but may be if we can have a two-columns table, a column for the registration code itself and a column for the user id. By doing this we assure that only registration codes with no user id are available for the registration process, and in the same time we keep track of the used registration codes and by which user has been used.
I am suggesting this because this is a scenario that I have been asked to do.
I wish I have the experience to do this and to contribute myself, but I am still in the learning stage right now.
Thanx,
Comment #7
Bassel commentedThis might be a bad work around but it works 100%.
After digging around I found out that Drupal stores the registration codes which have been used previously by each user upon registration in a column named “data” in the “users” table.
So it would be enough to compare the newly entered registration code with the already available registration codes. My problem is I don’t know how to extract the registration code out of the “data” column and I have no experience developing in PHP and I needed this quickly. So I came up with the following solution which worked 100% with me.
Create a table:
and then change the "regcode.module" to be like this:
My solution made the registration codes to be stored twice in the “regcodes” and “variable” tables, which is off course a stupid thing to do.
off course the perfect scenario would be to rewrite the module, so that we have the codes stored in a separate table “regcodes” with a similar structure that I used and to have an option in the registration codes setup page whether we need the registration codes to be uniquely used by users or not.
Comment #8
lelizondo commentedGreat patch, it works for me..
The regcode.install would be something like this:
Comment #9
-enzo- commentedHello People
I reuse the code posted on this thread to create a new path to support Registration codes by account type with expiration more information at http://drupal.org/node/361527.
Thanks a lot to all people for his contribution.
Best regards
enzo
Comment #10
danielnolde commentedHey regcode-users,
i just posted a ready-for-review proposal of a completely reworked new regcode.module (still D5, but soon to be upgraded to D6 & D7). This new to-become-release is solving a lot of feature-requests and issues (this one too!) on a completely new and flexible basis.
Check it out, test it and give feedback whether you think it solves your issues, and whether it's ready to be committed:
http://drupal.org/node/466630
cheers,
daniel
Comment #11
aidanlis commentedImplemented in the D6 and D5 versions now.