MDL-40044 Roles: Updated role_assigned and role_unassigned event to remove add_to_log
This commit is contained in:
@@ -75,4 +75,16 @@ class role_assigned extends base {
|
||||
protected function get_legacy_eventdata() {
|
||||
return $this->get_record_snapshot('role_assignments', $this->data['other']['id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns array of parameters to be passed to legacy add_to_log() function.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_legacy_logdata() {
|
||||
$roles = get_all_roles();
|
||||
$rolenames = role_fix_names($roles, $this->get_context(), ROLENAME_ORIGINAL, true);
|
||||
return array($this->courseid, 'role', 'assign', 'admin/roles/assign.php?contextid='.$this->contextid.'&roleid='.$this->objectid,
|
||||
$rolenames[$this->objectid], '', $this->userid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,4 +75,16 @@ class role_unassigned extends base {
|
||||
protected function get_legacy_eventdata() {
|
||||
return $this->get_record_snapshot('role_assignments', $this->data['other']['id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns array of parameters to be passed to legacy add_to_log() function.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function get_legacy_logdata() {
|
||||
$roles = get_all_roles();
|
||||
$rolenames = role_fix_names($roles, $this->get_context(), ROLENAME_ORIGINAL, true);
|
||||
return array($this->courseid, 'role', 'unassign', 'admin/roles/assign.php?contextid='.$this->contextid.'&roleid='.$this->objectid,
|
||||
$rolenames[$this->objectid], '', $this->userid);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user