diff -urN smeserver-awstats-1.4.old/createlinks smeserver-awstats-1.4/createlinks --- smeserver-awstats-1.4.old/createlinks 2023-02-12 22:30:35.000000000 +0400 +++ smeserver-awstats-1.4/createlinks 2023-03-21 12:37:58.758000000 +0400 @@ -27,6 +27,12 @@ event_link("navigation-conf", $event, "50"); templates2events("/etc/crontab", $event ); event_link("awstats-upgrade", $event, "02"); +# for smeserver-manager (in smeserver-awstats-update) +safe_symlink('restart', "root/etc/e-smith/events/$event/services2adjust/smanager"); +event_link('navigation2-conf', "$event", '80'); +event_link('routes2-conf', "$event", '80'); +event_link('locales2-conf', "$event", '80'); +safe_symlink("/usr/share/awstats/wwwroot/icon" , 'root/usr/share/smanager/themes/default/public/images/awstats/icon'); use esmith::Build::Backup qw(:all); backup_includes("smeserver-awstats", qw( diff -urN smeserver-awstats-1.4.old/root/usr/share/smanager/lib/SrvMngr/Controller/Awstats.pm smeserver-awstats-1.4/root/usr/share/smanager/lib/SrvMngr/Controller/Awstats.pm --- smeserver-awstats-1.4.old/root/usr/share/smanager/lib/SrvMngr/Controller/Awstats.pm 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-awstats-1.4/root/usr/share/smanager/lib/SrvMngr/Controller/Awstats.pm 2023-03-21 11:16:34.566000000 +0400 @@ -0,0 +1,350 @@ +package SrvMngr::Controller::Awstats; + +#---------------------------------------------------------------------- +# heading : Administration +# description : Web statistics +# navigation : 4000 4350 +# +# menu : A +# +# name : awstats, method : get, url : /awstats, ctlact : awstats#main +# name : awstats2, method : get, url : /awstats2, ctlact : awstats#do_display +# name : awstatsc, method : post, url : /awstats, ctlact : awstats#do_display +# name : awstatsu, method : post, url : /awstats2, ctlact : awstats#do_update +# name : awstats3, method : get, url : /awstats3, ctlact : awstats#do_update +# +# routes : end +#---------------------------------------------------------------------- +use strict; +use warnings; + +use Mojo::Base 'Mojolicious::Controller'; + +use Locale::gettext; +use SrvMngr::I18N; +use SrvMngr qw(theme_list init_session); + +use POSIX qw(strftime); + +use esmith::DomainsDB; +use esmith::ConfigDB; + +our $ddb = esmith::DomainsDB->open || die "Couldn't open domains db"; +our $cdb = esmith::ConfigDB->open || die "Couldn't open configuration db"; +our $awsdirdata="/home/e-smith/files/users/admin/home/awstats"; + +our $REGEXP_DOMAIN = qq([a-zA-Z0-9\-\.]+); + +sub main { + + my $c = shift; + $c->app->log->info($c->log_req); + + my %aws_datas = (); + my $title = $c->l('aws_FORM_TITLE'); + + $aws_datas{trt} = 'LST'; + + my $rec = $cdb->get('AWStats'); + $aws_datas{status} = $rec->prop('status')|| 'disabled'; + $aws_datas{mailstatus} = ( $rec->prop('mailstatus') || 'disabled' ); + $aws_datas{ftpstatus} = ( $rec->prop('ftpstatus') || 'disabled' ); + $aws_datas{username} = $c->session->{username} || 'unknown'; + + my @domains; + +# if ( $aws_datas->{status} ne 'enabled' ) { + for ($ddb->domains()) { + my $domain = $_->key; + + next unless ( -d "$awsdirdata/$domain" ); + + my $ns = $_->prop('Nameservers') || 'internet'; + + $domain = $1 if ($domain =~ /^($REGEXP_DOMAIN)$/); + my $awstats = 'Empty'; + if (system("/bin/ls $awsdirdata/$domain/ | /bin/grep '.txt' > /dev/null 2>&1") == 0 ) { + $awstats = 'Show'; + } + my $status = 'active'; + #if ( ????system == 0 ) { // T O D O inactive domains// + # $status = 'inactive'; + #} + + push @domains, + { Domain => $_->key, $_->props, + Nameservers => $ns, + AWStats => $awstats, + Status => $status + } + } + + if (open (ST, "/var/log/httpd/awstats_lr")) { + $aws_datas{logres} = ; + close (ST); + } +# } + + $c->stash( title => $title, aws_datas => \%aws_datas, domains => \@domains ); + $c->render(template => 'awstats'); +} + + +sub do_display { + + my $c = shift; + $c->app->log->info($c->log_req); + + my %aws_datas = (); + my $title = $c->l('aws_FORM_TITLE'); + my $result; + + my $trt = $c->param('trt') || 'LST'; + my $domain = $c->param('Domain'); + + if ( $trt eq 'SHW' ) { + $aws_datas{periodrep} = 'month'; + $aws_datas{monthrep} = strftime( "%m", localtime ); + $aws_datas{yearrep} = strftime( "%Y", localtime ); + $aws_datas{domain} = $domain; + $result = _get_awst( $c, \%aws_datas ); + } + + if ( $trt eq 'CNF' ) { + my $rec = $cdb->get('AWStats'); + if ($rec) { + $aws_datas{status} = $rec->prop('status')|| 'disabled'; + $aws_datas{mailstatus} = ( $rec->prop('mailstatus') || 'disabled' ); + $aws_datas{ftpstatus} = ( $rec->prop('ftpstatus') || 'disabled' ); + $aws_datas{freq} = $rec->prop('Freq')|| '5m'; + $aws_datas{barSize} = $rec->prop('BarSize')|| 'medium'; + $aws_datas{language} = $rec->prop('Language')|| 'auto'; + $aws_datas{maxNbOfDomain} = $rec->prop('MaxNbOfDomain')|| '50'; + $aws_datas{maxNbOfHosts} = $rec->prop('MaxNbOfHostsShown')|| '100'; + $aws_datas{maxNbOfKeywords} = $rec->prop('MaxNbOfKeywordsShown')|| '50'; + $aws_datas{maxNbOfPage} = $rec->prop('MaxNbOfPageShown')|| '200'; + $aws_datas{maxNbOfReferer} = $rec->prop('MaxNbOfRefererShown')|| '50'; + $aws_datas{maxNbOfRobot} = $rec->prop('MaxNbOfRobotShown')|| '25'; + $aws_datas{minHitPage} = $rec->prop('MinHitFile')|| '1'; + $aws_datas{minHitHost} = $rec->prop('MinHitHost')|| '1'; + $aws_datas{minHitKeyword} = $rec->prop('MinHitKeyword')|| '1'; + $aws_datas{minHitRefer} = $rec->prop('MinHitRefer')|| '1'; + $aws_datas{minHitRobot} = $rec->prop('MinHitRobot')|| '1'; + $aws_datas{rawlog} = $rec->prop('Rawlog')|| 'no'; + $aws_datas{skipExternalIP} = $rec->prop('SkipExternalIP')|| 'yes'; + $aws_datas{skipLocalIP} = $rec->prop('SkipLocalIP')|| 'yes'; + $aws_datas{skipLocalNetworks} = $rec->prop('SkipLocalNetworks')|| 'no'; + $aws_datas{userFramesWhenCGI} = $rec->prop('UserFramesWhenCGI')|| 'no'; + $aws_datas{username} = $c->session->{username} || 'unknown'; + } + } + + $aws_datas{trt} = $trt; + $aws_datas{domain} = $domain; + $c->stash( title => $title .' '. $domain, aws_datas => \%aws_datas, modul => $result ); + $c->render(template => 'awstats'); + +} + + +sub do_update { + + my $c = shift; + $c->app->log->info($c->log_req); + + my $rt = $c->current_route; + my $trt = $c->param('trt') || 'SHWP'; + my $title = $c->l('aws_FORM_TITLE'); + + my %aws_datas = (); + $aws_datas{trt} = $trt; + my ($res, $result) = ''; + + if ( $trt eq 'UPD' ) { + + my $status = $c->param('Status'); + my $mailstatus = $c->param('Mailstatus'); + my $ftpstatus = $c->param('Ftpstatus'); + my $freq = $c->param('Freq'); + my $skipLocalIP = $c->param('SkipLocalIP'); + my $skipExternalIP = $c->param('SkipExternalIP'); + my $skipLocalNetworks = $c->param('SkipLocalNetworks'); + my $userFramesWhenCGI = $c->param('UserFramesWhenCGI'); + my $language = $c->param('Language'); + my $rawlog = $c->param('Rawlog'); + my $barSize = $c->param('BarSize'); + + my $maxNbOfDomain = $c->param('MaxNbOfDomain'); + my $maxNbOfHosts = $c->param('MaxNbOfHosts'); + my $minHitHost = $c->param('MinHitHost'); + my $maxNbOfPages = $c->param('MaxNbOfPages'); + my $minHitPage = $c->param('MinHitPage'); + my $maxNbOfRobot = $c->param('MaxNbOfRobot'); + my $minHitRobot = $c->param('MinHitRobot'); + my $maxNbOfReferer = $c->param('MaxNbOfReferer'); + my $minHitRefer = $c->param('MinHitRefer'); + my $maxNbOfKeywords = $c->param('MaxNbOfKeywords'); + my $minHitKeyword = $c->param('MinHitKeyword'); + + #$result = 'blocked'; + + if ($maxNbOfDomain =~ /^([0-9]+)$/) { + $maxNbOfDomain = $1; + } else { + $result .= $c->l('FIELD_INVALID_CHARS') .' : '. $maxNbOfDomain .'
'; + } + if ($maxNbOfHosts =~ /^([0-9]+)$/) { + $maxNbOfHosts = $1; + } else { + $result .= $c->l('FIELD_INVALID_CHARS') .' : '. $maxNbOfHosts .'
'; + } + + if ($minHitHost =~ /^([0-9]+)$/) { + $minHitHost = $1; + } else { + $result .= $c->l('FIELD_INVALID_CHARS') .' : '. $minHitHost .'
'; + } + $maxNbOfDomain = 1 if $maxNbOfDomain < 1; + $maxNbOfHosts = 1 if $maxNbOfHosts < 1; + $minHitHost = 1 if $minHitHost < 1; + $maxNbOfPages = 1 if $maxNbOfPages < 1; + $minHitPage = 1 if $minHitPage < 1; + $maxNbOfRobot = 1 if $maxNbOfRobot < 1; + $minHitRobot = 1 if $minHitRobot < 1; + $maxNbOfReferer = 1 if $maxNbOfReferer < 1; + $minHitRefer = 1 if $minHitRefer < 1; + $maxNbOfKeywords = 1 if $maxNbOfKeywords < 1; + $minHitKeyword = 1 if $minHitKeyword < 1; + + # controls + + $res =''; + if ( ! $result ) { + my $rec = $cdb->get('AWStats'); + if ($rec) { + $rec->set_prop('status', $status); ; + $rec->set_prop('mailstatus', $mailstatus); ; + $rec->set_prop('ftpstatus', $ftpstatus); ; + $rec->set_prop('Freq', $freq); + $rec->set_prop('BarSize',$barSize ); + $rec->set_prop('Language', $language); + $rec->set_prop('MaxNbOfDomain', $maxNbOfDomain); + $rec->set_prop('MaxNbOfHostsShown', $maxNbOfHosts); + $rec->set_prop('MaxNbOfKeywordsShown', $maxNbOfKeywords); + $rec->set_prop('MaxNbOfPageShown', $maxNbOfPages); + $rec->set_prop('MaxNbOfRefererShown', $maxNbOfReferer); + $rec->set_prop('MaxNbOfRobotShown', $maxNbOfRobot); + $rec->set_prop('MinHitFile', $minHitPage); + $rec->set_prop('MinHitHost', $minHitHost); + $rec->set_prop('MinHitKeyword', $minHitKeyword); + $rec->set_prop('MinHitRefer', $minHitRefer); + $rec->set_prop('MinHitRobot', $minHitRobot); + $rec->set_prop('Rawlog', $rawlog); + $rec->set_prop('SkipExternalIP', $skipExternalIP); + $rec->set_prop('SkipLocalIP', $skipLocalIP); + $rec->set_prop('SkipLocalNetworks', $skipLocalNetworks); + $rec->set_prop('UserFramesWhenCGI', $userFramesWhenCGI); + } + + if ( system( '/sbin/e-smith/signal-event awstats-update &' ) != 0 ) { + $result = ($c->l('aws_ERROR_CONFIG_UPDATE') . " $trt"); + } else { + # sleep (2); + $res = 'OK'; + $result = $c->l('aws_CONFIG_SUCCESSFULLY_MODIFIED'); + } + } + } + + if ( $trt eq 'SHWP' ) { + $aws_datas{periodrep} = $c->param('databasebreak'); + $aws_datas{monthrep} = $c->param('month'); + $aws_datas{yearrep} = $c->param('year'); + $aws_datas{domain} = $c->param('config') || 'None'; + + $result = _get_awst( $c, \%aws_datas ); + + $c->stash( title => $title .' '. $aws_datas{domain}, aws_datas => \%aws_datas, modul => $result ); + return $c->render( 'awstats' ); + } + + # common parts + + if ($res ne 'OK') { + $c->stash( error => $result ); + $c->stash( title => $title, aws_datas => \%aws_datas ); + return $c->render( 'awstats' ); + } + +# $cdb = esmith::ConfigDB->open(); + + my $message = "'AWStats configuration' update ($trt) DONE"; + $c->app->log->info($message); + $c->flash( success => $result ); + $c->redirect_to('/awstats'); +} + + +sub _get_awst { + + my ($c, $aws_datas) = @_; + + my $periodrep = $aws_datas->{periodrep}; + my $yearrep = $aws_datas->{yearrep}; + my $monthrep = $aws_datas->{monthrep}; + my $domain = $aws_datas->{domain}; + + my $res; + + $domain = $1 if ($domain =~ /^($REGEXP_DOMAIN)$/); + $periodrep = $1 if ($periodrep =~ /^([A-Za-z]+)$/); + $monthrep = $1 if ($monthrep =~ /^([A-Za-z\-]+)$/); + $yearrep = $1 if ($yearrep =~ /^([0-9]+)$/); + + # cli awstats.pl call + $res = `/etc/e-smith/web/panels/manager/cgi-bin/.awstats/awstats.pl -databasebreak=$periodrep -month=$monthrep -year=$yearrep -config="${domain}" -lang=auto -output`; + + # change awstats link for this controller + $res =~ s|action="/cgi-bin/awstats.pl?|action="/smanager/awstats3?trt=SHWP&|; + # change DirIcons for sm2 public one + $res =~ s|\.\./\.\./awstats|\./images/awstats/icon|g; + + return $res; +} + + +sub freq_options_list { + + my $c = shift; + return [[ '5 ' . $c->l('MINUTES') => '5m'], + [ '10 ' . $c->l('MINUTES') => '10m'], + [ '15 ' . $c->l('MINUTES') => '15m'], + [ '30 ' . $c->l('MINUTES') => '30m'], + [ '1 ' . $c->l('HOUR') => '1h'], + [ '2 ' . $c->l('HOURS') => '2h'], + [ '4 ' . $c->l('HOURS') => '4h'], + [ '8 ' . $c->l('HOURS') => '8h'], + [ '12 ' . $c->l('HOURS') => '12h']]; +} + + +sub language_options_list { + + my $c = shift; + return [[ 'Auto Detect' => 'auto' ], + ['English' => 'en' ], + ['French', => 'fr' ], + ['Dutch' => 'nl' ], + ['Spanish' => 'es' ], + ['Italian' => 'it' ], + ['German', => 'de' ], + ['Polish', => 'pl' ], + ['Greek' => 'gr' ], + ['Czech' => 'cz' ], + ['Portuguese' => 'pt' ]]; +} + + +1 + +__END__ diff -urN smeserver-awstats-1.4.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Awstats/awstats_en.lex smeserver-awstats-1.4/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Awstats/awstats_en.lex --- smeserver-awstats-1.4.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Awstats/awstats_en.lex 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-awstats-1.4/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Awstats/awstats_en.lex 2023-02-11 21:08:23.000000000 +0400 @@ -0,0 +1,37 @@ +'aws_FORM_TITLE' => 'Show or Configure Awstats Statistics', +'aws_BUTTON_CONFIGURE' => 'Configure AWStats', +'aws_STATS_NOTE' => 'Note: A Domain is not shown in the list below until after midnight on the day statistics are available. To force the display sooner, browse to the website to create some stats, then resave awstats settings.', +'aws_DOMAINS_TITLE' => 'List of Domains viewable by admin', +'aws_DISABLED' => 'AWStats is disabled.', +'aws_UPDATED' => 'Updated on [_1] in [_2] secs. [_3] new logs processed.', +'aws_COPYRIGHT' => 'Copyright neddix.de, Stuttgart', +'aws_CONTENT' => 'Content', +'aws_CONFIG_TITLE' => 'Configure AWStats Sme version', +'aws_LABEL_STATUS' => 'State', +'aws_REPORTED' => 'Reported period', +'aws_STATUS' => 'status', +'aws_MAILSTATUS' => 'Awstats Mail status', +'aws_FTPSTATUS' => 'Awstats Ftp status', +'aws_FREQUENCY' => 'Launch frequency', +'aws_NO_LOCAL_IP' => 'Ignore hits from your local network', +'aws_NO_EXTERNAL_IP' => 'Ignore hits from your external IP or network', +'aws_YES_EXT_IP' => 'Yes, external IP', +'aws_YES_EXT_IP_MSK' => 'Yes, external IP/Netmask', +'aws_NO_LOCAL' => 'Ignore hits from local networks as defined in the \'Local networks\' panel', +'aws_FRAME' => 'Show report in HTML frames', +'aws_LANGUAGE' => 'Default language', +'aws_RAWLOG' => 'Enable plugin \'Rawlog\'', +'aws_MAX_DOMAINS' => 'Max. number of domains shown', +'aws_MAX_HOSTS' => 'Max. number of hosts shown', +'aws_MIN_HIT_HOSTS' => 'Only show hosts with at least these hits:', +'aws_MAX_PAGES' => 'Max. number of pages shown', +'aws_MIN_HIT_PAGES' => 'Only show pages with at least these hits:', +'aws_MAX_ROBOTS' => 'Max. number of robots shown', +'aws_MIN_HIT_ROBOT' => 'Only show robots with at least these hits:', +'aws_MAX_REFERER' => 'Max. number of referrers shown', +'aws_MIN_HIT_REFERER' => 'Only show referrers with at least these hits:', +'aws_MAX_KEYWORDS' => 'Max. number of keywords shown', +'aws_MIN_HIT_KEYWORDS' => 'Only show keywords with at least these hits:', +'aws_BAR_SIZE' => 'Graphics bar size', +'aws_CONFIG_SUCCESSFULLY_MODIFIED' => 'Configuration has been updated successfully.
Please note, that changed ignore-rules will only effect processing of future logs.', +'aws_ERROR_CONFIG_UPDATE' => 'Error: internal failure while updating awstats configuration.', diff -urN smeserver-awstats-1.4.old/root/usr/share/smanager/themes/default/public/images/awstats/README smeserver-awstats-1.4/root/usr/share/smanager/themes/default/public/images/awstats/README --- smeserver-awstats-1.4.old/root/usr/share/smanager/themes/default/public/images/awstats/README 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-awstats-1.4/root/usr/share/smanager/themes/default/public/images/awstats/README 2023-03-21 11:59:58.788000000 +0400 @@ -0,0 +1 @@ +# link to original awstats icon directory for sm2 diff -urN smeserver-awstats-1.4.old/root/usr/share/smanager/themes/default/templates/awstats.html.ep smeserver-awstats-1.4/root/usr/share/smanager/themes/default/templates/awstats.html.ep --- smeserver-awstats-1.4.old/root/usr/share/smanager/themes/default/templates/awstats.html.ep 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-awstats-1.4/root/usr/share/smanager/themes/default/templates/awstats.html.ep 2023-02-24 00:01:33.000000000 +0400 @@ -0,0 +1,34 @@ +% layout 'default', title => "Sme server 2 - AWStats"; + +% content_for 'module' => begin +
+ % if ($config->{debug} == 1) { +

+ %= dumper $c->current_route + %= dumper $aws_datas +

+ % } + % if ( stash 'warning' ) { +
+ %= $c->render_to_string(inline => stash 'warning') +
+ %} + % if ( stash 'error' ) { +
+ %= $c->render_to_string(inline => stash 'error') +
+ %} + +

