Gossamer Forum
Home : Products : DBMan : Installation :

userid not showing up in the assigned field

Quote Reply
userid not showing up in the assigned field
I have the script in a password protected directory. I am using authentication in the script. The usernames and passwords were setup (and are the same) for both the directory and the script. The permissions are working correctly. I'm using auto generate.

I have the auth_user_field set to field 11. However, the userid is not showing up in field 11. I looked at the auth.pl and if the dbman script is using authentication then it checks to see if you logged in or if you were authenticated through the server. Either way it should grab the right userid and have a value in $db_userid.

What is wrong?

The userid field doesn't work in the default database either.


Here is my .cfg file stuff:

db_def = (
ID => [0, 'numer', 5, 8, 1, '', '' ],
Date => [1, 'date', 12, 15, 1, '', '' ],
Organization_URL => [2, 'alpha', 40, 255, 1, 'http://', '^http://' ],
Organization_Name => [3, 'alpha', 25, 100, 1, '', '' ],
Contact_Name => [4, 'alpha', 25, 40, 1, '', '' ],
Contact_Phone => [5, 'alpha', 20, 20, 0, '', '' ],
Contact_Email => [6, 'alpha', 30, 255, 0, '', '.+@.+..+' ],
Posted_PSA => [7, 'alpha', 0, 3, 1, 'Yes', 'Yes|No' ],
Followup_Needed => [8, 'alpha', 0, 3, 0, '', 'Yes' ],
Comments => [9, 'alpha', '40x5', 500, 3, '', '' ],
Last_Modified => [10, 'date', -2, 15, 1, &get_date, '' ],
Userid => [11, 'alpha', -2, 255, 0, '', '' ]
);



$auth_no_authentication = 0;
$auth_user_field = 11;


Quote Reply
Re: userid not showing up in the assigned field In reply to
You say the userid isn't "showing up" in the field. Do you mean it doesn't appear on the add form or that it's not added to the record after the record is submitted?

The userid will not be filled into the form itself, but it should be included once the record is submitted.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: userid not showing up in the assigned field In reply to
The userid is NEVER put in the record. After adding I check the .db file and the userid is not there. I also bring the file up to view or to modify and the userid is not there.

I tested db.cgi outside of the password protected directory where I had to log in. The userid showed up without any problems.

Trying to figure out how to force auth.pl to use the server authenticated user name. Althougth the code in auth.pl looks like it's supposed to do this already.

Thanks for any help.

Kirsten

Quote Reply
Re: userid not showing up in the assigned field In reply to
Okay. I see what the problem is.

See if this makes any difference.

In db.cgi, sub main, change

if ($uid eq "default") { $db_userid = $uid; }

to

if (!($uid =~ /\./)) { $db_userid = $uid; }

The only problem would be if any of the usernames have a . in them.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: userid not showing up in the assigned field In reply to
How can I get the userid to be displayed in the add form? I have seached and search on the forum and can't seem to find it. I would have thought a lot of people wanted to do it. Of course, it could be obvious and I can't see it!!!

Thanks for any help you can offer.

Joe

Quote Reply
Re: userid not showing up in the assigned field In reply to
In db.cgi, sub get_defaults, after

Code:

foreach $field (keys %db_defaults) {
$default{$field} = $db_defaults{$field};
}
add

($auth_user_field >=0) and ($db_defaults{$db_cols[$auth_user_field]} = $db_userid);



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: userid not showing up in the assigned field In reply to
Thanks so much for this valuable advice. It worked perfectly!!!

Joe

Quote Reply
Re: userid not showing up in the assigned field In reply to
Glad to help. Smile

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: userid not showing up in the assigned field In reply to
I've followed your advice and done this also...but it's still not showing up in the right field!!! UserID keeps showing up in the field afer it. It's number 11 and it keeps showing up in field 12.....!!!

Ramon - thanks for the help!

Quote Reply
Re: userid not showing up in the assigned field In reply to
Check to be sure that your field are numbers in the correct sequence starting with 0 and then 1,2,3,4 .. etc.

You may also want to check your database file and make sure all the fields are being displayed in the correct fields.



Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/