remove unnecessary removal of fcgid-configs (done in ConfigIO) and remove old logs from customer if file-deletion is wanted

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-10-11 18:27:26 +02:00
parent 0b0126ed68
commit 72fcad5007

View File

@@ -244,33 +244,22 @@ while ($row = $db->fetch_array($result_tasks)) {
/* /*
* see if we have some php-fcgid leftovers if used * see if we have some php-fcgid leftovers if used
* and remove them, #200 * and remove them, #200
* UPDATE: this is being done in ConfigIO::cleanUp()
*/ */
if($settings['system']['mod_fcgid'] == 1)
{
// e.g. /var/www/php-fcgi-starter/web1/
$configdir = makeCorrectDir($settings['system']['mod_fcgid_configdir'] . '/' . $row['data']['loginname'] . '/');
if (is_dir($configdir)) /**
{ * webserver logs
$its = new RecursiveIteratorIterator( */
new RecursiveDirectoryIterator($configdir) $logsdir = makeCorrectFile($settings['system']['logfiles_directory'].'/'.$row['data']['loginname']);
); if ($logsdir != '/'
&& $logsdir != makeCorrectDir($settings['system']['logfiles_directory'])
// iterate through all subdirs, && substr($logsdir, 0, strlen($settings['system']['logfiles_directory'])) == $settings['system']['logfiles_directory']
// look for php-fcgi-starter files ) {
// and take immutable-flag away from them // build up wildcard for webX-{access,error}.log{*}
// so we can delete them :) $logfiles = $logsdir.'-*';
foreach ($its as $fullFileName => $it ) safe_exec('rm -f '.escapeshellarg($logfiles));
{
if ($it->isFile() && $it->getFilename() == 'php-fcgi-starter')
{
removeImmutable($its->getPathname());
}
}
// now get rid of old stuff
safe_exec('rm -rf '. escapeshellarg($configdir));
}
} }
} }
} }
} }