initial commit of file from CVS for smeserver-durep on Sat Sep 7 20:21:52 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 20:21:52 +10:00
parent b7162f2054
commit ce6f5341b1
30 changed files with 1974 additions and 2 deletions

View File

@@ -0,0 +1,4 @@
# Generate DUREP reports
01 0 * * * root /usr/sbin/durep.daily

View File

@@ -0,0 +1,41 @@
#------------------------------------------------------------
# durep for user panel
#------------------------------------------------------------
{
use esmith::db;
my %accounts;
tie %accounts, 'esmith::config', '/home/e-smith/db/accounts';
my $globalpanels = db_get_prop(\%accounts, 'globalUP', 'AdminPanels');
$globalpanels = '' if ( ! defined ($globalpanels) );
my @globalpanels = split (/,/, $globalpanels, -1);
my $key;
my $value;
my $file = "durep";
my $require = "require user ";
while (($key,$value) = each %accounts)
{
my ($type, %properties) = split (/\|/, $value, -1);
if ($type eq 'user')
{
my $adminpanels = db_get_prop(\%accounts, $key, 'AdminPanels');
$adminpanels = "" if (! defined $adminpanels );
my @adminpanels = split (/,/, $adminpanels, -1);
push @adminpanels, @globalpanels ;
if (grep (/^$file$/, @adminpanels))
{
# Build a files require line for each panel
$panelshash{$file} .= " $key"
}
}
}
$OUT .= "\n";
$OUT .= " <Directory \"/etc/e-smith/web/panels/manager/html/durep\"> \n";
$OUT .= " require user admin$panelshash{$file}\n";
$OUT .= " </Directory>\n";
}