From 9ea57c38f77619af26d580f2355ec9d86c7e0f24 Mon Sep 17 00:00:00 2001 From: Dominik Müller <info@profi-webdesign.net> Date: Mon, 20 Jan 2014 12:24:04 -0500 Subject: [PATCH] Use -1 as "unsetted" value do not change parameter order in old functions --- server/plugins-available/nginx_plugin.inc.php | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index b49f2d2..1a6e57b 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -2236,13 +2236,22 @@ } $content = ''; - $content .= "Include \"".$awstats_conf_dir."/awstats.conf\"\n"; + if (is_file($awstats_conf_dir."/awstats.conf")) { + $include_file = $awstats_conf_dir."/awstats.conf"; + } elseif (is_file($awstats_conf_dir."/awstats.model.conf")) { + $include_file = $awstats_conf_dir."/awstats.model.conf"; + } + $content .= "Include \"".$include_file."\"\n"; $content .= "LogFile=\"/var/log/ispconfig/httpd/".$data['new']['domain']."/access.log\"\n"; $content .= "SiteDomain=\"".$data['new']['domain']."\"\n"; $content .= "HostAliases=\"www.".$data['new']['domain']." localhost 127.0.0.1\"\n"; - $app->system->file_put_contents($awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', $content); - $app->log('Created AWStats config file: '.$awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', LOGLEVEL_DEBUG); + if (isset($include_file)) { + $app->system->file_put_contents($awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', $content); + $app->log('Created AWStats config file: '.$awstats_conf_dir.'/awstats.'.$data['new']['domain'].'.conf', LOGLEVEL_DEBUG); + } else { + $app->log("No awstats base config found. Either awstats.conf or awstats.model.conf must exist in ".$awstats_conf_dir.".", LOGLEVEL_WARN); + } } if(is_file($data['new']['document_root']."/" . $web_folder . "/stats/index.html")) $app->system->unlink($data['new']['document_root']."/" . $web_folder . "/stats/index.html"); -- Gitblit v1.9.1