migrated a few functions to new Settings class and removed unused function createAWStatsVhost(), refs #1325

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-12-15 13:05:19 +01:00
parent 558108008a
commit 52aaedd33a
15 changed files with 85 additions and 177 deletions

View File

@@ -24,34 +24,30 @@
*
* @return void
*/
function makeChownWithNewStats($row)
{
global $settings;
function makeChownWithNewStats($row) {
// get correct user
if($settings['system']['mod_fcgid'] == '1' && isset($row['deactivated']) && $row['deactivated'] == '0')
{
if ((Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1')
&& isset($row['deactivated'])
&& $row['deactivated'] == '0'
) {
$user = $row['loginname'];
$group = $row['loginname'];
}
else
{
} else {
$user = $row['guid'];
$group = $row['guid'];
}
// get correct directory
$dir = $row['documentroot'];
if($settings['system']['awstats_enabled'] == '1')
{
if (Settings::Get('system.awstats_enabled') == '1') {
$dir .= '/awstats/';
} else {
$dir .= '/webalizer/';
}
// only run chown if directory exists
if (file_exists($dir))
{
if (file_exists($dir)) {
// run chown
safe_exec('chown -R '.escapeshellarg($user).':'.escapeshellarg($group).' '.escapeshellarg(makeCorrectDir($dir)));
}