vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Protecting NON-VB Pages. (https://vborg.vbsupport.ru/showthread.php?t=46950)

Sebastian 12-23-2002 11:15 PM

Protecting NON-VB Pages.
 
Okay, I search for such a hack, found a couple, some work, and others don't even make any sense.

Basically this is what I want:

1) Protect pages, so a user must be registered to view it.

2) Say I put a link on my front page that leads to a file... how do I block non members from clicking the link, so the download doesn't start and they get directed to the login/register page?

3) When they log in it directs them to the page they were trying to view.

I have an idea how to do it, but I want to make sure I am choosing the right method.

I know I would need to put something like this in the head section of the page I want to protect:

<?php
chdir("forums/");
require("global.php");

if ($bbuserinfo[userid]==0)
{
blah, blah..
?>

am I close? ;)

my main focus it protecting links so people can't download my files if they aren't registerd.

thanks.

Chris M 12-23-2002 11:22 PM

Yes...

Code:

<?php
chdir("./forums");
require("./global.php");

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

:)

Satan

Sebastian 12-23-2002 11:42 PM

Hmm.. getting include errors.

This is how I have my pages:
Code:

<?php
include("../config.php");
include("../header.php");
?>

// content

<?php
include("../footer.php");
?>

I tried like this but get still get include errors.
Code:

<?php
chdir("./forums");
require("./global.php");

if ($bbuserinfo[userid]==0) {
show_nopermission();
}
include("../config.php");
include("../header.php");
?>

// content

<?php
include("../footer.php");
?>

I also tried putting it after header but then it can't find the footer.

Sebastian 12-23-2002 11:53 PM

okay apparently i need more code than just that....

I only got it to work by setting FULL path starting from /home :(

and after I tried to view the page it inserted the VB login page INSIDE the non VB page LOL it was messy, broken images etc....

I found this hack but it's way sloppy:
https://vborg.vbsupport.ru/showthrea...threadid=36934

how do I protect links like attachments? so people can't download the files that are on no vb page?

Xenon 12-24-2002 12:03 AM

you can't protect those files really, except if you save em into the db as attachments :)

Sparkz 12-24-2002 12:27 AM

Sure you can.
You can put them outside directory-tree that comprises your web-space and have some php-file output them. I imagine this is exactly what PPN's 'attachments as files'-hack does.

Sebastian 12-24-2002 04:38 PM

Xenon, where did your reply go? i got an email and i don't see it here ;) LOL

someone try to make this hack, i know it's possible just don't have the knowledge.

okrogius 12-24-2002 04:57 PM

Quote:

Originally posted by Xenon
you can't protect those files really, except if you save em into the db as attachments :)
Actually that's not true. All you need to do is move them to a non-web acessible locations. Then create a file which outputs them using fpassthrough() after checking login, that is all.

Sebastian 12-24-2002 05:09 PM

so can you make a working hack? :)

okrogius 12-24-2002 06:05 PM

<a href="https://vborg.vbsupport.ru/showthread.php?threadid=46963" target="_blank">https://vborg.vbsupport.ru/showt...threadid=46963</a>


All times are GMT. The time now is 02:07 AM.

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.00990 seconds
  • Memory Usage 1,737KB
  • 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_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete