- chown newly created awstats-directory when new domain has been created, fixes #258

This commit is contained in:
Michael Kaufmann (d00p)
2010-10-19 19:32:53 +00:00
parent fc5aea1c33
commit ce83e8f92b
3 changed files with 17 additions and 3 deletions

View File

@@ -27,7 +27,7 @@
* @return null * @return null
*/ */
function createAWStatsConf($logFile, $siteDomain, $hostAliases, $customerDocroot) function createAWStatsConf($logFile, $siteDomain, $hostAliases, $customerDocroot, $awstats_params = array())
{ {
global $pathtophpfiles, $settings; global $pathtophpfiles, $settings;
@@ -41,6 +41,8 @@ function createAWStatsConf($logFile, $siteDomain, $hostAliases, $customerDocroot
{ {
safe_exec('mkdir -p '.escapeshellarg($awstats_dir)); safe_exec('mkdir -p '.escapeshellarg($awstats_dir));
} }
// chown created folder, #258
makeChownWithNewStats($awstats_params);
// weird but could happen... // weird but could happen...
if(!is_dir($settings['system']['awstats_conf'])) if(!is_dir($settings['system']['awstats_conf']))

View File

@@ -611,7 +611,13 @@ class apache
// After inserting the AWStats information, // After inserting the AWStats information,
// be sure to build the awstats conf file as well // be sure to build the awstats conf file as well
createAWStatsConf($this->settings['system']['logfiles_directory'] . $domain['loginname'] . $speciallogfile . '-access.log', $domain['domain'], $alias . $server_alias, $domain['customerroot']); // and chown it using $awstats_params, #258
$awstats_param = array(
'loginname' => $domain['loginname'],
'guid' => $domain['guid'],
'documentroot' => $domain['documentroot']
);
createAWStatsConf($this->settings['system']['logfiles_directory'] . $domain['loginname'] . $speciallogfile . '-access.log', $domain['domain'], $alias . $server_alias, $domain['customerroot'], $awstats_params);
} }
} }

View File

@@ -557,7 +557,13 @@ class lighttpd
// After inserting the AWStats information, // After inserting the AWStats information,
// be sure to build the awstats conf file as well // be sure to build the awstats conf file as well
createAWStatsConf($this->settings['system']['logfiles_directory'] . $domain['loginname'] . $speciallogfile . '-access.log', $domain['domain'], $alias . $server_alias, $domain['customerroot']); // and chown it using $awstats_params, #258
$awstats_param = array(
'loginname' => $domain['loginname'],
'guid' => $domain['guid'],
'documentroot' => $domain['documentroot']
);
createAWStatsConf($this->settings['system']['logfiles_directory'] . $domain['loginname'] . $speciallogfile . '-access.log', $domain['domain'], $alias . $server_alias, $domain['customerroot'], $awstats_param);
} }
} }