Gossamer Forum
Home : Products : DBMan : Installation :

Adding Fields to Password File

Quote Reply
Adding Fields to Password File
How can I add additional fields to the password file ?? I want to be able to capture the user's city and state (and then display it in the HTML). What file(s) needs to be modified (other than the generated form) so that the data will be written to default.pass ??

Any information would be appreciated!

-Matthew
Quote Reply
Re: Adding Fields to Password File In reply to
There is quite a bit involved in adding a field to a password file. Every time the password file is accessed, you need to account for the fields.

While this is not exactly what you need, the mod for adding a "password lookup" feature shows all the lines you would need to change. Take a look at
http://www.drizzle.com/~hall/dbmod/lookup.txt

You also would need to change the signup form and the admin display form to include the new fields. And don't forget to add the new fields to the existing data in your password file.


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





Quote Reply
Re: Adding Fields to Password File In reply to
You need all that info in the password file? It can be done, but it might be better to have that info in the record -- or even in a separate database.

I can show you how to put the info into the password file if you still want to, though.

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





Quote Reply
Re: Adding Fields to Password File In reply to
Hi again,

I feel like I am your worst nightmare back to haunt you again :-)

What would be the best way to do it? I think seperate database would be a good idea since the client wants to be able to import the database and keep it for thier own use.

If you could tell me what, in your opinion, would be the easiest way to do it and point me in the right direction I would be eternally grateful!

Thanks
Kylie
Quote Reply
Re: Adding Fields to Password File In reply to
Two databases would be your best bet. Are you going to be relating the database you have now to the information you were going to be putting in the password file (and I have since talked you out of Smile )?

If they are not related, you just need to set up another database like the first one. With this one you'll probably want to associate the username with the record, so set your $auth_user_field accordingly. You can (and should) use the same password file for the two databases.

There is some info on the forum about having more than one database, but I'll be happy to answer any questions you have. (You're definitely not my worst nightmare! Smile )


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





Quote Reply
Re: Adding Fields to Password File In reply to
mathew/Jpd,

I would also like to do this, I am a newbie to modifying scripts -- DBman would have to be my most ambitious project so far and I am getting there -- mostly thanks to the wonderful support forum and sme creative thinking.

I need a little more guiandance here.

I need to capture the company name, contact name, phone, address, fax when users sign up to use the database. This is for a client so I am getting paid to learn. (The script will be paid for and registered before they are allowed at it :-)).

Can you tell me what part of the file at http://www.drizzle.com/~hall/dbmod/lookup.txt I should be focusing my efforts on looking at.

With a little direction I can probably work out what to do.

Thanks
Kylie
Quote Reply
Re: Adding Fields to Password File In reply to
Once you get the field problem settled with your first database, you can get going with the second one.

You will need to have the users sign up for a username and password first and then when they log on they can enter their data. There are some nifty tricks you can do to check whether there is a record in the "users" database when a user signs on. If not, they are taken directly to the "add user info" page.

But we'll get into that when your other problem is ironed out.


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





Quote Reply
Re: Adding Fields to Password File In reply to
Jpd,

Since I am not your worst nightmare I am back to try harder -- LOL!

Just so I can be sure I have this straight, I need to put that userame field back in the cfg file and set the $auth_user_field back to what it should be for that field.
I think you better hold the Nokia on my post in the other thread about te blank fields since this will probably change all that!

I think I recall something about running multiple databses in the readme file which I shall have to go back and check out -- if I have problems you'll be the first to know. :-)

In regard to the signup form -- will I be able to request all the info on the one sign up form and have it write the data to the database that it should be going to or will I need like a two stage sign up form where I get all the company info first and then they go to a sign up page?

Does that make sense? I did say I would try harder!

Kylie
Quote Reply
Re: Adding Fields to Password File In reply to
Now I am ready to work on this.

I just looked at the readme file so I can get the gist of what I should be doing and I have some questions before I start

It says in the readme file that the minimum I will need for a second database will be the database.db and database.cfg files.

Is that all I am going to need? Or should I be editing others. I still have the original untouched script. Also, am I right in saying that I take these files and rename them to something like contacts.db, contacts.cfg and so on for any other files I will need to use?

Then I set them up to take the details of the users that I need to capture, it will write them to the databse and then your nifty trick will check the first database when a user logs on to make sure there is a corresponding record in the contacts database?

The readme file also says "You might want seperate password,counter and log files as well. You might also want seperate html files."

I am going to be using the same password file as I already have right? I saw something about that and how to do it on another thread that I can check again.

I don't need to worry my pretty little head about the html files for this one?

I can set this up if I've got this info straight -- what fields do I need to make sure I include in the second database to tie it in with the username/password of the first.

Last question? Do you get paid for answering my questions? :-)If you don't, you should!

BTW, I just wnat to make it clear that I did not design the homepage that the log in page links to -- I live in fear that you might think I did that LOL! The new site is not yet loaded

