I have developed sort of a Server Explorer as a module for our web application, and it actually works great. I am doing some refinements to it and there is one problem I don't really know how to tackle.
The Explorer is mainly used to choose pictures from a specified folder and subfolders. As some schools are concerned with distribution of pictures outside of their establishment, we gave them an option to secure their pictures with .htaccess (actually over Web-Interface which in turn sets the .htaccess) if they want to.
When I try to access a folder which is protected by .htaccess, I am prompted a password for each and every picture inside that folder. It is worth noting that teachers tend to do 100+ pictures on every major event and like to cram it into one single folder, so it actually isn't rare that the browser opens up 100+ dialog Boxes.
We are running Perl in the backend so I thought that I could check if a given folder is protected or not before delivering the content to jQuery. Problem is, images can also be protected by a .htaccess from a parent folder.
Is there any secure way to check if an outsider can access these pictures (or files, to keep it generic and open for other uses) before giving out the pictures?
EDIT - Added .htaccess file
## OLEFA AUTH START ##
AuthType Basic
AuthName "192.168.1.120/resources/images/accesstest"
AuthUserFile /home/mike/workspace/olefa//resources/images/accesstest/.htpasswd
require valid-user
## OLEFA AUTH END ##