Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Changes to users restore and some minor bugs detected

(when no modules were selected to restore)
  • Loading branch information...
commit adc8b0c7feb3750c6cd1e0bc4c5100d6bdbdf3f3 1 parent af9cd95
authored June 20, 2003

Showing 1 changed file with 11 additions and 13 deletions. Show diff stats Hide diff stats

  1. 24  backup/restore_execute.html
24  backup/restore_execute.html
@@ -91,11 +91,11 @@
91 91
 
92 92
     //Now create users as needed 
93 93
     if ($status and ($restore->users == 0 or $restore->users == 1)) {
94  
-        echo "<li>Creating users";
  94
+        echo "<li>Creating users<br>";
95 95
         $status = restore_create_users($restore,$xml_file);
96 96
         //Now print info about the work done
97 97
         if ($status) {
98  
-            $recs = get_records_sql("select old_id, info from {$CFG->prefix}backup_ids
  98
+            $recs = get_records_sql("select old_id, new_id from {$CFG->prefix}backup_ids
99 99
                                      where backup_code = '$restore->backup_unique_code' and
100 100
                                      table_name = 'user'");
101 101
             //We've records
@@ -109,21 +109,23 @@
109 109
                 $other_count = 0;
110 110
                 //Iterate, filling counters
111 111
                 foreach ($recs as $rec) {
112  
-                    if (strpos($rec->info,"new") !== false) {
  112
+                    //Get full record, using backup_getids
  113
+                    $record = backup_getid($restore->backup_unique_code,"user",$rec->old_id);
  114
+                    if (strpos($record->info,"new") !== false) {
113 115
                         $new_count++;
114 116
                     } 
115  
-                    if (strpos($rec->info,"exists") !== false) {
  117
+                    if (strpos($record->info,"exists") !== false) {
116 118
                         $exists_count++;
117 119
                     }
118  
-                    if (strpos($rec->info,"student")) {
  120
+                    if (strpos($record->info,"student")) {
119 121
                         $student_count++;
120  
-                    } else if (strpos($rec->info,"teacher")) {
  122
+                    } else if (strpos($record->info,"teacher")) {
121 123
                         $teacher_count++;
122  
-                    } else if (strpos($rec->info,"admin")) {
  124
+                    } else if (strpos($record->info,"admin")) {
123 125
                         $admin_count++;
124  
-                    } else if (strpos($rec->info,"coursecreator")) {
  126
+                    } else if (strpos($record->info,"coursecreator")) {
125 127
                         $coursecreator_count++;
126  
-                    } else if ($rec->info == "new" or $rec->info == "exists") {
  128
+                    } else if ($record->info == "new" or $record->info == "exists") {
127 129
                         $other_count++;
128 130
                     }
129 131
                 }
@@ -173,10 +175,6 @@
173 175
     if ($status) {
174 176
         echo "<li>Creating Course Modules";
175 177
         $status = restore_create_modules($restore,$xml_file);
176  
-        //If all is ok (and we have a counter)
177  
-        if ($status and ($status !== true)) {   
178  
-            //Inform about modules restores
179  
-        }
180 178
     }
181 179
 
182 180
     

0 notes on commit adc8b0c

Please sign in to comment.
Something went wrong with that request. Please try again.