From 7cb413afce11b37255402ab0c86de667534f4f8e Mon Sep 17 00:00:00 2001 From: Carsten Schoene <ispconfig-dev@j0ke.net> Date: Sat, 04 Jan 2014 13:54:45 -0500 Subject: [PATCH] use ajax backend for IPv6 addresses in dns wizard --- 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..0025743 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