Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
Ok iv made it on the homepage at vagweb that to gain access to the drop down brochure lists you have to be registered and logged in.
That works fine, but if someone already had the full link to the brochure ie
http://www.vagweb.co.uk/brochures/blah.pdf
how could i stop them direct linking to this path ? or even direct link only if they are logged in?
|
Liam
Member
Registered: 19th Jan 06
Location: Stafford
User status: Offline
|
Password it?
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
i have password protected the directory but then it doesnt work when linking from the site, asks for password etc
|
PaulW
Member
Registered: 26th Jan 03
Location: Atherton, Greater Manchester
User status: Offline
|
will you be authenticating the brochure download to the phpbb system??
how about a download mod or something, or are you looking for something more custom?
yes it is possible, but for a full custom system to allow you to upload and assign download permissions to existing groups may take some time if your not 100% familiar with the phpbb structure...
saying that, im currently doing a re-write of FAP to allow for group quota's on disc space instead of image allocations, aswell as hotlink enable/disable per group... fun!
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
i am familiar with the php system, all i want it to do is load the brochures when using the drop down menus on the site, but not using a direct link
|
Laney
Member
Registered: 6th May 03
Location: Leeds
User status: Offline
|
Use Permissions that are set with a cookie?
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
cookies im not great with, any clues?
i know how to set a cookie but dont know how to work with permissions and cookies
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
Put the brochures outside web root, then have a PHP script stream the data to the authenticated user.
Basically select user and pass from your member table, compare those to your cookie variables, when you're happy with that set the appropriate headers with header() function, then do a readfile() to dump out the contents of the file you've fetched from the filesystem which doesn't have a URL.
We have one here which may be some use except its written for this basecode.
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
ps. alternatively put the brochures user/pass in a thread in one of the member areas and use htaccess to protect the folder.
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
2nd idea is the most straight forward but id like it to just work.
readfile() - il look up the usage of that command, that sounds promising thanks
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
Yeah all you're doing is streaming data to the client that you're getting from the other file which doesn't have a URL. Script would be very simple indeed were it not for the need to authenticate as well.
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
ok i have something working
for example
http://www.vagweb.co.uk/brochures/octavia01.php
takes you to login page if your not logged in otherwise it starts to stream the pdf using readfile
i assume it took you to login page ian?
[Edited on 18-11-2006 by Steve]
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
Indeed.
You should really have that as one script with a query though - brochure.php?octavia01 for example
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
yes that was my next move lol
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
ok done that
http://www.vagweb.co.uk/brochures/brochure.php?octavia01
should give you the brochure or the login page if your not logged in
|
Steve
Premium Member
Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
|
thanks for helping me sort that out guys btw
|