vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Other page pulling permissions (https://vborg.vbsupport.ru/showthread.php?t=219550)

hellswrath 07-27-2009 05:50 AM

Other page pulling permissions
 
Alright I have been looking for this for a while and can't seem to find it anywhere. I am a bit lost on how I should go about it.

I am making a new page offset from the forums.
Forums being in public_html/forum
and my script being in public_html/testfile

but what I am trying to do is get my script to use the users that are logged In the forum are allowed to see this page. And if they are not logged in they get a please login.

But this also has to pull there usergroups so I can limit what group sees what.

I have a idea how to do this but I see a lot of hacks/bugs/flaws around it, so I figured I would come here and see what you guys suggest or know of what I can use to going about this.

Thanks.

Dismounted 07-27-2009 06:18 AM

PHP Code:

$curdir getcwd();
chdir('../forum');
require_once(
'./global.php');
chdir($curdir);

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



hellswrath 07-27-2009 04:13 PM

Alright, that seems to work just fine. How would i narrow it down to the user id?

Lynne 07-27-2009 06:39 PM

So a certain user can't see the page?
PHP Code:

if ($vbulletin->userinfo['userid'] == x)
{
    
print_no_permission();


So no unregisitered users can see the page:
PHP Code:

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



hellswrath 07-28-2009 06:04 AM

Alright, thanks! You two have been a big help.


All times are GMT. The time now is 02:15 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.01613 seconds
  • Memory Usage 1,719KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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