<%= $title%>

+ + % if ($aws_datas->{trt} eq 'CNF') { + %= include 'partials/_aws_cnf' + %} elsif ($aws_datas->{trt} eq 'SHW' or $aws_datas->{trt} eq 'SHWP') { + %= include 'partials/_aws_shw' + %} elsif ($aws_datas->{trt} eq 'UPD') { + %= include 'partials/_aws_cnf' + %} else { + %= include 'partials/_aws_list' + %} +
+% end diff -urN smeserver-awstats-1.4.old/root/usr/share/smanager/themes/default/templates/partials/1-awstats_en.lex smeserver-awstats-1.4/root/usr/share/smanager/themes/default/templates/partials/1-awstats_en.lex --- smeserver-awstats-1.4.old/root/usr/share/smanager/themes/default/templates/partials/1-awstats_en.lex 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-awstats-1.4/root/usr/share/smanager/themes/default/templates/partials/1-awstats_en.lex 2023-02-28 21:52:16.000000000 +0400 @@ -0,0 +1,37 @@ +'aws_FORM_TITLE' => 'Show or Configure Awstats Statistics', +'aws_BUTTON_CONFIGURE' => 'Configure AWStats', +'aws_STATS_NOTE' => 'Note: A Domain is not shown in the list below until after midnight on the day statistics are available. To force the display sooner, browse to the website to create some stats, then resave awstats settings.', +'aws_DOMAINS_TITLE' => 'List of Domains viewable by admin', +'aws_DISABLED' => 'AWStats is disabled.', +'aws_UPDATED' => 'Updated on [_1] in [_2] secs. [_3] new logs processed.', +'aws_COPYRIGHT' => 'Copyright neddix.de, Stuttgart', +'aws_CONTENT' => 'Content', +'aws_CONFIG_TITLE' => 'Configure AWStats Sme version', +'aws_LABEL_STATUS' => 'State', +'aws_REPORTED' => 'Reported period', +'aws_STATUS' => 'status', +'aws_MAILSTATUS' => 'Awstats Mail status', +'aws_FTPSTATUS' => 'Awstats Ftp status', +'aws_FREQUENCY' => 'Launch frequency', +'aws_NO_LOCAL_IP' => 'Ignore hits from your local network', +'aws_NO_EXTERNAL_IP' => 'Ignore hits from your external IP or network', +'aws_YES_EXT_IP' => 'Yes, external IP', +'aws_YES_EXT_IP_MSK' => 'Yes, external IP/Netmask', +'aws_NO_LOCAL' => 'Ignore hits from local networks as defined in the \'Local networks\' panel', +'aws_FRAME' => 'Show report in HTML frames', +'aws_LANGUAGE' => 'Default language', +'aws_RAWLOG' => 'Enable plugin \'Rawlog\'', +'aws_MAX_DOMAINS' => 'Max. number of domains shown', +'aws_MAX_HOSTS' => 'Max. number of hosts shown', +'aws_MIN_HIT_HOSTS' => 'Only show hosts with at least these hits:', +'aws_MAX_PAGES' => 'Max. number of pages shown', +'aws_MIN_HIT_PAGES' => 'Only show pages with at least these hits:', +'aws_MAX_ROBOTS' => 'Max. number of robots shown', +'aws_MIN_HIT_ROBOT' => 'Only show robots with at least these hits:', +'aws_MAX_REFERER' => 'Max. number of referrers shown', +'aws_MIN_HIT_REFERER' => 'Only show referrers with at least these hits:', +'aws_MAX_KEYWORDS' => 'Max. number of keywords shown', +'aws_MIN_HIT_KEYWORDS' => 'Only show keywords with at least these hits:', +'aws_BAR_SIZE' => 'Graphics bar size', +'aws_CONFIG_SUCCESSFULLY_MODIFIED' => 'Configuration has been updated successfully.
Please note, that changed ignore-rules will only effect processing of future logs.', +'aws_ERROR_CONFIG_UPDATE' => 'Error: internal failure while updating awstats configuration.', diff -urN smeserver-awstats-1.4.old/root/usr/share/smanager/themes/default/templates/partials/_aws_cnf.html.ep smeserver-awstats-1.4/root/usr/share/smanager/themes/default/templates/partials/_aws_cnf.html.ep --- smeserver-awstats-1.4.old/root/usr/share/smanager/themes/default/templates/partials/_aws_cnf.html.ep 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-awstats-1.4/root/usr/share/smanager/themes/default/templates/partials/_aws_cnf.html.ep 2023-02-15 12:36:15.000000000 +0400 @@ -0,0 +1,139 @@ +
+ %= form_for '/awstats2' => (method => 'POST') => begin +

