Hey everyone, how you all doing, i'm having a bit of a problem with htaccess and couldn't find any other posts addressing this specific issue, maybe it's not possible, I hope you can help, i'm a bit stumped!
I have an htaccess file linked to a mysql database set up to protect certain directories of my site which works fine using my main user table to lookup and check username/password combos for entry.
What i want to do is allow access to certain directories for certain users, so i have my Users table, with username and password and i have my Membership table, which lists which sections a user is a member of and until when (so usera might have access to Section 1 until 10/12/06 but not sections 2 - 4). So my Membership table has Username/Section/Exipres fields. I think groups are the way to go, but i can't work out how to use them for more than just a lookup, ie
Tables:
Users (Id, Username, Password);
Membership(Id, Username, Section, Expires);
I think if i set membership as the group table with section as the groupname (and obviously specify the correct group name within the htaccess file depending on the directory it's protecting) then obviously it will allow access (still checking the Password validity from the Users table) only to 'group' members of the relevant section. That's nearly what i want!
The only problem is the expiry date, as users should only have access if that hasn't passed, so i want nearly the same thing, but a user is a member of a group if they are listed in that table AND the expiry date is in the future. I can't seem to work out any way of adding further querying into the htaccess file, and i couldn't find anything about this on the internet or searching on the forums. Obviously i could set up scripts to generate separate group tables that only list currently valid members but i can't imagine that is the most efficient way of doing things as it's just duplicating data unecessarily and would require updating every time a user changed his/her subscription level.
I would really, really appreciate any pointers anyone has on this one as i can't really work out what to do from here!
Thanks very much in advance,
Dave