Gossamer Forum
Home : Products : DBMan : Customization :

Adding Entries for Registered USers

Quote Reply
Adding Entries for Registered USers
Hi

It am bulding a database of projects being offered by teachers. As a measure of control they cannot create a new record in the database. Once the record has been created by the administrator, they have access to modify the record.

Once the record has been created, the owner is the administrator. IS there a way of changing the owner ship of the record once it has been created without manually changing teh database file

Thasnks for your help

Cheers

Ramsay
Quote Reply
Re: Adding Entries for Registered USers In reply to
Ramsay,

I assume you have the .cfg file set up so that "owners" can only modify their own record by making $auth_modify_own = 1, you must also have $auth_user_field set to the userid column to have dbman keep track of owners.

Now I believe your problem is that when you create a record for a user when logged in as administrator dbman sets the useride to "admin". You can change this by commenting out the following line (#139) in the add_record subroutine of the db.cgi file:

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

You can comment out this line by preceeding it with a # sign. This will no longer set the useride to the logged in user when adding a record. Thus, you can set the userid to any userid you want when you create the record.

I hope this helps.

Sincerely,
Lauren Stegman