diff --git a/add.cgi b/add.cgi index e09fee8..8e07d73 100755 --- a/add.cgi +++ b/add.cgi @@ -48,12 +48,25 @@ my $usersfile = "$dir/$htusers"; foreach my $clash ("AuthUserFile", "AuthType", "AuthName") { my $dirclash = &apache::find_directive($clash, $conf); if ($dirclash) { - &error(&text('add_eclash3', $file, $clash)); + &error(&text('add_egclash', $file, $clash)); } } --r $usersfile && &error(&text('add_eclash2', $usersfile)); +-r $usersfile && &error(&text('add_egclash', $usersfile)); -l $file && &error(&text('add_esymlink', $file)); +# Add protected directory in other webserver plugins +foreach my $p (&virtual_server::list_feature_plugins()) { + if (&virtual_server::plugin_defined($p, "feature_add_protected_dir")) { + my $err = &virtual_server::plugin_call($p, + "feature_add_protected_dir", $d, + { 'protected_dir' => $dir, + 'protected_user_file_path' => $usersfile, + 'protected_user_file' => $htusers, + 'protected_name' => $in{'desc'} }); + &error($err) if ($err); + } + } + # Create .htaccess (as domain owner) &lock_file($file); &apache::save_directive("AuthUserFile", [ "\"$usersfile\"" ], $conf, $conf); diff --git a/delete.cgi b/delete.cgi index bffba50..1569f94 100755 --- a/delete.cgi +++ b/delete.cgi @@ -23,6 +23,16 @@ foreach my $path (@d) { &can_directory($path, $d) || &error($text{'delete_ecannot'}); my ($dir) = grep { $_->[0] eq $path } @dirs; if ($dir) { + # Delete protected directory in other webserver plugins + foreach my $p (&virtual_server::list_feature_plugins()) { + if (&virtual_server::plugin_defined($p, "feature_delete_protected_dir")) { + my $err = &virtual_server::plugin_call($p, + "feature_delete_protected_dir", $d, + { 'protected_dir' => $dir->[0], + 'protected_user_file_path' => $dir->[1] }); + &error($err) if ($err); + } + } # Remove protection directives no warnings "once"; my $file = "$dir->[0]/$htaccess_htpasswd::config{'htaccess'}"; diff --git a/find.cgi b/find.cgi index 393f9af..645d33c 100755 --- a/find.cgi +++ b/find.cgi @@ -17,14 +17,20 @@ my %got = map { ( "$_->[0]/$htaccess_htpasswd::config{'htaccess'}", 1 ) } @dirs; # Start the search &ui_print_header(&virtual_server::domain_in($d), $text{'find_title'}, ""); -print &text('find_doing', "$d->{'home'}"),"

\n"; +my $f_apache = $virtual_server::config{'web'}; +my $f_indent = " " x 4; +my $f_label; +$f_label = 2 if (!$f_apache); +print &text('find_doing', "$d->{'home'}"),"
\n"; open(my $FIND, "find ".quotemeta($d->{'home'})." -name ". quotemeta($htaccess_htpasswd::config{'htaccess'}). " -print 2>/dev/null |"); while(my $f = <$FIND>) { chop($f); + my $f_name = $f; + $f_name =~ s|/[^/]*$|| if (!$f_apache); if ($got{$f}) { - print &text('find_already', "$f"),"
\n"; + print $f_indent.&text("find_already$f_label", "$f_name"),"
\n"; next; } @@ -41,19 +47,36 @@ while(my $f = <$FIND>) { $dir =~ s/\/$htaccess_htpasswd::config{'htaccess'}$//; if (&can_directory($dir, $d)) { push(@dirs, [ $dir, $currfile ]); - print &text('find_found', "$f", - "$currfile"),"
\n"; + my $f_extra; + if (!$f_apache) { + # Now add newly found protected directory in other webserver plugins + my $currfilename = $currfile; # Extract filename from path + $currfilename =~ s/.*\///; + foreach my $p (&virtual_server::list_feature_plugins()) { + if (&virtual_server::plugin_defined($p, "feature_add_protected_dir")) { + my ($err, $status) = &virtual_server::plugin_call($p, + "feature_add_protected_dir", $d, + { 'protected_dir' => $dir, + 'protected_user_file_path' => $currfile, + 'protected_user_file' => $currfilename, + 'protected_name' => $text{'find_authreq'} }); + $f_extra = $text{"find_webservstatus$status"} if (defined($status)); + } + } + } + print $f_indent.&text("find_found$f_label", "$f_name", + "$currfile")." $f_extra","
\n"; } else { - print &text('find_foundnot', "$f"),"
\n"; + print $f_indent.&text("find_foundnot$f_label", "$f_name"),"
\n"; } } else { - print &text('find_noprot', "$f"),"
\n"; + print $f_indent.&text("find_noprot$f_label", "$f_name"),"
\n"; } } close($FIND); - +print $text{'find_founddone'},"
\n"; &lock_file($htaccess_htpasswd::directories_file); &htaccess_htpasswd::save_directories(\@dirs); &unlock_file($htaccess_htpasswd::directories_file); diff --git a/help/intro.af.auto.html b/help/intro.af.auto.html index 16aeb12..bfc9091 100644 --- a/help/intro.af.auto.html +++ b/help/intro.af.auto.html @@ -1 +1,2 @@ -

Beskermde kaarte
Op hierdie bladsy kan u wagwoordbeskerming byvoeg vir sommige of alle webwerf-kaarte vir hierdie virtuele bediener. Om 'n gids te beskerm, gebruik die beskerming toe te voeg vir 'n nuwe gids skakel. Om beskerming te verwyder, merk die merkblokkie langs die naam van die gids en klik op die knoppie onder die lys.

Sodra die beskerming opgestel is, kan u met behulp van die bladsy Bewerker-pos en FTP-gebruikers beheer watter gebruikers toegang daartoe het. As u op 'n gebruiker klik of 'n nuwe een skep, kan die veld Toegang tot webkaarte gebruik word om een of meer toelaatpaadjies te kies uit die lys wat u hier definieer.