I know vBulletin uses bitperms, I was using them too but when I got to 10^63
they stopped working, it wouldn't handle any numbers greater than that (it being my PHP host).
I'm curious to know what myBB, PhpBB, IPB, Joomla
and other scripts on the net use for permission systems, I really want to use a fast permission setup in my script. Right now I've implemented a sql variable on each user called permgroups and would have a value such as 1,4,5
and each of those numbers correspond to a permission group which has a similar variable called canseepages 1,2,3,4,1,4,1,54,6,4,5,22,6,2,3,4,1,2
which correspond to each page I have.
First I select permgroups in PHP
Then I use PHP's explode on permgroups
then I do a foreach on every perm group the user can see
within the foreach I run a sql query to grab the canseepages variable from the permissions group
I then append this to a variable so I end up with something MASSIVE like
$variable = '1,2,3,4,5,6,7,8,9,2,22,55,44,55,33,44,11,44,33,44,11,33,44,'.
'22,33,44,11,22,33,44,33,11,22,33,44,33,22,33,44,55,44,'.
'55,54,26,77,84,645,345,233,11,4,11,3,32';
That variable represents all the pages the user is allowed to view. I then explode that into an array of numbers and I use in_array()
to check if the current page they're trying to view is within that array of pages they're allowed to view.
It's pretty fast now but I'm just thinking there must be a faster method of doing all this in general.