]> git.mjollnir.org Git - moodle.git/commitdiff
Solved bug. Now user files are checked againt users to backup.
authorstronk7 <stronk7>
Sun, 3 Aug 2003 09:39:27 +0000 (09:39 +0000)
committerstronk7 <stronk7>
Sun, 3 Aug 2003 09:39:27 +0000 (09:39 +0000)
Before this every thir under users was in backup.

backup/backuplib.php

index c7571476a7311fc271264dc16b3477c3a848762d..22e7256d70a4d037080ea8b51131ec27743a4d07 100644 (file)
                 } else {
                    $tok = "";
                 }
-                //Insert them into backup_files
-                $status = execute_sql("INSERT INTO {$CFG->prefix}backup_files
-                                           (backup_code, file_type, path, old_id)
-                                       VALUES
-                                           ('$backup_unique_code','user','$dir','$userid')",false);
-            //Do some output
-            backup_flush(30);
+                //Look it is a backupable user
+                $data = get_record ("backup_ids","backup_code","$backup_unique_code",
+                                                 "table_name","user",
+                                                 "old_id",$userid);
+                if ($data) {
+                    //Insert them into backup_files
+                    $status = execute_sql("INSERT INTO {$CFG->prefix}backup_files
+                                               (backup_code, file_type, path, old_id)
+                                           VALUES
+                                               ('$backup_unique_code','user','$dir','$userid')",false);
+                }
+                //Do some output
+                backup_flush(30);
             }
         }