Commit 2bc9e127 authored by root's avatar root
Browse files

fixed error in mail_backup -> all mail-backups would have been deleted with...

fixed error in mail_backup -> all mail-backups would have been deleted with old code because of * in filename
parent aa365c41
...@@ -224,9 +224,8 @@ class cronjob_backup_mail extends cronjob { ...@@ -224,9 +224,8 @@ class cronjob_backup_mail extends cronjob {
$backups = $app->db->queryAllRecords("SELECT * FROM mail_backup WHERE server_id = ?", $conf['server_id']); $backups = $app->db->queryAllRecords("SELECT * FROM mail_backup WHERE server_id = ?", $conf['server_id']);
if(is_array($backups) && !empty($backups)){ if(is_array($backups) && !empty($backups)){
foreach($backups as $backup){ foreach($backups as $backup){
$mail_backup_dir = $backup_dir.'/mail'.$rec['domain_id']; $mail_backup_dir = $backup_dir.'/mail'.$backup['parent_domain_id'];
$mail_backup_file = 'mail'.$rec['mailuser_id'].'_*'; if(!is_file($mail_backup_dir.'/'.$backup['filename'])){
if(!is_file($mail_backup_dir.'/'.$mail_backup_file)){
$sql = "DELETE FROM mail_backup WHERE server_id = ? AND parent_domain_id = ? AND filename = ?"; $sql = "DELETE FROM mail_backup WHERE server_id = ? AND parent_domain_id = ? AND filename = ?";
$app->db->query($sql, $conf['server_id'], $backup['parent_domain_id'], $backup['filename']); $app->db->query($sql, $conf['server_id'], $backup['parent_domain_id'], $backup['filename']);
if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql); if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql);
......
Markdown is supported
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