initial commit of file from CVS for e-smith-quota on Wed 12 Jul 09:07:49 BST 2023
This commit is contained in:
11
root/etc/e-smith/templates/etc/fstab/50EnableQuotas
Normal file
11
root/etc/e-smith/templates/etc/fstab/50EnableQuotas
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
# Change defaults => usrquota,grpquota for / file system
|
||||
@lines = map {
|
||||
/\s\/\s+ext[234]\s+defaults\s/ && s/defaults/usrquota,grpquota/;
|
||||
/^\/dev\/main\/.*\s+ext[234]\s+defaults\s/ && s/defaults/usrquota,grpquota/;
|
||||
/\s\/\s+xfs\s+defaults\s/ && s/defaults/uquota,gquota/;
|
||||
/^\/dev\/main\/.*\s+xfs\s+defaults\s/ && s/defaults/uquota,gquota/;
|
||||
$_
|
||||
} @lines;
|
||||
"";
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
{
|
||||
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";
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
{
|
||||
use esmith::I18N;
|
||||
use Locale::gettext;
|
||||
|
||||
my $i18n = new esmith::I18N;
|
||||
$i18n->setLocale('userOverQuota.tmpl');
|
||||
|
||||
my $domain = $conf->get_value("DomainName") || "localhost";
|
||||
my $systemName = $conf->get_value("SystemName") || "SME Server";
|
||||
|
||||
my $gracePeriodEnds = localtime($data{gracePeriod});
|
||||
|
||||
$OUT .= "To: $data{fullname} <$data{username}\@${domain}>\n";
|
||||
$OUT .= "From: \"".
|
||||
gettext("Automated quota report").
|
||||
"\" <do-not-reply\@${domain}>\n";
|
||||
$OUT .= "Subject: ".gettext("You have exceeded your disk quota")."\n";
|
||||
|
||||
$OUT .= gettext("Your current disk usage:").
|
||||
" $data{usage} ".gettext("Mb")."\n";
|
||||
$OUT .= gettext("Your maximum usage:").
|
||||
($data{hardQuota} == 0 ? gettext(" no limit set") :
|
||||
" $data{hardQuota} ".gettext("Mb"))."\n";
|
||||
$OUT .= gettext("Warnings start at:").
|
||||
" $data{softQuota} ".gettext("Mb")."\n";
|
||||
$OUT .= gettext("Grace period ends:")." $gracePeriodEnds\n";
|
||||
$OUT .= gettext("System name:")." $systemName\n\n";
|
||||
|
||||
$OUT .= gettext("You are currently using more disk space than you have been allotted. You have until the Grace Period above to remove files so that you no longer exceed the warning level. At no time will you be permitted to store more than the maximum usage indicated above. This disk allocation includes all your e-mail, including unread e-mail.");
|
||||
|
||||
}
|
Reference in New Issue
Block a user