<%=l 'aws_CONFIG_TITLE'%>

+

+ %=l 'aws_STATUS', class => 'label' + + % param 'Status' => $aws_datas->{status} unless param 'Status'; + %= select_field 'Status' => [[(l 'ENABLED') => 'enabled'], [ (l 'DISABLED') => 'disabled']], class => 'input' + + %=l 'aws_MAILSTATUS' + + % param 'Mailstatus' => $aws_datas->{mailstatus} unless param 'Mailstatus'; + %= select_field 'Mailstatus' => [[(l 'ENABLED') => 'enabled'], [ (l 'DISABLED') => 'disabled']], class => 'input' + + %=l 'aws_FTPSTATUS' + + % param 'Ftpstatus' => $aws_datas->{ftpstatus} unless param 'Ftpstatus'; + %= select_field 'Ftpstatus' => [[(l 'ENABLED') => 'enabled'], [ (l 'DISABLED') => 'disabled']], class => 'input' +

+

+ %=l 'aws_FREQUENCY' + + % param 'Freq' => $aws_datas->{freq} unless param 'Freq'; + %= select_field 'Freq', $c->freq_options_list(), class => 'input' +

+

+ %=l 'aws_NO_LOCAL_IP', class => 'label' + + % param 'SkipLocalIP' => $aws_datas->{skipLocalIP} unless param 'SkipLocalIP'; + %= select_field 'SkipLocalIP' => [[ (l 'YES') => 'yes'], [ (l 'NO') => 'no']], class => 'input' +

