PDA

View Full Version : .htpasswd -update with perl?


cortic
09-11-2007, 06:09 PM
I have 4 domains for a client, each has a different site with different info and each has a clone 'admin' section with basic authentication .htaccess and .htpasswd.

I need to make an interface for site 1 so that my client can update access details for the other 3, in each section (site) 'admin' access means they can change basic stuff like 'news' or 'links' etc. <this is what I'm working on, but it occurs to me there is a problem with access to remote .htpasswd (especially on the other domains)

since I've never used .htaccess before I need to ask, is there a way to update the .htpasswd file locally and remotely with perl? I can find nothing to even encode the password never mind access the .htpasswd file.

thanks.

FishMonger
09-11-2007, 06:16 PM
I have not used these modules myself, but they might help.

http://search.cpan.org/~bdfoy/Apache-Htaccess-1.4/lib/Htaccess.pm
http://search.cpan.org/~srezic/WE_Framework-0.097_01/lib/WE/Util/Htaccess.pm
http://search.cpan.org/~kmeltz/Apache-Htpasswd-1.8/Htpasswd.pm