mirror of
https://github.com/webmin/webmin.git
synced 2025-07-21 23:40:34 +00:00
35 lines
805 B
Perl
Executable File
35 lines
805 B
Perl
Executable File
#!/usr/local/bin/perl
|
|
# Delete several virtusers
|
|
|
|
require './sendmail-lib.pl';
|
|
require './virtusers-lib.pl';
|
|
&ReadParse();
|
|
&error_setup($text{'vdelete_err'});
|
|
$conf = &get_sendmailcf();
|
|
$vfile = &virtusers_file($conf);
|
|
($vdbm, $vdbmtype) = &virtusers_dbm($conf);
|
|
|
|
# Find and validate
|
|
@d = split(/\0/, $in{'d'});
|
|
@d || &error($text{'adelete_enone'});
|
|
@virts = &list_virtusers($vfile);
|
|
foreach $d (@d) {
|
|
($virt) = grep { $_->{'from'} eq $d } @virts;
|
|
if ($virt) {
|
|
&can_edit_virtuser($virt) ||
|
|
&error(&text('vdelete_ecannot', $d));
|
|
push(@delvirts, $virt);
|
|
}
|
|
}
|
|
|
|
# Delete the aliases
|
|
&lock_file($vfile);
|
|
foreach $virt (@delvirts) {
|
|
&delete_virtuser($virt, $vfile, $vdbm, $vdbmtype);
|
|
}
|
|
&unlock_file($vfile);
|
|
|
|
&webmin_log("delete", "virtusers", scalar(@delvirts));
|
|
&redirect("list_virtusers.cgi");
|
|
|