vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Using Usergroup ID's to allow/deny Permisson question (https://vborg.vbsupport.ru/showthread.php?t=202860)

haxcommunity 01-23-2009 08:23 PM

Using Usergroup ID's to allow/deny Permisson question
 
I'm making a seperate PHP based page, what code can I use to allow/deny access to the page based on a usergroup ID?

m002.p 01-23-2009 09:27 PM

Hi once calling /global.php try using the following code:

PHP Code:

if ($vbulletin->userinfo['usergroupid'] == x
{

// Some Code



OR

PHP Code:

if (is_member_of($vbulletin->userinfo,X))  
{

// Some Code



Obviously X needs replacing with the group :)

Lynne 01-23-2009 09:36 PM

PHP Code:

if (!isset($vbulletin->userinfo['userid']) OR $vbulletin->userinfo['userid'] == OR !is_member_of($vbulletin->userinfo,x,y,z))
{
    
print_no_permission();



haxcommunity 01-23-2009 09:38 PM

Thanks guys, all fixed ;)

King Justice 01-24-2009 10:37 PM

Hello, please help, not working for me:

PHP Code:

include("./forum/global.php");

if (!isset(
$vbulletin->userinfo['userid']) OR $vbulletin->userinfo['userid'] == OR !is_member_of($vbulletin->userinfo,20))
{
    
print_no_permission();



Lynne 01-24-2009 11:01 PM

And what is happening instead?

You should do a chdir before including global instead of the way you did it.

King Justice 01-25-2009 01:33 AM

Quote:

Originally Posted by Lynne (Post 1723784)
And what is happening instead?

You should do a chdir before including global instead of the way you did it.

What's a chdir?
And the page breaks and doesn't work..

Please help..

Lynne 01-25-2009 02:53 AM

PHP Code:

chdir('/path/to/your/forums');
require_once(
'./global.php'); 


Dismounted 01-25-2009 03:05 AM

PHP Code:

chdir('./forum/');
require_once(
'./global.php');

if (!
is_member_of($vbulletin->userinfo20))
{
    
print_no_permission();



King Justice 01-25-2009 01:37 PM

Quote:

Originally Posted by Dismounted (Post 1723890)
PHP Code:

chdir('./forum/');
require_once(
'./global.php');

if (!
is_member_of($vbulletin->userinfo20))
{
    
print_no_permission();



Used that but page is still breaking... :o


All times are GMT. The time now is 04:05 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.03303 seconds
  • Memory Usage 1,752KB
  • 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
  • (7)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete