]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15690, MDL-16518 backup - include roles with overrides (not only with assignments...
authorstronk7 <stronk7>
Thu, 7 May 2009 23:54:46 +0000 (23:54 +0000)
committerstronk7 <stronk7>
Thu, 7 May 2009 23:54:46 +0000 (23:54 +0000)
backup/backuplib.php

index a5ce442bbafc8f93eab338fb6cca138f60735ae0..e3aa6202c7df200a55318d4a2bcdfe2dd8f409c6 100644 (file)
             }
         }
 
-        // foreach context, call get_roles_on_exact_context insert into array
+        // foreach context, call get_roles_on_exact_context + get_roles_with_override_on_context() and insert into array
         foreach ($contexts as $context) {
-            if ($proles = get_roles_on_exact_context($context)) {
+            if ($proles = get_roles_on_exact_context($context)) { // Look for roles assignments
+                foreach ($proles as $prole) {
+                    $roles[$prole->id] = $prole;
+                }
+            }
+            if ($proles = get_roles_with_override_on_context($context)) { // Look for roles overrides
                 foreach ($proles as $prole) {
                     $roles[$prole->id] = $prole;
                 }