Gossamer Forum
Home : Products : DBMan : Installation :

Cannot Add New Users

Quote Reply
Cannot Add New Users
Unsure

ARGH! Hopefully someone here could offer assistance.

I have installed the DBMan Program as per instructions, and it runs beautifully. However, I, as Admin, cannot add another user without getting an error message that reads : Dupilicate Key Error. I have no problem loggin in, creating new users, etc. etc. But creating a new record is impossible.

I have made the default.cfg and db.cgi and html.pl files available for public viewing simply by adding http://www.smscrusade.com/ before each of the filenames.

I appreciate any help any of you can give! Thank you for your time and efforts.

Steve Cousino
steve@smscrusade.comSmile
Post deleted by LoisC In reply to

Last edited by:

RedRum: Oct 29, 2001, 3:47 AM
Quote Reply
Re: [sacousino] Cannot Add New Users In reply to
Sorry I could not get to your files. I assume they are still called default.cfg etc.?????

If I could view your config file I would bet that the UserID is the key field and thus the admin can only have one record.


Quote Reply
Re: [joematt] Cannot Add New Users In reply to
Yes, the URL's are as follows:

http://www.smscrusade.com/default.cfg

and

http://www.smscrusade.com/html.pl

If they don't show up, or show up wrong, let me know and I'll make the links availalbe as a downloadable file.
Quote Reply
Re: [sacousino] Cannot Add New Users In reply to
I was able to open the config file.

to answer the question

...But creating a new record is impossible.

I do see that UserID is the key field.

from your file.

Quote:
# The column name for the database key. Can be any column, but it must be unique!
# You can't have two records with the same key value!
$db_key = 'UserID';

I hope you understand that each record needs a unigue key, some people use RecordID as a key using numbers which DBman assigns as it adds records.

I think you need to "map out " the nature of your database(s), to decide if users will or will not have multipole records, then go back to the configitor (I assume JPD's, which I hear is great, but I have never seen) and make new files.

Good luck, keep the faith!


Quote Reply
Re: [joematt] Cannot Add New Users In reply to
See, that's just the thing. I have already "assigned" UserID's to all my records on paper, but when I to go my admin function, and click "Add", I get the blank form for adding a new record. Okay, works so far. Then, I input all my information as I want it, but after submitting I get the "duplicate key error" and the UserID that I had entered is replaced with my UserID, admin. I'm going nuts here...because I have 200 of these things to input.
Quote Reply
Re: [sacousino] Cannot Add New Users In reply to
First things first, if you are planning to enter the 200 records one by one through the DBman interface, you would need to log on as the user and then enter the record. This is controlled by below ...

Quote:
# Auth user field. This is the field position in the database used for storing
# the userid who owns the record. Set to -1 if not used.
$auth_user_field = 0;

I suppose you could change your settings around and enter the records as admin, then change them back, but that's not what I would do.

I would (and do) create the database in excel, then export to text (cut and paste to notepad) and put in the | (say pipe) between the records. Then FTP the whole database at once.

So I understand that you will create a database where each user has 1 record. Further it appears the user cannot modify their records?

But users can view others records, sounds correct?

Second, the folks on this forum are very very helpful, most of the questions they answer I do not even understand the question! Blush Reading the FAQ's and other posts will get you a long way. Smile

Joe




Quote Reply
Re: [joematt] Cannot Add New Users In reply to
In your db.cgi file in: sub add_record

look for the line that reads:

# Set the userid to the logged in user.
($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);

comment out that line and add:

# Set the userid to the logged in user (except if admin).
unless ($per_admin) { ($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid); }

This will allow you to login as admin and add records and also input the username yourself.

This should solve your problem. Many more tips like this in the FAQ noted below.



Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Cannot Add New Users In reply to
Thanks to "joematt" and "LoisC" for your help with this script. I have finally gotten the script to work (for now, anyway) and I appreciate your help.

Thanks again!
Cool