]> git.mjollnir.org Git - moodle.git/commitdiff
Now user_files are restored if the user existed previously but he
authorstronk7 <stronk7>
Wed, 10 Mar 2004 16:15:42 +0000 (16:15 +0000)
committerstronk7 <stronk7>
Wed, 10 Mar 2004 16:15:42 +0000 (16:15 +0000)
doesn't have a dir under the users dir.
See bug 1123 (http://moodle.org/bugs/bug.php?op=show&bugid=1123)

backup/restorelib.php

index efd435f4b83f65bd238b64e884de544dcde59f6b..051fc538f8efc9b6f4aa41d697c539f972697434 100644 (file)
                     //If thar user exists in backup_ids
                     if ($data) {
                         //Only it user has been created now
-                        if (strpos($data->info,"new") !== false) {
+                        //or if it existed previously, but he hasn't image (see bug 1123)
+                        if ((strpos($data->info,"new") !== false) or 
+                            (!check_dir_exists($dest_dir."/".$data->new_id,false))) {
                             //Copy the old_dir to its new location (and name) !!
                             //Only if destination doesn't exists
                             if (!file_exists($dest_dir."/".$data->new_id)) {