]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15020 fixed typo causing deleting of all roles and contexts - thanks Joseph!
authorskodak <skodak>
Tue, 27 May 2008 13:26:00 +0000 (13:26 +0000)
committerskodak <skodak>
Tue, 27 May 2008 13:26:00 +0000 (13:26 +0000)
lib/accesslib.php

index a1e168c10fd436b6250302d6e167174683a41f0b..372f5a71ff37c09db3d936a5935ae94294a6e89a 100755 (executable)
@@ -2090,9 +2090,9 @@ function delete_context($contextlevel, $instanceid) {
     // do not use get_context_instance(), because the related object might not exist,
     // or the context does not exist yet and it would be created now
     if ($context = $DB->get_record('context', array('contextlevel'=>$contextlevel, 'instanceid'=>$instanceid))) {
-        $result = delete_records('role_assignments', array('contextid'=>$context->id)) &&
-                  delete_records('role_capabilities', array('contextid'=>$context->id)) &&
-                  delete_records('context', array('id'=>$context->id));
+        $result = $DB->delete_records('role_assignments', array('contextid'=>$context->id)) &&
+                  $DB->delete_records('role_capabilities', array('contextid'=>$context->id)) &&
+                  $DB->delete_records('context', array('id'=>$context->id));
 
         // do not mark dirty contexts if parents unknown
         if (!is_null($context->path) and $context->depth > 0) {