#!/usr/local/bin/perl
# delete.cgi
# Delete some file or directory

require './file-lib.pl';
&ReadParse();
&webmin_log("delete", undef, $in{'file'}, \%in);
&switch_acl_uid();
print "Content-type: text/plain\n\n";
if ($access{'ro'} || !&can_access($in{'file'})) {
	print &text('delete_eaccess', $in{'file'}),"\n";
	exit;
	}
$out = &backquote_logged("cd / ; rm -rf \"$in{'file'}\" 2>&1");
if ($?) { print $out; }
else { print "\n"; }

