MDL-11241, adding logs for roles management

This commit is contained in:
toyomoyo
2007-10-18 05:53:14 +00:00
parent 8754093016
commit cb8cb8bf88
4 changed files with 28 additions and 3 deletions
+7
View File
@@ -2666,10 +2666,17 @@ function delete_role($roleid) {
}
// finally delete the role itself
// get this before the name is gone for logging
$rolename = get_field('role', 'name', 'id', $roleid);
if ($success and !delete_records('role', 'id', $roleid)) {
debugging("Could not delete role record with ID $roleid!");
$success = false;
}
if ($success) {
add_to_log(SITEID, 'role', 'delete', 'admin/roles/action=delete&roleid='.$roleid, $rolename, '', $USER->id);
}
return $success;
}