Gossamer Forum
Home : Products : DBMan : Customization :

Making New Users Add a Record?

Quote Reply
Making New Users Add a Record?
Does anyone know of a way to force a new user who has just signed up to add a record? I'm trying to have a database of user info.

Well, force doesn't really matter, just taking them to the add a record page would be fine.

Thanks,

Marcus.
Quote Reply
Re: Making New Users Add a Record? In reply to
You can try placing the following codes in your sub html_home routine in html.pl file:

Code:
unless (($per_admin) or (!$per_add)) {
%rec=&get_record($db_userid);
unless (%rec) {
&html_add_form;
}
else {
$in{'modify'} = $db_userid;
return;
}
}


Be aware that this seems to work most of the time, but I have observed some new users being taken to the modify form rather than the add form.

These codes were provided by Carol (JPDeni). There seems to be a small bug in the codes. But try it and see if it works for ya.

Smile

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Making New Users Add a Record? In reply to
Also, in the html.pl file, delete the call to
the &html_footer on a line from sub html_add_form.


There is another post on the subject at

http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/000617.html

By making certain fields required, you can force new users to fill out the fields in order to create a record and gain access to your database.

Ot works pretty well. Even if they delete their record, their user name and e-mail address remains viewable by the administrator. Also, if they delete their record, they will go to the Add Form page the next time (and every time) they log in unless they have a record already.

[This message has been edited by ER (edited September 14, 1999).]
Quote Reply
Re: Making New Users Add a Record? In reply to
I would NOT delete the link to the add_form routine. What you should do is replace the permissions from if ($per_add); to if ($per_admin);. The reason that you do NOT want to delete the link to the add form is that you as the administrator may need to either test the add form or add records for your users.

Hope this helps.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Making New Users Add a Record? In reply to
That's interesting. I was just passing on what Carol said. The idea is that new users would not see any other options when they log in right after creating their account. However, if it works that way, it does add other options for the administrator. I may test it and see just how it works.
Quote Reply
Re: Making New Users Add a Record? In reply to
Well, I have it working on my site and it works great. Changing the permissions in the sub html_footer is a better solution then deleting out options.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Making New Users Add a Record? In reply to
I am having a problem with this mod because I would like to have the uses input their personal information in a seperate data base. The mod does take them to the add form that I would like them to see but then I get the error:
Error Message : Error loading required libraries.
Check that they exist, permissions are set correctly and that they compile.
Reason: Invalid config file name: member.db at /data1/hypermart.net/sherwingaddis/cgi-bin/dbman/db.cgi line 51.

code is posted at:
http://www.jse.net/testsite/members_db_cgi.txt http://www.jse.net/testsite/members_html_pl.txt http://www.jse.net/testsite/member_default_cfg.txt

------------------
Sherwin Sales@jse.net
Quote Reply
Re: Making New Users Add a Record? In reply to
You have to add another $db_setup line in your db.cgi file, like the following:

Code:
$in{'db'} ? ($db_setup = $in{'db'}) : ($db_setup = 'members');

Then in your sub html_member_form routine, replace the following hidden field with:

Code:
<input type=hidden name="db" value="$db_setup">

with the following hidden field:

Code:
<input type=hidden name="db" value="members">

You will need to replace "members" with the appropriate name of the member database file you have. Also, remember that you need to have the .cfg file the same name as your member database, like the following:

members.cfg
members.db

Hope this helps.

Regards,



------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited September 15, 1999).]
Quote Reply
Re: Making New Users Add a Record? In reply to
Eliot,
That solved the problem with getting past the add record screen but after the record is added. Two more problems popped up. One, each time the user logs the add information screen comes up. The next thing is that once the information is added the parts database (default.db) is not accessable. Code is posted at:
http://www.jse.net/testsite/members_db_cgi.txt http://www.jse.net/testsite/members_html_pl.txt http://www.jse.net/testsite/member_default_cfg.txt

Could you help me with this please?

------------------
Sherwin Sales@jse.net
Quote Reply
Re: Making New Users Add a Record? In reply to
Since you have two different "$db_setup" variables, try changing the following line in your sub html_add_form routine in the html.pl file:

