- possibility to remove email data also if only account is being removed but not the address itself, refs #245

- possibility to remove ftp-homedir on deletion of a ftp-user, fixes #293
This commit is contained in:
Michael Kaufmann (d00p)
2010-07-19 06:03:49 +00:00
parent 525b6ee98d
commit c43574a714
5 changed files with 48 additions and 4 deletions

View File

@@ -298,6 +298,37 @@ $awstatsclean['headerold']) {
}
}
}
/**
* TYPE=8 Customer deleted a ftp account and wants the homedir to be deleted on the filesystem
* refs #293
*/
elseif ($row['type'] == '8')
{
fwrite($debugHandler, ' cron_tasks: Task8 started - deleting customer ftp homedir' . "\n");
$cronlog->logAction(CRON_ACTION, LOG_INFO, 'Task8 started - deleting customer ftp homedir');
if(is_array($row['data']))
{
if(isset($row['data']['loginname'])
&& isset($row['data']['homedir'])
) {
/*
* remove specific homedir
*/
$ftphomedir = makeCorrectDir($row['data']['homedir']);
$customerdocroot = makeCorrectDir($settings['system']['documentroot_prefix'].'/'.$row['data']['loginname'].'/');
if($ftphomedir != '/'
&& $ftphomedir != $settings['system']['documentroot_prefix']
&& $ftphomedir != $customerdocroot
) {
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: rm -rf ' . escapeshellarg($ftphomedir));
safe_exec('rm -rf '.escapeshellarg($ftphomedir));
}
}
}
}
}
if($db->num_rows($result_tasks) != 0)