+

+ %=l 'aws_NO_EXTERNAL_IP', class => 'label' + + % param 'SkipExternalIP' => $aws_datas->{skipExternalIP} unless param 'SkipExternalIP'; + %= select_field 'SkipExternalIP' => [[(l 'NO') => 'no'], [(l 'aws_YES_EXT_IP') => 'yes'], [(l 'aws_YES_EXT_IP_MSK') => 'mask']], class => 'input' +

+

+ %=l 'aws_NO_LOCAL', class => 'label' + + % param 'SkipLocalNetworks' => $aws_datas->{skipLocalNetworks} unless param 'SkipLocalNetworks'; + %= select_field 'SkipLocalNetworks' => [[ (l 'YES') => 'yes'], [ (l 'NO') => 'no']], class => 'input' +

+

+ %=l 'aws_FRAME', class => 'label' + + % param 'UserFramesWhenCGI' => $aws_datas->{userFramesWhenCGI} unless param 'UserFramesWhenCGI'; + %= select_field 'UserFramesWhenCGI' => [[ (l 'YES') => 'yes'], [ (l 'NO') => 'no']], class => 'input' +

+

+ %=l 'aws_LANGUAGE' + + % param 'Language' => $aws_datas->{language} unless param 'Language'; + %= select_field 'Language', $c->language_options_list(), class => 'input' +

