Log in

View Full Version : Secure non-vbpages


xug
06-17-2002, 03:06 AM
How can I secure non-vbpages from visitors and can only be seen by my members??

I thought that I have seen it somewhere but can find it.

Please help me on this.

Logician
06-17-2002, 09:02 AM
Check WebTemplates Hack (https://vborg.vbsupport.ru/showthread.php?s=&threadid=36419)..

Chris M
06-17-2002, 01:11 PM
xug...

If you are using .php files and templates, just insert this :
(Thanks to Xenon for pointing out my mistake;))
if ($bbuserinfo[userid]==0) {
show_nopermission();
}
into the header under :
require("./global.php");

Satan

Xenon
06-17-2002, 01:17 PM
if ($bbuserinfo[usergroupid]!=0) {
show_nopermission();
}

then nobody except unregistred can go to the page :)
i think satan meant this code:


if ($bbuserinfo[userid]==0) {
show_nopermission();
}

Chris M
06-17-2002, 06:17 PM
Yep...

Lol...

Thanks Xenon...:)

Satan

xug
06-17-2002, 06:34 PM
Thank you all guys, I needed that for php pages I already have up and running.

Logician, your hack is looking cool, I have downloaded it and when my members give me a break I will install it.

filburt1
06-17-2002, 06:37 PM
Remember that Banned by Administrators is a usergroup too ;)

xug
06-17-2002, 06:49 PM
Originally posted by filburt1
Remember that Banned by Administrators is a usergroup too ;)

Thank you filburt1, the most important group :cool:

So how will the code be with that group too???

Chris M
06-17-2002, 07:05 PM
To ban that group?

if ($bbuserinfo[usergroupid]==X) {
show_nopermission();
}
You will need to change the "X" to the group id of the Banned by Administrators group...

Satan

Xenon
06-17-2002, 07:14 PM
*ggg*
satan same fault again:

if ($bbuserinfo[usergroupid]==X) {
show_nopermission();
}
that's correct ;)

Chris M
06-17-2002, 07:31 PM
Are you sure Xenon?

I thought it was "!=" for usergroups and "==" for userids...

:confused:

Satan

Xenon
06-17-2002, 07:35 PM
yes i am sure
it alwasy depends on what you want to do.

if you want to deny access it to one user you must use this
if ($bbuserinfo[userid]==X) {
show_nopermission();
}

if you want it to deny it to a whole group use this:
if ($bbuserinfo[usergroupid]==X) {
show_nopermission();
}

if you want to allow it just one user you have to use this:
if ($bbuserinfo[userid]!=X) {
show_nopermission();
}

and if you want to allow it to only one usergroup:
if ($bbuserinfo[usergroupid]!=X) {
show_nopermission();
}

Chris M
06-17-2002, 07:37 PM
Ah right...

Cos ive always used "!=" when doing usergroups, and it works just fine:)

Satan

Xenon
06-17-2002, 07:41 PM
lool, then i think you have had very much luck :)

Chris M
06-17-2002, 07:45 PM
Probably yes:)

Use Xenon's code...He seems to think it is safer;)

Satan

Xenon
06-17-2002, 07:50 PM
"Use Xenon's code...He seems to think it is safer"

this is always a good suggestion ;)

Don't care, nobody's perfect ;)

Chris M
06-17-2002, 07:56 PM
Well...

Anybody who knows me knows I like to live life on the edge;):D

Satan

Logician
06-17-2002, 07:59 PM
Originally posted by hellsatan

I thought it was "!=" for usergroups and "==" for userids...


!= means if NOT equal to
== means if equal to

:glasses:

Chris M
06-17-2002, 08:02 PM
Aha...

My board musta been screwed up then...

Satan

xug
06-18-2002, 01:17 AM
Thank you so much guys, I really do appriciate your kind help !!

Chris M
06-18-2002, 05:52 PM
Lol...

Glad we could help lol...

Satan