Gossamer Forum
Home : Products : DBMan : Customization :

userid

Quote Reply
userid
Is it possible for admin to add a record with a field that associates the record with another userid other than their own.
Any ideas would be appreciated.
Thanks,
Edith

DelWeb Advertising Limited
Quote Reply
Re: userid In reply to
Yea...add another USERID field in the %db_def hash called something like OwnerID...then update your default.db file.

Regards,

Eliot Lee
Quote Reply
Re: userid In reply to
In your db.cgi sub add_record

you could change or comment out:

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

to the following:

# 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);
}

What this will do is if a logged in user adds a record, their userid will be inserted in the userid field, but if admin is logged in they can insert any username into that field.

Hope this helps



Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: userid In reply to
But in terms of "tracking" purposes, which I believe you are looking for, adding another USERID field is a better solution than what the "moderator" posted.

Good luck!

Regards,

Eliot Lee
Quote Reply
Re: userid In reply to
Hi,
Thanks for the suggestion! It did the trick for what I wanted!
Thanks,
Edith

DelWeb Advertising Limited