vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Permissions change in code (https://vborg.vbsupport.ru/showthread.php?t=210648)

soundbarrierpro 04-08-2009 11:20 AM

Permissions change in code
 
As this is not part of the actual vbpowered page mod and is a permissions modification added to it, I figured I should post here.

Right now I have some pages I created and added permissions to. However, they are only permissions which deny guests.

I want to change to this setting only specific user groups Below is the statement I'm using


PHP Code:

if ($show['guest']) 
    { 
        
print_no_permission(); 

    } 

How can I reconfigure so that it's only the user groups I want?

Thank you

Cryo 04-08-2009 12:35 PM

You can do something like this...

PHP Code:

$allowed_usergroups = array(1,2,3,4);

if (!
in_array($vbulletin->userinfo["usergroupid"], $allowed_usergroups)) {

     
print_no_permission();  
     
    } 

Place the usergroups you want to allow in the array (separated by commas, of course). If the user is not in that group it will give the no permission message.

soundbarrierpro 04-08-2009 12:59 PM

I will try this.

Thank you

.......................................

Tried and working perfectly. Thank you! :)


All times are GMT. The time now is 01:22 PM.

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.01001 seconds
  • Memory Usage 1,714KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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