From: stronk7 Date: Fri, 20 Jun 2003 19:44:06 +0000 (+0000) Subject: Changes to users restore and some minor bugs detected X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=adc8b0c7feb3750c6cd1e0bc4c5100d6bdbdf3f3;p=moodle.git Changes to users restore and some minor bugs detected (when no modules were selected to restore) --- diff --git a/backup/restore_execute.html b/backup/restore_execute.html index 4729ca8322..337cbf1ac7 100644 --- a/backup/restore_execute.html +++ b/backup/restore_execute.html @@ -91,11 +91,11 @@ //Now create users as needed if ($status and ($restore->users == 0 or $restore->users == 1)) { - echo "
  • Creating users"; + echo "
  • Creating users
    "; $status = restore_create_users($restore,$xml_file); //Now print info about the work done if ($status) { - $recs = get_records_sql("select old_id, info from {$CFG->prefix}backup_ids + $recs = get_records_sql("select old_id, new_id from {$CFG->prefix}backup_ids where backup_code = '$restore->backup_unique_code' and table_name = 'user'"); //We've records @@ -109,21 +109,23 @@ $other_count = 0; //Iterate, filling counters foreach ($recs as $rec) { - if (strpos($rec->info,"new") !== false) { + //Get full record, using backup_getids + $record = backup_getid($restore->backup_unique_code,"user",$rec->old_id); + if (strpos($record->info,"new") !== false) { $new_count++; } - if (strpos($rec->info,"exists") !== false) { + if (strpos($record->info,"exists") !== false) { $exists_count++; } - if (strpos($rec->info,"student")) { + if (strpos($record->info,"student")) { $student_count++; - } else if (strpos($rec->info,"teacher")) { + } else if (strpos($record->info,"teacher")) { $teacher_count++; - } else if (strpos($rec->info,"admin")) { + } else if (strpos($record->info,"admin")) { $admin_count++; - } else if (strpos($rec->info,"coursecreator")) { + } else if (strpos($record->info,"coursecreator")) { $coursecreator_count++; - } else if ($rec->info == "new" or $rec->info == "exists") { + } else if ($record->info == "new" or $record->info == "exists") { $other_count++; } } @@ -173,10 +175,6 @@ if ($status) { echo "
  • Creating Course Modules"; $status = restore_create_modules($restore,$xml_file); - //If all is ok (and we have a counter) - if ($status and ($status !== true)) { - //Inform about modules restores - } }