lib/Ius/Dav/Htpasswd.pm
branchfoerste
changeset 55 68a8cf343f66
parent 54 1de953919a97
child 56 eea8bbbf3818
equal deleted inserted replaced
54:1de953919a97 55:68a8cf343f66
   126     $htpasswd->writeInfo( $user, time + 24 * 60 * 60 * $expiry )
   126     $htpasswd->writeInfo( $user, time + 24 * 60 * 60 * $expiry )
   127       or die $htpasswd->error;
   127       or die $htpasswd->error;
   128 
   128 
   129     my $master_user = $conf->{master_user};
   129     my $master_user = $conf->{master_user};
   130     my $conf_file   = "$conf->{conf_d}/$user.conf";
   130     my $conf_file   = "$conf->{conf_d}/$user.conf";
       
   131     (my $loc = $conf->{dav_base_remote}) =~ s|^[^:]+://[^/]+||;
       
   132     $loc .= "/$user";
   131     open C, '>', $conf_file or die "Can't open '$conf_file': $!";
   133     open C, '>', $conf_file or die "Can't open '$conf_file': $!";
   132     print C <<EOC;
   134     print C <<EOC;
   133 <Directory "$user_dir">
   135 <Directory "$user_dir">
   134     Dav On
   136     Dav On
   135     Order Allow,Deny
   137     Order Allow,Deny
   141     Require user $master_user $user
   143     Require user $master_user $user
   142     # don't allow script execution
   144     # don't allow script execution
   143     Options Indexes
   145     Options Indexes
   144     AllowOverride None
   146     AllowOverride None
   145 </Directory>
   147 </Directory>
       
   148 <Location "$loc">
       
   149     Order Allow,Deny
       
   150     Allow From All
       
   151     Deny From None
       
   152 </Location>
   146 # vi:ft=apache
   153 # vi:ft=apache
   147 EOC
   154 EOC
   148     close C;
   155     close C;
   149 
   156 
   150     0 == system qw(apache2ctl graceful)
   157     0 == system qw(apache2ctl graceful)