+

+ %=l 'aws_RAWLOG', class => 'label' + + % param 'Rawlog' => $aws_datas->{rawlog} unless param 'Rawlog'; + %= select_field 'Rawlog' => [[ (l 'YES') => 'yes'], [ (l 'NO') => 'no']], class => 'input' +

+

+ %=l 'aws_MAX_DOMAINS', class => 'label' + + % param 'MaxNbOfDomain' => $aws_datas->{maxNbOfDomain} unless param 'MaxNbOfDomain'; + %= text_field 'MaxNbOfDomain' => size => '5', class => 'input' +

+

+ %=l 'aws_MAX_HOSTS', class => 'label' + + % param 'MaxNbOfHosts' => $aws_datas->{maxNbOfHosts} unless param 'MaxNbOfHosts'; + %= text_field 'MaxNbOfHosts' => size => '5', class => 'input' + + + %=l 'aws_MIN_HIT_HOSTS', class => 'label' + + % param 'MinHitHost' => $aws_datas->{minHitHost} unless param 'MinHitHost'; + %= text_field 'MinHitHost' => size => '5', class => 'input' +

+

+ %=l 'aws_MAX_PAGES', class => 'label' + + % param 'MaxNbOfPages' => $aws_datas->{maxNbOfPage} unless param 'MaxNbOfPages'; + %= text_field 'MaxNbOfPages' => size => '5', class => 'input' + + + %=l 'aws_MIN_HIT_PAGES', class => 'label' + + % param 'MinHitPAge' => $aws_datas->{minHitPage} unless param 'MinHitPAge'; + %= text_field 'MinHitPAge' => size => '5', class => 'input' +

