add access control by location to config snippets foerste
authorMatthias Förste <foerste@schlittermann.de>
Fri, 22 Jul 2011 09:28:52 +0200
branchfoerste
changeset 55 68a8cf343f66
parent 54 1de953919a97
child 56 eea8bbbf3818
add access control by location to config snippets
lib/Ius/Dav/Htpasswd.pm
--- a/lib/Ius/Dav/Htpasswd.pm	Fri Jul 22 09:10:36 2011 +0200
+++ b/lib/Ius/Dav/Htpasswd.pm	Fri Jul 22 09:28:52 2011 +0200
@@ -128,6 +128,8 @@
 
     my $master_user = $conf->{master_user};
     my $conf_file   = "$conf->{conf_d}/$user.conf";
+    (my $loc = $conf->{dav_base_remote}) =~ s|^[^:]+://[^/]+||;
+    $loc .= "/$user";
     open C, '>', $conf_file or die "Can't open '$conf_file': $!";
     print C <<EOC;
 <Directory "$user_dir">
@@ -143,6 +145,11 @@
     Options Indexes
     AllowOverride None
 </Directory>
+<Location "$loc">
+    Order Allow,Deny
+    Allow From All
+    Deny From None
+</Location>
 # vi:ft=apache
 EOC
     close C;