Gossamer Forum
Home : Products : DBMan : Customization :

can I let user register their own?

Quote Reply
can I let user register their own?
as in letting them enter their login and password their own for the first tiem when they register to my database?

If so, can I direct them to a form that contain details for them to enter including their login name and password? eg surnam, last name, login name, password, password again to confirm, etc etc?

Quote Reply
Re: can I let user register their own? In reply to
There should be a section of your sub html_login_form (in html.pl) that looks like this:

Code:
if ($auth_signup) {
print qq|You can sign up for an account online right <a href="$db_script_url?db=$db_setup&signup_form=1">here</a>.|;
}

Is it there? If so, all you have to do is click on the link to get to the signup form.

It is much better to have the signup be a two-step process. First they enter a username and password. Then they go to the database and add the other information. You don't want your password file cluttered up with a whole lot of extra info.


------------------
JPD





Quote Reply
Re: can I let user register their own? In reply to
Hm.ok..but isit possible to direct the user who have just created the login and password to enter their database? eg enter their particulars.

and, if I just want to let the user enter their data, and when the press send, they will be email login and password thru email. and the password will be generate unique password for them?
Quote Reply
Re: can I let user register their own? In reply to
You need to do two very different things to accomplish what you want.

To automatically send a new user to the add form, add this to sub html_home in html.pl, just after

# The database manager home page.

Code:
$in{$db_cols[$auth_user_field]} = $db_userid;
my ($status, @hits) = &query("mod");
unless ($status eq "ok") {
&html_add_form;
return;
}

This cause the script to check for a record for the user whenever they enter the home page (such as when they first log in). If a record is not found, they will go to the add form.

The second thing you want is more complicated and will require a lot of script changes. Before I go into any details, I'll need to ask you if you want to add a "password lookup" feature where users who have previously registered can enter their email addresses and have their username and password sent to them. Also, do you want the script to just generate a password or do you want it to generate a userid as well? Finally, do you want users to be able to change their passwords?

------------------
JPD





Quote Reply
Re: can I let user register their own? In reply to
the password lookup is included in the Friendly-html.pl right?

and I would like this feature on my database.

I think I will let the user enter their own login and password. And I would want the webmaster to be inform about new user being added or modified of any records.

how can this be done? Thanks for your help! Smile

need the whole database to be done on wed nite Frown
Quote Reply
Re: can I let user register their own? In reply to
No, the password lookup is not in the user-friendly html.pl file. A couple of the subroutines are in there, but there's much more to it than that. You'll need to go to my site at www.jpdeni.com/dbman/ and click on "Modifications" and then on "password lookup" (I can't remember the name of the file at the moment, because I'm almost asleep. Smile )

You need the database to be finished by Wednesday night? Good luck.

I'll answer your email questions tomorrow (later today, I guess). I gotta get some sleep!


------------------
JPD





Quote Reply
Re: can I let user register their own? In reply to
thks anyway! Smile really appericate it
Quote Reply
Re: can I let user register their own? In reply to
Sending email to the webmaster is not difficult. Rather than giving you something you don't want, though, it would help me if you told me what information you want to be sent to the webmaster when a record is added or modified.


------------------
JPD





Quote Reply
Re: can I let user register their own? In reply to
When ever there is any updates or modification, a email will be send to the webmaster informing him the which user(login name) update/modify/registered.
Quote Reply
Re: can I let user register their own? In reply to
Okay.

It would be best if you defined a couple of variables in your default.cfg file, if they're not already there:

Code:
# Your email address. Be sure to leave in the \ before the @
$admin_email = "you\@server.com";
# Email program on your system
$mailprog = "|/usr/sbin/sendmail -t";

This makes things much easier. If you've added the password lookup mod, those should both be in there already.

In the html.pl file, sub html_add_success, below

&html_record(&get_record($in{$db_key}));

add

Code:
open (MAIL, "$mailprog") or &cgierr("Can't start mail program");

print MAIL "To: $admin_email\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: $html_title -- New Record Added\n\n";

print MAIL "-" x 75 . "\n\n";

print MAIL "$db_userid just added a record.\n\n";

close MAIL;

Add similar code to html_modify_success.



------------------
JPD





Quote Reply
Re: can I let user register their own? In reply to
Thks!

anyway..just wondering...similar case, user modify or added new user.. all will be log down into a file? like who done what, when the modify/add was done?
eg

22/06/99 james modify
23/06/99 alan new user

I was thinking, if I expect 10,000 per month...the webmaster email will be flooded.

Quote Reply
Re: can I let user register their own? In reply to
If you enable $auth_logging, you will get the following in your log file:

$uid $action at $time on $date from $ENV{'REMOTE_HOST'}

If you expect 10,000 a month and those records are going to stay there, you're going to be having a very large file in a very short time. You might consider writing to Alex and seeing about the SQL version.

------------------
JPD





Quote Reply
Re: can I let user register their own? In reply to
Yap, I've send Alex an email regarding the SQL DBman already.

Thks !