Announcement

Collapse
No announcement yet.

bitwise permissions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • merk
    replied
    Originally posted by Wayne Luke
    I guess that would work but it just happens to be exponential Binary technically. If you need to think of it as sum+1 instead of 2 to the nth power then by all means do so.
    Heh, well i guess ill call it 2 to the nth power to make everyone happy

    Leave a comment:


  • Wayne Luke
    replied
    I guess that would work but it just happens to be exponential Binary technically. If you need to think of it as sum+1 instead of 2 to the nth power then by all means do so.

    Leave a comment:


  • merk
    replied
    Originally posted by Nemon
    Same with anything, i've done stuff 10 year ago that if someone asked me about today i wouldn't know where to begin, actually same applys to things i did last week .
    I just looked at init.php (heh went home early )

    I cant see a flaw in my logic of sum+1

    Ill just paste a few lines, hopefully thats not too much of a crime!

    PHP Code:
    $_USEROPTIONS = array(
     
    'showsignatures' => 1,
     
    'showavatars'   => 2,
     
    'showimages'  => 4,
     
    'coppauser'  => 8,
     
    'adminemail'  => 16,
     
    'insouth'  => 32
    Now, adminemail is the sum of everything before it (1 + 2 + 4 + 6) which equals 15, plus 1?

    Ive got the rest of it worked out though, i just have to add more to it.

    And finally another question --> Why isnt this stuff stored in the datbase somewhere? Speed?

    Leave a comment:


  • Nemon
    replied
    Originally posted by merk
    I did that in Yr11, hard to remember, though.
    Same with anything, i've done stuff 10 year ago that if someone asked me about today i wouldn't know where to begin, actually same applys to things i did last week .

    Leave a comment:


  • merk
    replied
    Originally posted by Nemon
    Lookup base 2(binary) math and and logical and operations.
    I did that in Yr11, hard to remember, though.

    Leave a comment:


  • Nemon
    replied
    Originally posted by merk
    My understanding of those type of permissions is the sum of the existing + 1.

    For example, if you had, 1 ,2 ,4 ,8, the sum of those, adds up to 15, and the next one you would use is 16?

    So the permissions used in vBulletin are hard coded into init.php? (CANVIEW, CANADMINPANEL) ?

    I just cant seem to find anything in the database :\
    Lookup base 2(binary) math and and logical and operations.

    Leave a comment:


  • merk
    replied
    Originally posted by Wayne Luke
    Actually, it isn't as easy as sum+1...

    The first permission is 1, the second 2, the third is 4 and so forth.

    The permissions are parsed in init.php so you can see what they figure out to.
    My understanding of those type of permissions is the sum of the existing + 1.

    For example, if you had, 1 ,2 ,4 ,8, the sum of those, adds up to 15, and the next one you would use is 16?

    So the permissions used in vBulletin are hard coded into init.php? (CANVIEW, CANADMINPANEL) ?

    I just cant seem to find anything in the database :\

    Leave a comment:


  • Wayne Luke
    replied
    Actually, it isn't as easy as sum+1...

    The first permission is 1, the second 2, the third is 4 and so forth.

    The permissions are parsed in init.php so you can see what they figure out to.

    Leave a comment:


  • merk
    started a topic bitwise permissions

    bitwise permissions

    Not being able to look at any permissions code for the next day, im just curious:

    Where are the permissions stored in vBulletin(the names like CANVIEW or CANADMINPANEL)?

    And i would assume it would be as simple as adding a new permission with an id that is the sum +1 of all entries so far?

    And to check if they have a permission to view the page it would be a simple -> if (CANCUSTOMPERM) { <user can use this code> } ??

    Cheers
    merk

Related Topics

Collapse

Working...
X