From 3f676beac0010a88e8b38487fc8786c730ba1de9 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 27 May 2003 22:34:29 +0000 Subject: [PATCH] Finished restoring users. Now, if selected, restore user files (in progress). --- backup/restore_execute.html | 53 ++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/backup/restore_execute.html b/backup/restore_execute.html index 4e84259988..3ce9acf051 100644 --- a/backup/restore_execute.html +++ b/backup/restore_execute.html @@ -72,10 +72,61 @@ if ($status and ($restore->users == 0 or $restore->users == 1)) { 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 + where backup_code = '$restore->backup_unique_code' and + table_name = 'user'"); + //We've records + if ($recs) { + $new_count = 0; + $exists_count = 0; + $student_count = 0; + $teacher_count = 0; + $coursecreator_count = 0; + $admin_count = 0; + $other_count = 0; + //Iterate, filling counters + foreach ($recs as $rec) { + if (strpos($rec->info,"new") !== false) { + $new_count++; + } + if (strpos($rec->info,"exists") !== false) { + $exists_count++; + } + if (strpos($rec->info,"admin")) { + $admin_count++; + } else if (strpos($rec->info,"coursecreator")) { + $coursecreator_count++; + } else if (strpos($rec->info,"teacher")) { + $teacher_count++; + } else if (strpos($rec->info,"student")) { + $student_count++; + } else if ($rec->info == "new" or $rec->info == "exists") { + $other_count++; + } + } + //Now print information gathered + echo " (new: ".$new_count.", existing: ".$exists_count.")"; + echo ""; + } else { + //Something is wrong. There is no users !! + $status = false; + } + } } + //Now create users as needed + if ($status and ($restore->user_files)) { + echo "
  • Copying User Files"; - + } -- 2.39.5