#!/usr/local/bin/perl
# edit_virtuser.cgi
# Edit an existing virtuser

require './sendmail-lib.pl';
require './virtusers-lib.pl';
&ReadParse();
$conf = &get_sendmailcf();
@virts = &list_virtusers(&virtusers_file($conf));
$access{'vmode'} == 1 ||
$access{'vmode'} == 2 && $virts[$in{'num'}]->{'from'} =~ /$access{'vaddrs'}/ ||
$access{'vmode'} == 3 && $virts[$in{'num'}]->{'from'} =~ /^$remote_user\@/ ||
	&error($text{'vform_ecannot'});

&header($text{'vform_edit'}, "");
print "<hr>\n";
&virtuser_form($virts[$in{'num'}]);
print "<hr>\n";
&footer("list_virtusers.cgi", $text{'virtusers_return'},
	"", $text{'index_return'});

