initial commit of file from CVS for smeserver-horde on Sat Mar 23 16:05:15 AEDT 2024

This commit is contained in:
Trevor Batley
2024-03-23 16:05:15 +11:00
parent 21bc0fdf89
commit 46a910a743
129 changed files with 4154 additions and 2 deletions

View File

@@ -0,0 +1,41 @@
#!/usr/bin/perl -w
package esmith;
use strict;
use Errno;
use esmith::DomainsDB;
use esmith::ConfigDB;
my $event = $ARGV [0];
my $userName = $ARGV [1];
my $cdb = esmith::ConfigDB->open_ro || die("Could not open config db\n");
my $horderemove = $cdb->get('horde');
my $status = $horderemove->prop('RemoveUsers') || "disabled";
unless ($status eq "enabled" )
{
warn "Removal of webmail database settings is disabled, to enable\n";
warn "config setprop horde RemoveUsers enabled ; signal-event email-update\n";
exit(0);
}
die "Username argument missing" unless defined ($userName);
my $db = esmith::DomainsDB->open_ro || die("Could not open domains db\n");
my $DomainName = "";
my @domains = ($DomainName,
map { $_->key }
$db->get_all());
foreach my $domain (@domains)
{
unless ($domain eq "")
{
system("php /usr/bin/horde-remove-user-data -f $userName@" . "$domain" . "> /dev/null");
}
}
exit (0)