Code:
<input type=hidden name="db"
value="$db_setup">

with the following:

Code:
<input type=hidden name="db" value="default">

Remember that in each of your sub-routines of your html.pl file, you will need to specify the EXACT database name (default or members) versus $db_setup.

Also, you have not added the line that I recommended:

Code:
$in{'db'} ? ($db_setup = $in{'db'}) : ($db_setup = 'members');

in your db.cgi file.

Does this make sense?

Hope this helps.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited September 17, 1999).]
Quote Reply
Re: Making New Users Add a Record? In reply to
Eliot,
I am getting a syntax error with the line you said to add to the db.cgi. I tried some changes but not go. The text files are located in the same spot.

Thanks!

------------------
Sherwin Sales@jse.net
Quote Reply
Re: Making New Users Add a Record? In reply to
What kind of syntax errors are you receiving?

AND, Sherwin, you did not add the lines that I provided in your db.cgi file. Frown

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited September 18, 1999).]
Quote Reply
Re: Making New Users Add a Record? In reply to
Eliot,
Solved the syntax error. Line in the wrong spot. I put the line in and it still goes to the add record screen. I need to set the %rec to check the members db instead of the default.db. Is there a string that you can come up that will make it look at the correct db?

------------------
Sherwin Sales@jse.net
Quote Reply
Re: Making New Users Add a Record? In reply to
I will have to look over your scripts a little more closely to find out how to do that.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Making New Users Add a Record? In reply to
Eliot,
This mod is working better for me but..... If I log in under admin user name the Member information form does not come up. If I log in as a new user, the member information form comes up along with the main screen. Now, I fill out the member information form and the information is added to the member database (member.db). The member information form is still there. I log out and log back in and the member information form is still there. If there was a way to do a $per_member, that would work. But when the form is filled out then the status of the user would have to be changed (automatically I hope).

------------------
Sherwin Sales@jse.net
Quote Reply
Re: Making New Users Add a Record? In reply to
Ah...now I see the problem. The problem is that you have the two data entry forms. Now people automatically login to the member add form.

The only quick and dirty solution is to make a copy of the db.cgi to run member database and use the original db.cgi file to run the other database. You will have to have separate search forms (as well as add, delete, and modify), so it wouldn't matter that much to have a separate db.cgi file. You would also have to a separate html.pl in addition to separate .cfg files.

JPDeni (Carol) has attempted to write a mod for an additional permission (like per_members), but has not worked out very well.

Also, YES, you can use the same default.pass, default.count, default.log and auth session files for both databases. Just make another db.cgi file.

Hope this helps.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited September 19, 1999).]
Quote Reply
Re: Making New Users Add a Record? In reply to
Eliot,
There has got to be a way. I have come this far. The code works so far. All we need is to be able to make the Member Info form maditor for one session and change the users status to member. I have added $per_member to me db.cgi and default cfg. What else effects this line?

------------------
Sherwin Sales@jse.net
Quote Reply
Re: Making New Users Add a Record? In reply to
It is not that easy! There are more things that you have to create a new user permission.

Wink

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Making New Users Add a Record? In reply to
Eliot,
Sorry to make it seems like it is easy to come up with code. Could you tell me in plain english what does this line mean: unless (($per_admin) or (!$per_add)). I went and got a book on Perl and it is not helping one bit. The strings that are in DBman is not even mentioned in the book. Thanks for all of you help and patients!

------------------
Sherwin Sales@jse.net
Quote Reply
Re: Making New Users Add a Record? In reply to
The codes you mentioned means that if you have administrator permissions, then you can access the Main Menu page. The !per_admin stuff means that if the person has already added a record, they can access the Main Menu page.

If the user has per_add permissions and has not added a record, they are taken to the Add Record Form.

Does this make sense?

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Making New Users Add a Record? In reply to
Eliot,
That makes sense and is what I thougt it was doing. Now, is there a script that can be added to make the system check the member.db for the record instead of the default.db? If this can be done then I will have what I want.

------------------
Sherwin Sales@jse.net