diff --git a/add.cgi b/add.cgi index 44c2757..8e07d73 100755 --- a/add.cgi +++ b/add.cgi @@ -56,13 +56,15 @@ foreach my $clash ("AuthUserFile", "AuthType", "AuthName") { # Add protected directory in other webserver plugins foreach my $p (&virtual_server::list_feature_plugins()) { - 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); + 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) diff --git a/delete.cgi b/delete.cgi index 0f926ec..1569f94 100755 --- a/delete.cgi +++ b/delete.cgi @@ -25,11 +25,13 @@ foreach my $path (@d) { if ($dir) { # Delete protected directory in other webserver plugins foreach my $p (&virtual_server::list_feature_plugins()) { - 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); + 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";