Removing PHP - tmpdir on customerdelete if files need to be deleted, fixes #728

Signed-off-by: Florian Aders (EleRas) <eleras@froxlor.org>
This commit is contained in:
Florian Aders (EleRas)
2011-08-07 14:46:05 +02:00
parent 5bb3c16312
commit 8609b2394b

View File

@@ -324,6 +324,20 @@ while($row = $db->fetch_array($result_tasks))
safe_exec('rm -rf '.escapeshellarg($maildir));
}
/*
* remove tmpdir if it exists
*/
$tmpdir = makeCorrectDir($settings['system']['mod_fcgid_tmpdir'] . '/' . $row['data']['loginname'] . '/');
if (is_dir($tmpdir)
&& $tmpdir != "/"
&& $tmpdir != $settings['system']['mod_fcgid_tmpdir']
&& substr($tmpdir, 0, strlen($settings['system']['mod_fcgid_tmpdir'])) == $settings['system']['mod_fcgid_tmpdir'])
{
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: rm -rf ' . escapeshellarg($tmpdir));
safe_exec('rm -rf '.escapeshellarg($tmpdir));
}
/*
* see if we have some php-fcgid leftovers if used
* and remove them, #200