Gossamer Forum
Home : Products : DBMan : Customization :

Activate Account: check user with existing record

Quote Reply
Activate Account: check user with existing record
We are populating our database with existing records, and are mailing usernames to the owner of each record (each record's primary key is the username).
Users will need to go online and activate their accounts by entering their assigned username via sub html_signup_form. In the spirit of forced upgrades, we are making users submit an e-mail address to generate a password, instead of providing one for them. Using secure_password_lookup mod, they will then be able to change/update their own password/e-mail information, and all will have an e-mail address we can contact them by (mass mailing mod). The auto modify/view mod has also been added for single record access.

While using the existing sign-up form works fine, we want only usernames that match a record in the database to be able to complete the sign-up/activation process. If someone enters the wrong username, there is no verification to keep them from receiving a password and entering the database. While they won't be able to access anything (auto modify/view mod) without the correct username, I'd rather they not be floating around with limited access.

I did find two closely related solutions in this forum:

http://www.gossamer-threads.com/...=&vc=1#Post85911

http://www.gossamer-threads.com/...=25&Old=allposts

Does anyone have any suggestions based on the postings above, or possibly a different direction all together. I don't mind doing the work, but would appreciate any comments/code. Thanks!


Aaron Adams
----------------------
Like it, love it, need it.
Quote Reply
Re: Activate Account: check user with existing record In reply to
In sub signup, before

Code:

if ($message) {
&html_signup_form ($message);
return;
}
add

Code:

open (DB, "<$db_file_name") or &cgierr("error in reading file. unable to open db file: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
@lines = <DB>;
close DB;
$found = 0;
foreach $line (@lines) {
chomp $line;
@data = &split_decode($line);
if ($data[$auth_user_field] eq $in{'userid'}) {
$found = 1;
last;
}
}
unless ($found) {
$message .= "username not found in database";
}
JPD
Quote Reply
Re: Activate Account: check user with existing rec In reply to
Thank you! That works perfectly. Smile

Aaron Adams
----------------------
Like it, love it, need it.
Quote Reply
Re: Activate Account: check user with existing rec In reply to
Cool! Smile

Glad I could help.

JPD