I have my db set up, so that users can add only one record and so that new signups go directly to the add form. So it works well to have the $dbkey=$userid, but I would like for admin to have unlimited add capablility. Is this possible?
Oct 5, 1999, 11:44 AM
Veteran / Moderator (8669 posts)
Oct 5, 1999, 11:44 AM
Post #2 of 4
Views: 1615
Yes. You will need to add something unique as the userid for the field, though. And you'll need to make the following change to sub add_record in db.cgi:
Change
($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);
to
unless ($per_admin) {
($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);
}
------------------
JPD
Change
Code:
# Set the userid to the logged in user. ($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);
to
Code:
# Set the userid to the logged in user. unless ($per_admin) {
($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);
}
------------------
JPD