3 # Delete some file or directory
5 require './file-lib.pl';
6 $disallowed_buttons{'delete'} && &error($text{'ebutton'});
8 &webmin_log("delete", undef, $in{'file'}, \%in);
9 print "Content-type: text/plain\n\n";
10 if ($access{'ro'} || !&can_access($in{'file'})) {
11 print &text('delete_eaccess', $in{'file'}),"\n";
14 if (&indexof($in{'file'}, @allowed_roots) >= 0) {
15 print &text('delete_eroot', $in{'file'}),"\n";
18 if (-r &unmake_chroot($in{'file'}) && !-d &unmake_chroot($in{'file'})) {
19 &switch_acl_uid_and_chroot();
20 $rv = unlink($in{'file'});
21 if (!$rv) { print "$!\n"; }
26 ($ok, $err) = &unlink_file(&unmake_chroot($in{'file'}));
27 if (!$ok) { print "$err\n"; }