Commit ef5c451d authored by Florian Schaal's avatar Florian Schaal
Browse files

fixed remove inactive mail-backups

parent 26e265ea
......@@ -203,9 +203,14 @@ class cronjob_backup_mail extends cronjob {
$dir_handle = opendir($mail_backup_dir.'/');
while ($file = readdir($dir_handle)) {
if(!is_dir($file)) {
unlink ("$mail_backup_dir/"."$file");
if(substr($file,0,strlen($mail_backup_file)) == $mail_backup_file) {
unlink ($mail_backup_dir.'/'.$file);
}
}
}
if(count(glob($mail_backup_dir."/*", GLOB_NOSORT)) === 0) {
rmdir($mail_backup_dir);
}
}
/* remove backups from db */
$sql = "DELETE FROM mail_backup WHERE server_id = ? AND parent_domain_id = ? AND mailuser_id = ?";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment