--- cron_daily.php.orig 2015-09-09 17:17:53.277736814 +0200
+++ cron_daily.php 2015-09-09 17:17:15.213407807 +0200
@@ -358,7 +358,15 @@
$awstats_conf_dir = $web_config['awstats_conf_dir'];
$awstats_website_conf_file = $web_config['awstats_conf_dir'].'/awstats.'.$domain.'.conf';
- if(is_file($awstats_website_conf_file)) unlink($awstats_website_conf_file);
+ $existing_awstats_conf_array = array();
+ if(is_file($awstats_website_conf_file)) {
+ $existing_awstats_conf = file($awstats_website_conf_file);
+ foreach ($existing_awstats_conf as $line) {
+ if(preg_match("/Lang=/",$line)) $existing_awstats_conf_array['Lang'] = implode('',parse_ini_string($line));
+ }
+
+ unlink($awstats_website_conf_file);
+ }
$sql = "SELECT domain FROM web_domain WHERE (type = 'alias' OR type = 'subdomain') AND parent_domain_id = ".$rec['domain_id'];
$aliases = $app->db->queryAllRecords($sql);
@@ -375,6 +383,8 @@
LogFile="/var/log/ispconfig/httpd/'.$domain.'/yesterday-access.log"
SiteDomain="'.$domain.'"
HostAliases="www.'.$domain.' localhost 127.0.0.1'.$aliasdomain.'"';
+ if (array_key_exists('Lang',$existing_awstats_conf_array)) $awstats_conf_file_content .='
+Lang="'.$existing_awstats_conf_array['Lang'].'"';
file_put_contents($awstats_website_conf_file, $awstats_conf_file_content);
}
@@ -396,7 +406,7 @@
// awstats_buildstaticpages.pl -update -config=mydomain.com -lang=en -dir=/var/www/domain.com/'.$web_folder.'/stats -awstatsprog=/path/to/awstats.pl
// $command = "$awstats_buildstaticpages_pl -update -config='$domain' -lang=".$conf['language']." -dir='$statsdir' -awstatsprog='$awstats_pl'";
- $command = "$awstats_buildstaticpages_pl -month='$awmonth' -year='$awyear' -update -config='$domain' -lang=".$conf['language']." -dir='$statsdir' -awstatsprog='$awstats_pl'";
+ $command = "$awstats_buildstaticpages_pl -month='$awmonth' -year='$awyear' -update -config='$domain' -dir='$statsdir' -awstatsprog='$awstats_pl'";
if (date("d") == 2) {
$awmonth = date("m")-1;