vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Usergroup bitfield permissions - conflict issue ? (https://vborg.vbsupport.ru/showthread.php?t=78352)

cinq 03-18-2005 11:00 PM

Usergroup bitfield permissions - conflict issue ?
 
I need some help trying to figure this out.

I use the following in my includes/init.php for my hack :
PHP Code:

$_BITFIELD['usergroup']['[b]vbarticlespermissions[/b]'] = array(
    
'canviewarticles'        => 1,
    
'cansubmitarticles'        => 2,
    
'cancommentonarticles'        => 4,
    
'canratearticles'             => 8,
    
'caneditdelowncomments'            => 16
); 

If there are other bitfields further up/down in the init.php file with a similar bitfield name, say 'canviewarticles'

PHP Code:

$_BITFIELD['usergroup']['[b]notvbarticlepermissions[/b]'] = array(
    
'canviewarticles'        => 1
); 

There shouldn't be any conflict, since the names of the array is different, right ? ( note the parts in bold in both code segments above )
Or am I mistaken, because it seems it does matter. ( the bitfield name )
Any help would be most appreciated :)

deathemperor 03-19-2005 12:34 AM

no, it won't conflict until the array name is not the same. (and hehe, you can't bold anything in [php])

this is simple but why wouldn't you try it before asked ^^ ?

cinq 03-19-2005 12:53 AM

Like i said, it seems it does matter ( because I tried it )

Now I am wondering, why should it ?? :(

Marco van Herwaarden 03-19-2005 08:41 AM

It does matter. All bitfield permissions are automatically set during init. In the init these are still 2 different permissions, but both are set to be used as 'CANVIEWARTICLES'. This means you could still test against the array if you have permissions, but you can't use CANVIEWARTICLES anymore.

cinq 03-19-2005 11:50 PM

So we're saying that such an if conditional in the template :

Code:

<if condition="$permissions['vbarticlespermissions'] & CANVIEWARTICLES">
won't take the permissions from my vbarticlespermissions, because there is a confusion with another permissions array ?

Very odd isn't it, then why bother putting them in their own groups in the first place ??

cinq 03-30-2005 04:29 AM

anyone ?

Marco van Herwaarden 03-30-2005 05:03 AM

They are put in their own groups because each group is stored as a seperate column in the database.

Putting them all together would require huge permission values.


All times are GMT. The time now is 08:20 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01456 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete