I have ZenPhoto set up with a single base album that contains all the other albums. I set up a password so only registered users can see any of the pictures. Everything works great, but I have one problem. If you know (or figure out or guess) the direct link to a photo you can actually access any picture on the server. This includes anything in the "albums" or "cache" folders.
Even though it is unlikely, this mean that all my pictures are available to anyone. I searched the forums and couldn't find anyone else with this problem. Could I have set something up wrong? Or is this a security issue?
Comments
I also recommend seaching the web for htaccess and hotlinking prevention.
eg. On my site if you use the following links it works ok:
http://www.minchinton.net/zenphoto/albums/ourphotos/blogpics/
http://www.minchinton.net/zenphoto/ourphotos/blogpics/Samsung_Galaxy_Spica_Black_Front.jpg.php
But if I use the exact link, I can see the photo
http://www.minchinton.net/zenphoto/albums/ourphotos/blogpics/Samsung_Galaxy_Spica_Black_Front.jpg
You could even put your "albums" folder outside the normal html part of your server so no one can access it. Drawback on that is that multimedia files like mp3s or movies will not work then.
@blue dragonfly: You actually can't disable image caching at all.
Your best line of defense is to relocate the album folder outside the browser paths as suggested by acrylian and to watermark your displayed images. Be warned that using the external album features is frought with peril. Do not attempt this unless you are quite comfortable with how file access works with server scripts.
I figured out a work around (read hack ) but if I leave the album folder where it is in the html part of the server, then set the full path to it in $conf['album_folder'] and set it as an 'external' path, I can then place a .htaccess file in the album folder that then completely locks out direct URL to the files in it. Something like below which is what I took from the Gallery data folder:
DirectoryIndex .htaccess
SetHandler Gallery_Security_Do_Not_Remove
Options None
<IfModule mod_rewrite.c>
RewriteEngine off
</IfModule>
Order allow,deny
Deny from all
This still leaves the cache folder exposed of course. I'm not quite sure why you say there needs to be access to the cache with direct urls files since this solution works for items in the album folder, wouldn't it work for the cache too? And Gallery seems to use all it's albums and cache data from a folder protected this way.
I could change the name of the cache folder to something random which would effectively hide it I believe.
This solution also has the advantage I can use protected photos on the public blog (zenpage) as they will be copied into the cache which is hidden but public, but the original files cannot be accessed without a login.
Thanks for the help again.