Advertisement:

Author Topic: Folder Security  (Read 432 times)

Offline pepa

  • Jr. Member
  • **
  • Posts: 192
Folder Security
« on: March 12, 2018, 12:37:01 AM »
I have a folder placed one level up from the Forum's root directory.  It contains lots of pdf documents that are linked to from within posts in the forum.  I would like to be able to make this folder secure within the forum, so any registered forum member can access the files there by clicking the links within the relevant posts.  I also want Mr Google to keep out.

So I have tried the usual robots.txt file while realising this is no guarantee.  Yes I could password protect the folder and then give the password to forum members but that's kinda messy.  I've looked for some mods but come up with a blank.  Does anyone have suggestions?

Offline aegersz

  • SMF Hero
  • ******
  • Posts: 1,462
  • Gender: Male
  • "mods" junkie
    • dopetalk
Re: Folder Security
« Reply #1 on: March 12, 2018, 04:39:02 AM »
how do you link to the documents one directory up from your web root ?
The configuration of my Linux VPS (SMF 2.0 with 140+ mods) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum)

Offline pepa

  • Jr. Member
  • **
  • Posts: 192
Re: Folder Security
« Reply #2 on: March 12, 2018, 05:01:53 AM »
how do you link to the documents one directory up from your web root ?

It's one directory up from the forum root not from the web root.  So e.g. domain is reformaps.net.au

there's a folder docs then -> a folder forum.  So link to the docs is reformaps.net.au/docs.doc.pdf, then I use target=_blank to open in a new tab.

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 50,104
Re: Folder Security
« Reply #3 on: March 12, 2018, 05:06:18 AM »
might be easier for you to use a downloads mod or just attach the files to the posts and let SMF take care of the permissions for access.

Offline pepa

  • Jr. Member
  • **
  • Posts: 192
Re: Folder Security
« Reply #4 on: March 12, 2018, 06:28:17 AM »
might be easier for you to use a downloads mod or just attach the files to the posts and let SMF take care of the permissions for access.

Hi Illori, thanks for your suggestion.  I can't attach the files to the posts as I have created a library using just one post.  Don't think I can attach 100 files to one post and, in most cases I need people to be able to open the file in a new tab and read it there not download an attached file.  Are you aware of a downloads mod that will let me do that?

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 50,104
Re: Folder Security
« Reply #5 on: March 12, 2018, 07:18:00 AM »
check the downloads system, it may do what you need.

Offline pepa

  • Jr. Member
  • **
  • Posts: 192
Re: Folder Security
« Reply #6 on: March 12, 2018, 08:44:19 AM »
check the downloads system, it may do what you need.

Thanks again Illori, I tried it but it will only allow downloads, it doesn't have an option to open the file in a new tab.  Also I encountered errors in the permissions, when I set the permissions for a Global Moderator to view the downloads the menu item didn't appear .. in the end I uninstalled the mod.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 57,390
  • Gender: Male
    • Kindred-999 on GitHub
Re: Folder Security
« Reply #7 on: March 12, 2018, 09:00:03 AM »
in short, there is no good or easy way to do what you are asking.

You can not easily use the SMF security system to limit access to a directory.
SMF uses php
direct file/directory structure/access uses your web server (probably apache) and/or file system (Linux or Windows)

You have to put a layer between the files and the user, that uses php to access the files.
Either attachments or a download system...   or a third party file controller system.

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Online Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 17,587
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: Folder Security
« Reply #8 on: March 12, 2018, 12:43:11 PM »
You could use something like this http://www.directorylister.com/
together with SSI. I haven't tried that, no warranties from me, just an idea.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline pepa

  • Jr. Member
  • **
  • Posts: 192
Re: Folder Security
« Reply #9 on: March 13, 2018, 08:22:32 AM »
Thanks for all the suggestions, much appreciated.  I thought about adding another layer between the server and the forum authentication, but then people would need two logins.  In the end I decided upon a more practical solution ... looked at the files and the majority of them don't have to be protected, so they'll all remain in an unprotected folder and people can open them in a new tab by clicking the link.  I moved the much smaller number of files that do need protection to another folder and password protected that with the web server software.  I'll just have to give the password out to forum members as required.  I can live with that.