Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-23-2002, 11:15 PM
Sebastian's Avatar
Sebastian Sebastian is offline
 
Join Date: Oct 2002
Location: America
Posts: 488
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 12-23-2002, 11:22 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes...

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

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


Satan
Reply With Quote
  #3  
Old 12-23-2002, 11:42 PM
Sebastian's Avatar
Sebastian Sebastian is offline
 
Join Date: Oct 2002
Location: America
Posts: 488
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 12-23-2002, 11:53 PM
Sebastian's Avatar
Sebastian Sebastian is offline
 
Join Date: Oct 2002
Location: America
Posts: 488
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 12-24-2002, 12:03 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you can't protect those files really, except if you save em into the db as attachments
Reply With Quote
  #6  
Old 12-24-2002, 12:27 AM
Sparkz's Avatar
Sparkz Sparkz is offline
 
Join Date: Nov 2001
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 12-24-2002, 04:38 PM
Sebastian's Avatar
Sebastian Sebastian is offline
 
Join Date: Oct 2002
Location: America
Posts: 488
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 12-24-2002, 04:57 PM
okrogius okrogius is offline
 
Join Date: Dec 2001
Location: USA
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 12-24-2002, 05:09 PM
Sebastian's Avatar
Sebastian Sebastian is offline
 
Join Date: Oct 2002
Location: America
Posts: 488
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so can you make a working hack?
Reply With Quote
  #10  
Old 12-24-2002, 06:05 PM
okrogius okrogius is offline
 
Join Date: Dec 2001
Location: USA
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:41 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07962 seconds
  • Memory Usage 2,251KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete