Hi Folks,
I've got a bit of a problem that I'm getting lost with....
Each of my customers sites have log files and Webalizer processes them to
provide the pretty pictures. I want to provide an easy way to password
protect each set of log files with users current username and password from
a database! EASY you say, I can use mod_auth_mysql or simular... but this
is where is gets a little complex...
I want to display the logs through my support site so each set of logs is
available at: (www.site.co.uk/support/logs/acc_id/) If I just setup
mod_auth_mysql and protect /support/logs/ then it only checks for a username
and password - so any of my customers could access anyone elses log files!
I don't want to have to setup <Location /support/logs/acc_id/> for each
account because that would be VERY long winded, I'd rather just have a
single directive like <Location /support/logs/*/> where * represents the
acc_id that can then be checked against the username. My database is fairly
simple, it's got a
table_customer with acc_id, username, password, (and a few other contact
details). But how would i go about confirming the that * directory was the
same as the acc_id in the database?
I wondered if I could use UserDir as that allows a bit of use of the /*/
representing a bit of a wildcard (the unix users and those in the support
database are completely different) and I dont' think that would get me
anyway...
I maybe able to use groups with mod_auth_mysql, something like
<Location /support/logs/*/>
AuthName Support Site
AuthType Basic
AuthMySQLHost localhost
AuthMySQLDB authdata
etc
require group /*/
</Location>
but I'm not sure how to get this working dynamically or on the specific
context, the example above would surely just allow any group? The best
documentation of the version of mod_auth_mysql I can find is at
http://www.doc.eng.cmu.ac.th/ldp/howto/mod_auth_mysql-1.11/ 0
Obviously in a php script this would take no time at all, but I need this to
work to protect the whole folder and not just a script.
Any ideas or suggestions (or solutions) greatly appreciated...
TIA
nickyboy