]> git.mjollnir.org Git - moodle.git/commitdiff
Improved error messages for role_assign to be more helpful
authormoodler <moodler>
Fri, 22 Sep 2006 05:23:59 +0000 (05:23 +0000)
committermoodler <moodler>
Fri, 22 Sep 2006 05:23:59 +0000 (05:23 +0000)
lib/accesslib.php

index 317b95ae62c717a1eb8deef6fd4fe792c3c22f53..a06a723756a117e2f856a189578b4c0303203629 100755 (executable)
@@ -1363,17 +1363,17 @@ function role_assign($roleid, $userid, $groupid, $contextid, $timestart=0, $time
     }
 
     if ($userid && !record_exists('user', 'id', $userid)) {
-        debugging('User does not exist!');
+        debugging('User ID '.intval($userid).' does not exist!');
         return false;
     }
 
     if ($groupid && !record_exists('groups', 'id', $groupid)) {
-        debugging('Group does not exist!');
+        debugging('Group ID '.intval($groupid).' does not exist!');
         return false;
     }
 
     if (!$context = get_context_instance_by_id($contextid)) {
-        debugging('A valid context must be provided');
+        debugging('Context ID '.intval($contextid).' does not exist!');
         return false;
     }