PDA

View Full Version : Other page pulling permissions


hellswrath
07-27-2009, 05:50 AM
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
$curdir = getcwd();
chdir('../forum');
require_once('./global.php');
chdir($curdir);

if (!is_member_of($vbulletin->userinfo, 6))
{
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?
if ($vbulletin->userinfo['userid'] == x)
{
print_no_permission();
}

So no unregisitered users can see the page:
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.