Gossamer Forum
Home : Products : DBMan : Installation :

"Users Access Only Own Records" Question

Quote Reply
"Users Access Only Own Records" Question
I want to have an administrator be able to log into the databse, create records, and then have users be able to log in and view only the records designed for them.

I have turned the "Registered users: can view _only_ own records" feature on. I've defined field 0 as the userid field, and modified html.pl so that that field is editable by the administrator. The only problem I'm running into now is that "admin" is automatically the value for field 0, even though I type in a different value on the Add screen.

For some reason I remember having this work out fine before I started customizing html.pl. I tried turning autogenerate forms back on, but still no luck.

Any suggestions would be appreciated.

-Dave Schuster


Quote Reply
Re: "Users Access Only Own Records" Question In reply to
Check your $auth_user_field field config in the default.cfg file.

Double check your sub html_record_form to make sure that you have properly included $per_admin conditional statements.

Regards,

Eliot Lee
Quote Reply
Re: "Users Access Only Own Records" Question In reply to
I found a fix that took care of my problem:

in sub add_record of db.cgi, change:


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

to


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

And the userid is no longer automatically added.