+

+ %=l 'aws_MAX_ROBOTS', class => 'label' + + % param 'MaxNbOfRobot' => $aws_datas->{maxNbOfRobot} unless param 'MaxNbOfRobot'; + %= text_field 'MaxNbOfRobot' => size => '5', class => 'input' + + + %=l 'aws_MIN_HIT_ROBOT', class => 'label' + + % param 'MinHitRobot' => $aws_datas->{minHitRobot} unless param 'MinHitRobot'; + %= text_field 'MinHitRobot' => size => '5', class => 'input' +

+

+ %=l 'aws_MAX_REFERER', class => 'label' + + % param 'MaxNbOfReferer' => $aws_datas->{maxNbOfReferer} unless param 'MaxNbOfReferer'; + %= text_field 'MaxNbOfReferer' => size => '5', class => 'input' + + + %=l 'aws_MIN_HIT_REFERER' => size => '5', class => 'label' + + % param 'MinHitRefer' => $aws_datas->{minHitRefer} unless param 'MinHitRefer'; + %= text_field 'MinHitRefer' => size => '5', class => 'input' +

+

+ %=l 'aws_MAX_KEYWORDS', class => 'label' + + % param 'MaxNbOfKeywords' => $aws_datas->{maxNbOfKeywords} unless param 'MaxNbOfKeywords'; + %= text_field 'MaxNbOfKeywords' => size => '5', class => 'input' + + + %=l 'aws_MIN_HIT_KEYWORDS', class => 'label' + + % param 'MinHitKeyword' => $aws_datas->{minHitKeyword} unless param 'MinHitKeyword'; + %= text_field 'MinHitKeyword' => size => '5', class => 'input' +

