initial commit of file from CVS for smeserver-durep on Sat Sep 7 20:21:52 AEST 2024
This commit is contained in:
4
root/etc/e-smith/templates/etc/crontab/durep
Normal file
4
root/etc/e-smith/templates/etc/crontab/durep
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
# Generate DUREP reports
|
||||
|
||||
01 0 * * * root /usr/sbin/durep.daily
|
@@ -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";
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user