vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Secure non-vbpages (https://vborg.vbsupport.ru/showthread.php?t=39949)

xug 06-17-2002 03:06 AM

Secure non-vbpages
 
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..

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;))
PHP Code:

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


into the header under :
PHP Code:

require("./global.php"); 

Satan

Xenon 06-17-2002 01:17 PM

PHP Code:

if ($bbuserinfo[usergroupid]!=0) {
    
show_nopermission();


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

PHP 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

Quote:

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?

PHP Code:

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:
PHP Code:

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

Quote:

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


All times are GMT. The time now is 07:25 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.01227 seconds
  • Memory Usage 1,756KB
  • 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
  • (6)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (21)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