PDA

View Full Version : Password Protected Directories


kellyc
02-07-2007, 07:06 PM
HI:

We built a script that password protects directories. It checks the user session to verify that someone is logged on before letting them download a document.

Previously, we were having trouble with price lists etc, that should have been password protected, but if someone had the full url, they could access it directly. Many of them were accidentally crawled by google.

At any rate, i don't have the know-how or the inclination to create a plug-in, but I would be happy to give the script to someone else if they want to create a plug-in based on it.

Our script locks the 'media' directory and a 'documents' directory, but it could easily be modified to cover anything else. The downside is that none of the docs in those directories are available to non-authenticated users.

PM me if you want the files.

Kelly

Mike Morrison
02-10-2007, 05:08 AM
i don't have the know-how
As far as technical complexity goes, if you can write a script that password protects directories creating a plugin should be a breeze.

Hint: It's all about the install manifest (http://wiki.soholaunch.com/index.php?title=Plugin_install_manifest).

...or the inclination
Three good reasons to wrap your scripts as a plugin....


They'll be forwards-compatible. You can update your soho version via Software Updates to your heart's content as often as you'd like and you won't have to worry about it overwriting your modifications and forcing you to re-upload your modified files every time.

It's super-easy to post your plugin on our addons website (http://addons.soholaunch.com) and make money off it.

I've heard several people ask for exactly the functionality that your script provides (password protect media files, etc)....back to point #2. ;)

lwyau
02-12-2007, 11:13 AM
Kelly's script works great. The way it works, however, is to insert RewriteRule in .htaccess, which invokes a php script to block/allow file access in "media" folder.

Question for Mike: Since this is independent of soho, I can't see a way to "hook" for making it a plugin. Is there a way? Thanks!

kellyc
02-18-2007, 01:34 AM
if you can write a script that password protects directories creating a plugin should be a breeze

Actually, I didn't write it I am not a programmer so the install manifest might as well be writtin in swahili. :) I hired someone to write it for me, and just thought I would pass it on because I thought it was quite handy.

Question for Mike: Since this is independent of soho, I can't see a way to "hook" for making it a plugin. Is there a way?

My only thought is to modify the 'file manager' to include an 'upload password protected files' button. Then create a separate directory (instead of the media dir) for those files to live in. I am not sure if that is a plugin or a larger development effort.

Mike, I will PM you the link to the files if you want to have a look and make any suggestions on the best way to devise a plugin for it.

Thanks!

Kelly

GuardianHost
03-14-2007, 09:45 AM
Hello Kelly,

I would love to have a look at your password script. PM Sent.

- M
http://GuardianHost.com

MatthewM
03-16-2007, 03:36 PM
Hey, what do you know? I was going to ask about this. I setup a php include to a custom access to a table in the database behind the soholaunch security login, but if someone were to know the location of the media directory under sohoadmin, they could browse right to it. I'll send you a PM as well. I'll also note that if you did make a plugin for this, I'd probably buy it.