diff -urN smeserver-awstats-1.4.old/createlinks smeserver-awstats-1.4/createlinks --- smeserver-awstats-1.4.old/createlinks 2023-02-08 22:03:48.000000000 +0400 +++ smeserver-awstats-1.4/createlinks 2023-02-12 22:30:35.985000000 +0400 @@ -8,25 +8,23 @@ panel_link("awstats", 'manager'); -$event="console-save"; -templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.conf", $event ); - -$event="remoteaccess-update"; -templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.conf", $event ); +for my $event (qw( ip-change awstats-update smeserver-awstats-update console-save post-upgrade remoteaccess-update )) { + templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.conf", $event ); + templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.ftp.conf", $event ); + templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.mail.conf", $event ); +} $event="ip-change"; -templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.conf", $event ); event_link("awstats-run", $event , "04"); $event="awstats-update"; event_link("navigation-conf", $event, "50"); -templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.conf", $event ); event_link("awstats-run", "awstats-update", "20"); +templates2events("/etc/crontab", $event ); $event= "smeserver-awstats-update"; event_link("navigation-conf", $event, "50"); -templates2events("/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.conf", $event ); templates2events("/etc/crontab", $event ); event_link("awstats-upgrade", $event, "02"); diff -urN smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/crontab/awstats_email smeserver-awstats-1.4/root/etc/e-smith/templates/etc/crontab/awstats_email --- smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/crontab/awstats_email 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-awstats-1.4/root/etc/e-smith/templates/etc/crontab/awstats_email 2023-02-11 22:48:14.000000000 +0400 @@ -0,0 +1,6 @@ +{ + return "# awstats-mail is disabled\n" unless ($AWStats{mailstatus} || 'disabled') eq 'enabled'; + + my $cmd="/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.pl"; + $OUT .= "45 * * * * root $cmd -update -config=mail >/dev/null\n"; +} diff -urN smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/crontab/awstats_ftp smeserver-awstats-1.4/root/etc/e-smith/templates/etc/crontab/awstats_ftp --- smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/crontab/awstats_ftp 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-awstats-1.4/root/etc/e-smith/templates/etc/crontab/awstats_ftp 2023-02-11 23:51:51.000000000 +0400 @@ -0,0 +1,7 @@ +{ + return "# awstats-ftp is disabled\n" unless ($AWStats{ftpstatus} || 'disabled') eq 'enabled'; + + my $cmd="/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.pl"; + $OUT .= "35 * * * * root $cmd -update -config=ftp >/dev/null\n"; +} + diff -urN smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.ftp.conf/10conf smeserver-awstats-1.4/root/etc/e-smith/templates/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.ftp.conf/10conf --- smeserver-awstats-1.4.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.ftp.conf/10conf 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-awstats-1.4/root/etc/e-smith/templates/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.ftp.conf/10conf 2023-02-12 19:25:16.000000000 +0400 @@ -0,0 +1,56 @@ +{ +# ftp : proftpd + use warnings; + use esmith::ConfigDB; + + my $configDB = esmith::ConfigDB->open or die("can't open Config DB"); + my $domain = $configDB->get( 'DomainName' )->value; + my $DNREG = ($domain =~ s|\.|\\.|r); + +$OUT =<open or die("can't open Config DB"); +my $domain = $configDB->get( 'DomainName' )->value; +my $DNREG = ($domain =~ s|\.|\\.|r); + +$OUT =<h4 ('AWStats is disabled!'); - } - else - { - + if (db_get_prop(\%conf, "AWStats", "status") ne "enabled") + { + print $q->h4 (' AWStats is disabled!'); + if ($acctName eq 'admin' and (db_get_prop(\%conf, "AWStats", "mailstatus") || 'disabled') eq 'enabled') { + print "
No WEB stats but MAIL stats are available -> "; + print $q->a ({ href => ".awstats/awstats.pl?config=mail&lang=auto" }, 'Here...'); + print "
"; + } + if ($acctName eq 'admin' and (db_get_prop(\%conf, "AWStats", "ftpstatus") || 'disabled') eq 'enabled') { + print "
No WEB stats but FTP stats are available -> "; + print $q->a ({ href => ".awstats/awstats.pl?config=ftp&lang=auto" }, 'Here...'); + print "
"; + } + } + else + { print $q->h4 ("List of Domains viewable by $acctName"); print "Note: A Domain is not shown in the list below until after midnight on the day
". @@ -391,6 +400,39 @@ } } + + +# add to see mail stats + if ($acctName eq 'admin' and (db_get_prop(\%conf, "AWStats", "mailstatus") || 'disabled') eq 'enabled') { + print $q->Tr (esmith::cgi::genSmallCell ($q, "mail"), + esmith::cgi::genSmallCell ($q, "qmail stats"), + esmith::cgi::genSmallCell ($q, " "), + esmith::cgi::genSmallCell ($q, + $q->a ({href => ".awstats/awstats.pl" + . "?config=mail" + . "&lang=" . db_get_prop(\%conf, "AWStats", "Language")}, + 'Show...')), + esmith::cgi::genSmallCell ($q,'active'), + esmith::cgi::genSmallCell ($q,' ') + ); + } + + +# add to see ftp stats + if ($acctName eq 'admin' and (db_get_prop(\%conf, "AWStats", "ftpstatus") || 'disabled') eq 'enabled') { + print $q->Tr (esmith::cgi::genSmallCell ($q, "ftp"), + esmith::cgi::genSmallCell ($q, "proftpd stats"), + esmith::cgi::genSmallCell ($q, " "), + esmith::cgi::genSmallCell ($q, + $q->a ({href => ".awstats/awstats.pl" + . "?config=ftp" + . "&lang=" . db_get_prop(\%conf, "AWStats", "Language")}, + 'Show...')), + esmith::cgi::genSmallCell ($q,'active'), + esmith::cgi::genSmallCell ($q,' ') + ); + } + }#awstats is enabled print ''; diff -urN smeserver-awstats-1.4.old/root/etc/e-smith/web/panels/manager/cgi-bin/.awstats/qmail-preprocessor.sh smeserver-awstats-1.4/root/etc/e-smith/web/panels/manager/cgi-bin/.awstats/qmail-preprocessor.sh --- smeserver-awstats-1.4.old/root/etc/e-smith/web/panels/manager/cgi-bin/.awstats/qmail-preprocessor.sh 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-awstats-1.4/root/etc/e-smith/web/panels/manager/cgi-bin/.awstats/qmail-preprocessor.sh 2023-02-10 23:17:40.000000000 +0400 @@ -0,0 +1,14 @@ +#!/bin/bash + +# Qmail logfile preprocessor + +/usr/bin/test $(/bin/ls -l /var/log/qmail/*.s 2>/dev/null | grep -v "^l" | wc -l) -eq 0 && /bin/touch /var/log/qmail/awstats_dummy.s +RR=$(/bin/ls -t /var/log/qmail/*.s|/usr/bin/head -n 1) +RR=$(/bin/basename $RR) +/usr/bin/test ! -f /var/log/qmail/.recent-rotated && SRC="/var/log/qmail/*.s" && echo $RR > /var/log/qmail/.recent-rotated +LR=$(/bin/cat /var/log/qmail/.recent-rotated) +echo "RR: $RR LR: $LR" +/usr/bin/test "$LR" != "$RR" && SRC="/var/log/qmail/$RR" && echo $RR > /var/log/qmail/.recent-rotated +/bin/cat $SRC /var/log/qmail/current | /usr/local/bin/tai64nlocal | /usr/bin/perl /usr/share/awstats/tools/maillogconvert.pl standard | /bin/grep -v ' alias-localdelivery-' +/bin/rm -f /var/log/qmail/awstats_dummy.s +