vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Protected downloads (https://vborg.vbsupport.ru/showthread.php?t=51027)

John 03-31-2003 11:50 AM

Protected downloads
 
How can I protect downloads so only members can access certain files? (Without putting the files in a database)

Can it be done with PHP alone?

Brad 03-31-2003 11:55 AM

Are you doing this with the vB member database?

John 03-31-2003 11:56 AM

Yep

Brad 03-31-2003 12:28 PM

Just include global.php in your scripts and add something like this:

PHP Code:

if ($bbuserinfo['usergroupid']==0) { // do not allow guest
  
eval("standarderror(\"".gettemplate('error_nodownload')."\");");


and a new custom template that reads

Code:

Only members can download files!

John 03-31-2003 12:37 PM

That's not actually protection though, if the URL of the file gets out anyone can download the files.

Brad 03-31-2003 12:45 PM

Then i really subjest putting them in a table, and using a script to call the files by id, the files themselfs dont have to be in the db, as long as the link is there and you dont show the users the direct url.

This might help you aswell (if you are storing the files on diskspace): http://www.vbulletin.com/forum/showt...threadid=19021

Sebastian 04-03-2003 05:02 PM

<a href="https://www.vbulletin.org/hacks/index.php?s=&action=showhack&hackid=830" target="_blank">http://www.vbulletin.org/hacks/index...ack&hackid=830</a>


All times are GMT. The time now is 02:20 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.01179 seconds
  • Memory Usage 1,717KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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