1 (edited by AKA 2007-12-04 03:46)

Topic: Password Protecting Pages / Linking User/Pass To Forums

Let me try to explain a little.

I created a page which I want password protected, but I only want people who are registered members on my forums to be able to view it, otherwise they get a unauthorization error.

Does anyone have a script, mod, TUT of some sort that shows step by step on how to set this up? This would be much appreciated!

Re: Password Protecting Pages / Linking User/Pass To Forums

Moved to Modifications

Re: Password Protecting Pages / Linking User/Pass To Forums

yup.

if ($pun_user['g_id'] == PUN_GUEST)
error($lang_common['No permission']);

As long as you have your page, intergrated with punbb it will work. all you do is add it, and if they are not logged in it will tell them they cant access. if they are logged in, it will carry on

Sorry. Unactive due to personal life.

4

Re: Password Protecting Pages / Linking User/Pass To Forums

matt1298 wrote:

yup.

if ($pun_user['g_id'] == PUN_GUEST)
error($lang_common['No permission']);

As long as you have your page, intergrated with punbb it will work. all you do is add it, and if they are not logged in it will tell them they cant access. if they are logged in, it will carry on

where do I add that exactly lol? The HTML part of my webpage?

5 (edited by MattF 2007-12-05 10:18)

Re: Password Protecting Pages / Linking User/Pass To Forums

If you're putting it within a html section, you need to enclose it within php tags, i.e:

<?php
if ($pun_user['g_id'] == PUN_GUEST)
{
     error($lang_common['No permission']);
}
?>

6

Re: Password Protecting Pages / Linking User/Pass To Forums

MattF wrote:

If you're putting it within a html section, you need to enclose it within php tags, i.e:

<?php
if ($pun_user['g_id'] == PUN_GUEST)
{
     error($lang_common['No permission']);
}
?>

Wouldn't it be more efficient to use the "message" function?

<?php
if ($pun_user['g_id'] == PUN_GUEST)
{
     message($lang_common['No permission']);
}
?>

Re: Password Protecting Pages / Linking User/Pass To Forums

yeah. It was the only bit of code i had open with that near enufgh code.

Sorry. Unactive due to personal life.

8

Re: Password Protecting Pages / Linking User/Pass To Forums

Must admit, I'd never noticed the error function had been used. big_smile

9

Re: Password Protecting Pages / Linking User/Pass To Forums

How exactly does this code work?

Where exactly do I put it?

What I'm doing is creating a new folder with the index.html (E.G - example.com/movies), but my forums would be (example.net/forum) so how would I be able to block out non-registered users with that code that way?