Gossamer Forum
Home : Products : DBMan : Customization :

No modify if the Userid is not in field (1)

Quote Reply
No modify if the Userid is not in field (1)
Jp,
Cleaning up my members config., I ran into this strange problem.
I only want the member to have one record for there profile, no problem.
If a member signs in he should only be able to modify only there record, problem.
It will not let the user modify there own record, comes up with an error:
"Error: Unable to Modify Record
There were problems modifying the record: unable to find record/no record specified: pete
".
If you noticed, it did bring up the html_record_form, and has the correct User name "pete".
If you remember, we have to but the Userid field first:
'Userid' => [0, 'alpha', -2, 15, 1, '', ''],
And set the
$auth_user_field = 0;
$db_key = 'Userid';
$db_key_track = 0;
$auth_modify_own = 1;

Ok, just to make a long story short, my Jobs db is setup basically the same, except I have:
'ID' => [0, 'numer',7, 8, 1, '', ''],
'Userid' => [1, 'alpha',-2, 15, 1, '', ''],

and

$db_key = 'ID';
$db_key_track = 1;
$auth_user_field = 1;
$auth_modify_own = 1;

This setup works as advertised.

Now, just for grins, In my members.db I added another:

'Userid' => [0, 'alpha', -2, 15, 1, '', ''],
'Userid' => [1, 'alpha', -2, 15, 1, '', ''],
and
$db_key_track = 1;
$auth_user_field = 1;
Change the .db to reflect the correct layout, (Only 3 records).

This worked like it is suppose to when modifying.
Of course I would not even try to use this setup, just to prove a point.
I checked all my forms for the proper headers, but like I say, they are just cloned from my
jobs.db, and it does work as long as the Userid field is in the second position.

"Why do I need to have the Userid field in the # 2 slot" for a user to modify there own?????

Before we forget, I need to have the Userid in the "0" field for the "accessing another data base" mod.
Tom
Quote Reply
Re: No modify if the Userid is not in field (1) In reply to
You do not need to have the userid as field 1. If you look at the demo, you'll see that the userid is field 9.

One thing to be careful about when you're using multiple databases is that you are accessing the correct database when you're modifying.

That's the only thing I can think of right now, unless something happened to your database file while you were working on the different features.

Let me ponder a bit and I'll see what I can come up with.


------------------
JPD





Quote Reply
Re: No modify if the Userid is not in field (1) In reply to
Jp,
Yes, I changed it to the middle, last, etc. Admin., reads the db just fine, so ???
Tom
Quote Reply
Re: No modify if the Userid is not in field (1) In reply to
I don't understand your last post. What did you change?

I'm not sure what you mean by "Admin., reads the db just fine" either.

Maybe I'm getting old. I have to have things spelled out. Smile


------------------
JPD