use checkboxes for the access level
Hi,
I first needed a simple access level page verification, where we had the choice between an Admin or a regular User (i.e. one user group). Then, they needed to have two groups separated (access two sub sites), so we ended up with Admin (who can access the admin section AND the two sites), User (who can access the two sites), teasdale (who can only access the first site) and unique (who can only access the second site). Everything was working well...
But now, the client tells us that they'll be 9 different sub-sites! We can't have a drop-down (in the user insertion or update) for all the possibilities (ex: access to sites 1 and 2, access to sites 1 and 3, access to sites 5 and 7 and 9, etc...). So, the best option is to go with checkboxes instead of a drop-down...
I managed to change the code so we can have checkboxes in the insert page and it can insert a coma-separated liste (ex: 2, 3, 4) of groups... I hope that the best way to do it... But I still have a problem: when validation to give access to a site, I need to have the exact string (ex: 2 or 2,3 or 2,3,4, etc)... So I would have to create a lot of conditions for each sub-site... Is there a way to extract a number (ex: site 3 would be "3") from the list and just check if that number is present in the user access Group ID? I know there are PHP functions to do it, but I don't want to mess too much with the written code...
Thank you.