Kylie

------------------
info@spiltmilk.net
Quote Reply
Re: Adding Fields to Password File In reply to
So many questions!! Smile

For the second database, you definitely have to have another .cfg file and .db file. Yes, you can name them contact.cfg and contact.db. For your purposes you won't want a separate password file, but you probably will want a contact.count file. And, unless you are using the autogenerate feature, you will have to have another html.pl file. You can call it something like "conhtml.pl."

You will want to set up your contact.cfg file so that your userid is the $db_key. That will assure that there is only one record per user. Also, be sure to set $db_key_track to 0.

Quote:
Then I set them up to take the details of the users that I need to capture, it will write them to the databse and then your nifty trick will check the first database when a user logs on to make sure there is a corresponding record in the contacts database?

Right. After you get your "contacts" database working and tested, we'll get into how to check to be sure there's a record when someone logs in.

Quote:
Do you get paid for answering my questions?

No. Smile I do have my own little business I've started in which I do full customization of DBMan for folks. But not anything directly with answering the questions.

I do get a lot out of it, though. I have "borrowed" a number of ideas from folks here to use in my own and in custom scripts for others and it keeps my mind sharp to answer the questions of other folks. Also, I like the people here. Answering questions is a way to get to know some other folks and that's fun. Smile

Quote:
BTW, I just wnat to make it clear that I did not design the homepage that the log in page links to -- I live in fear that you might think I did that LOL! The new site is not yet loaded

I hadn't looked at it. Now I'm curious!!


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







[This message has been edited by JPDeni (edited April 15, 1999).]
Quote Reply
Re: Adding Fields to Password File In reply to
Jpd,

Just a quicky before I get started -- do I need to create a second dbamn directory in my cgi bin? or more simply -- where do I put the contacts databse files?

Thanks
Kylie
http://www.spiltmilk.net (that's one I DID design :-)
Quote Reply
Re: Adding Fields to Password File In reply to
The files can all go in the same directory. And you could (and should) use the same auth directory for both databases.

Quote:
http://www.spiltmilk.net (that's one I DID design :-)

Very nice! Smile



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





Quote Reply
Re: Adding Fields to Password File In reply to
Jpd,

I have set up the second database (contacts.db) and it is working with the forms on autogenerate. Now I know if I change the html file and it doesn't work that it's all my fault :-)I learnt something teach!

You said that they would need to sign up for a user name and password first and then enter all the company info.

I guess I am wondering on infastructure so I know what I am doing.

This is what I THINK it should be, but you can never be too sure -- you can, however, be too wrong so I had better check:-

Register page (contacts.cgi)(writes id and password to password file which is shared by both dbs')

Accepts registration -- click to continue registration which takes them to add page of contacts db.

They add record (users have add, modify and delete access for only their own records)

Add success -- "click to begin using our free consultant search service"

Send them to the login page for registered users (default.cgi) where login will take them in the default databse and will use shared password file to check username/password.

I have been doing my best not to bug you by thinking this through. I have compeltely confused myself. That will teach me to think about things too long, or at all.

BTW, what is your URL?

Kylie

------------------
info@spiltmilk.net
Quote Reply
Re: Adding Fields to Password File In reply to
Jpd,

I know I said it worked with autogenerate but I've changed my mind :-)

When I try to add a record I get a duplicate key error because it already has the user id in the password file. What if I make the email address the key? Then that should work right?

Kylie
Quote Reply
Re: Adding Fields to Password File In reply to
Here I am talking to myself until you folks on teh other side of the world wake up! :-)

I tried the email as the key and it's dumping the userid in the email field. Do I hide the user id? I really don't know what to do here,

Kylie
Quote Reply
Re: Adding Fields to Password File In reply to
I actually got some sleep last night, so I wasn't here to answer your questions. Smile

Rather than go over your progression, let me give you mine. It may help.

A user goes to the login page for the contacts db. (It won't really matter which one the user starts with once we get it finished, but for now we'll stick to the contacts db.)

He doesn't have a username so he signs up for one online. The username and password are added to the password file only -- not the "contacts.db" file.

He enters his new username and password.

For the current purpose, until you get it worked out, he is sent to the home page of the contacts database. He clicks on "Add." (Once things are worked out, we'll not give him a choice. He'll have to add his info before he can do anything else.)

He adds his info to the contacts db.

Add success -- "click to begin using our free consultant search service"

He goes straight to the home page of the default.db without having to log in again.

Does this help?


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





Quote Reply
Re: Adding Fields to Password File In reply to
Jpd,

How much for you to set up this second db? I can do all the customisation of the HTML but setting up the actual infastructure so that it all works and all I have to do is make it look pretty?

Please email me at info@spiltmilk.net to discuss. I would love to learn all this but I have other tasks that are falling behind and I have basically run out of time!

If I can afford ya -- I'll have ya :-)

Kylie