Permalink
Browse files

Fix for bug 3508 -- only do the clam log on backup/restore for restor…

…ing course/user/group files, not for temp backup data
  • Loading branch information...
1 parent 49d7755 commit 61fd69b8ae1b74f902e5ba1e405550294f654c75 mjollnir_ committed Jun 16, 2005
Showing with 7 additions and 5 deletions.
  1. +4 −2 backup/lib.php
  2. +3 −3 backup/restorelib.php
View
@@ -280,7 +280,7 @@ function clean_temp_data ($preferences) {
//I've copied it from: http://www.php.net/manual/en/function.copy.php
//Little modifications done
- function backup_copy_file ($from_file,$to_file) {
+ function backup_copy_file ($from_file,$to_file,$log_clam=false) {
global $CFG;
@@ -290,7 +290,9 @@ function backup_copy_file ($from_file,$to_file) {
//return copy($from_file,$to_file) && chmod($to_file,$perms);
umask(0000);
if (copy($from_file,$to_file) && chmod($to_file,$CFG->directorypermissions)) {
- clam_log_upload($to_file,null,true);
+ if (!empty($log_clam)) {
+ clam_log_upload($to_file,null,true);
+ }
return true;
}
return false;
View
@@ -2208,7 +2208,7 @@ function restore_user_files($restore) {
//Only if destination doesn't exists
if (!file_exists($dest_dir."/".$data->new_id)) {
$status = backup_copy_file($rootdir."/".$dir,
- $dest_dir."/".$data->new_id);
+ $dest_dir."/".$data->new_id,true);
$counter ++;
}
//Do some output
@@ -2264,7 +2264,7 @@ function restore_group_files($restore) {
//If that group exists in backup_ids
if ($data) {
if (!file_exists($dest_dir."/".$data->new_id)) {
- $status = backup_copy_file($rootdir."/".$dir, $dest_dir."/".$data->new_id);
+ $status = backup_copy_file($rootdir."/".$dir, $dest_dir."/".$data->new_id,true);
$counter ++;
}
//Do some output
@@ -2316,7 +2316,7 @@ function restore_course_files($restore) {
//Only if destination file/dir doesn exists
if (!file_exists($dest_dir."/".$dir)) {
$status = backup_copy_file($rootdir."/".$dir,
- $dest_dir."/".$dir);
+ $dest_dir."/".$dir,true);
$counter ++;
}
//Do some output

0 comments on commit 61fd69b

Please sign in to comment.