+

+ %=l 'aws_BAR_SIZE', class => 'label' + + % param 'BarSize' => $aws_datas->{barSize} unless param 'BarSize'; + %= select_field 'BarSize' => [[(l 'MEDIUM') => 'medium'], [(l 'SMALL') => 'small'], [(l 'LARGE') => 'large']], class => 'input' +

+
+ %= submit_button $c->l('SAVE'), class => 'action' +
+ %= hidden_field 'trt' => 'UPD' + %end +
diff -urN smeserver-awstats-1.4.old/root/usr/share/smanager/themes/default/templates/partials/_aws_list.html.ep smeserver-awstats-1.4/root/usr/share/smanager/themes/default/templates/partials/_aws_list.html.ep --- smeserver-awstats-1.4.old/root/usr/share/smanager/themes/default/templates/partials/_aws_list.html.ep 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-awstats-1.4/root/usr/share/smanager/themes/default/templates/partials/_aws_list.html.ep 2023-02-22 22:09:35.000000000 +0400 @@ -0,0 +1,74 @@ +
+ + %= form_for '/awstats' => (method => 'POST') => begin + %= submit_button l('aws_BUTTON_CONFIGURE'), class => 'action' + %= hidden_field 'trt' => 'CNF' +

+ % if ( $aws_datas->{status} ne 'enabled' ) { +

<%= $c->l('aws_DISABLED') %>

+ % if ($aws_datas->{username} eq 'admin' and $aws_datas->{mailstatus} eq 'enabled') { +
No WEB stats but MAIL stats are available -> Here...
+ % } + % if ($aws_datas->{username} eq 'admin' and $aws_datas->{ftpstatus} eq 'enabled') { +
No WEB stats but FTP stats are available -> Here...
+ % } + % } else { +

<%= $c->l('aws_DOMAINS_TITLE') %>

+ + %=l 'aws_STATS_NOTE' + + + + + + % foreach my $domain ( @$domains ) { + + %= t td => (class => 'sme-border') => $domain->{Domain} + %= t td => (class => 'sme-border') => $domain->{'Description'} + %= t td => (class => 'sme-border') => $domain->{'Content'} + % my $actionShow = l("$domain->{AWStats}"); + % if ( $domain->{AWStats} eq 'Show' ) { + % $actionShow = "" . l("$domain->{AWStats}") . ""; + % } + + %= t td => (class => 'sme-border') => $domain->{'Status'} + + % } + % if ( $aws_datas->{mailstatus} eq 'enabled' ) { + + %= t td => (class => 'sme-border') => 'mail' + %= t td => (class => 'sme-border') => 'Qmail stats' + %= t td => (class => 'sme-border') => '' + % my $actionShow = "Show..."; + + %= t td => (class => 'sme-border') => 'active' + + % } + + % if ( $aws_datas->{ftpstatus} eq 'enabled' ) { + + %= t td => (class => 'sme-border') => 'ftp' + %= t td => (class => 'sme-border') => 'Ftp stats' + %= t td => (class => 'sme-border') => '' + % my $actionShow = "Show..."; + + %= t td => (class => 'sme-border') => 'active' + + % } +
+ %=l 'DOMAIN_NAME' + + %=l 'DESCRIPTION_BRIEF' + + %=l 'aws_CONTENT' + AWStats + %=l 'aws_LABEL_STATUS' +
<%= $c->render_to_string(inline => $actionShow) %>
<%= $c->render_to_string(inline => $actionShow) %>
<%= $c->render_to_string(inline => $actionShow) %>
+

+ %} + % if ( $aws_datas->{logres} ) { +

Web stats: <%= $c->render_to_string(inline => $aws_datas->{logres}) %>

+ %} +

<%= $c->l( 'aws_COPYRIGHT') %>

+ % end +
diff -urN smeserver-awstats-1.4.old/root/usr/share/smanager/themes/default/templates/partials/_aws_shw.html.ep smeserver-awstats-1.4/root/usr/share/smanager/themes/default/templates/partials/_aws_shw.html.ep --- smeserver-awstats-1.4.old/root/usr/share/smanager/themes/default/templates/partials/_aws_shw.html.ep 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-awstats-1.4/root/usr/share/smanager/themes/default/templates/partials/_aws_shw.html.ep 2023-03-20 21:40:51.000000000 +0400 @@ -0,0 +1,4 @@ +
+ %= $c->render_to_string(inline => $modul) + %=l 'aws_COPYRIGHT' +