Gossamer Forum
Home : Products : DBMan : Customization :

Limiting Records and relational databases

Quote Reply
Limiting Records and relational databases
I have used both JPDeni's limited records and relational mods separately. Now I'd like to use them together, but I am stuck a bit. I am building a web site for a network of organizations. The main organizational record (the ONE) I want to limit to one record; while in the programs database (the Many) I want to allow multiple records.

Since they share password files, dbman wants to limit the many to only one record, too.

I looked here and in LoisC's database, but didn't find anything that helped.

Help appreciated.
Quote Reply
Re: [BobLuttman] Limiting Records and relational databases In reply to
The easiest way to accomplish this may be to use the userid field as the key to your ONE db. This would then automatically limit the records to 1 for that database, because the key would need to be unique.

$db_key = 'UserID';
$db_key_track = 0;

Then you could just setup the MANY database using the UserID field as the relation between the databases. There would be no need then to use the limit records mod.

If you do want to limit records within the MANY database you could try just using the coding for limiting the number of records only within the .cfg file for that database.

Hope this helps

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] Limiting Records and relational databases In reply to
Thanks, Lois

That's what I have. The problem is that the add permission is getting turned off for BOTH the One and the Many databases by the limit records mod. Since I use the same password file for both databases this is what dbman thinks it should do.

What I need is a way to not turn the add permission off in the Many, and I am not quite sure how to do that. Seems to me I'd need separate password files; which would mean separate account creation and login. Or some serious modification of the code somewhere.Unless I am wrong?

I don't want to make this too complicated; I can always try and deal with the occasional user who somehow creates more than one master record.

Thanks.
Quote Reply
Re: [BobLuttman] Limiting Records and relational databases In reply to
Have you tried adding the:

# Permissions a new signup should get.
@auth_signup_permissions = (1,5,1,1,0);

permission levels into both .cfg files so that it will work when the user first signs up?

Your best bet would be to search the forum for the mod name and read all related threads. I'm sure that others have used this mod with the relational mod and have posted questions and solutions.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/