45 lines
1.3 KiB
Cheetah
45 lines
1.3 KiB
Cheetah
{
|
|
use esmith::I18N;
|
|
use Locale::gettext;
|
|
|
|
my $i18n = new esmith::I18N;
|
|
$i18n->setLocale('adminQuotaSummary.tmpl');
|
|
|
|
my $domain = $conf->get_value("DomainName") || "localhost";
|
|
my $systemName = $conf->get_value("SystemName") || "SME Server";
|
|
|
|
$OUT .= "To: ".gettext("System Administrator")." <admin\@${domain}>\n";
|
|
$OUT .= "From: \"".
|
|
gettext("Automated quota report").
|
|
"\" <do-not-reply\@${domain}>\n";
|
|
$OUT .= "Subject: ".
|
|
gettext("One or more users have exceeded their disk quota").
|
|
"\n";
|
|
|
|
#----------------------------------------------------------------------
|
|
# Over quota users:
|
|
#----------------------------------------------------------------------
|
|
|
|
$OUT .= gettext("The following users have exceeded their disk quota on the server called").
|
|
" \"$systemName\" ".gettext("All values are in megabytes.");
|
|
$OUT .= "\n";
|
|
|
|
$OUT .= sprintf("%-20s%+8s%+28s%+19s",
|
|
gettext("Account"),
|
|
gettext("Usage"),
|
|
gettext("Limit with grace period"),
|
|
gettext("Absolute limit")
|
|
) . "\n";
|
|
$OUT .= "-"x75 . "\n";;
|
|
|
|
foreach my $user (sort keys %usersOverQuota)
|
|
{
|
|
$OUT .= sprintf("%-20s%8.2f%28.2f%19.2f",
|
|
$user,
|
|
$usersOverQuota{$user}{usage},
|
|
$usersOverQuota{$user}{softQuota},
|
|
$usersOverQuota{$user}{hardQuota}
|
|
) . "\n";
|
|
}
|
|
}
|