From cc6a0dd09596403a27ebc3e2d3a953f014f965f5 Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Thu, 5 Sep 2013 11:47:19 +0800 Subject: [PATCH] MDL-41605 Enrolments: Updated unassign role url to use roleid as param Filter on enrolled users page use role param to perform filtering by role, and unassign role also contain role param to remove user role in course which used to conflict. Looking at assign role, we use roleid param, so using roleid for unassigning as well --- enrol/renderer.php | 2 +- enrol/users.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/enrol/renderer.php b/enrol/renderer.php index 9f7d8fad35a..2a2ee1f8caa 100644 --- a/enrol/renderer.php +++ b/enrol/renderer.php @@ -193,7 +193,7 @@ class core_enrol_renderer extends plugin_renderer_base { if ($canassign and (is_siteadmin() or isset($assignableroles[$roleid])) and !$role['unchangeable']) { $strunassign = get_string('unassignarole', 'role', $role['text']); $icon = html_writer::empty_tag('img', array('alt'=>$strunassign, 'src'=>$iconenrolremove)); - $url = new moodle_url($pageurl, array('action'=>'unassign', 'role'=>$roleid, 'user'=>$userid)); + $url = new moodle_url($pageurl, array('action'=>'unassign', 'roleid'=>$roleid, 'user'=>$userid)); $rolesoutput .= html_writer::tag('div', $role['text'] . html_writer::link($url, $icon, array('class'=>'unassignrolelink', 'rel'=>$roleid, 'title'=>$strunassign)), array('class'=>'role role_'.$roleid)); } else { $rolesoutput .= html_writer::tag('div', $role['text'], array('class'=>'role unchangeable', 'rel'=>$roleid)); diff --git a/enrol/users.php b/enrol/users.php index c01e361fe38..b82ebe4bad5 100644 --- a/enrol/users.php +++ b/enrol/users.php @@ -75,7 +75,7 @@ if ($action) { */ case 'unassign': if (has_capability('moodle/role:assign', $manager->get_context())) { - $role = required_param('role', PARAM_INT); + $role = required_param('roleid', PARAM_INT); $user = required_param('user', PARAM_INT); if ($confirm && $manager->unassign_role_from_user($user, $role)) { redirect($PAGE->url); @@ -83,7 +83,7 @@ if ($action) { $user = $DB->get_record('user', array('id'=>$user), '*', MUST_EXIST); $allroles = $manager->get_all_roles(); $role = $allroles[$role]; - $yesurl = new moodle_url($PAGE->url, array('action'=>'unassign', 'role'=>$role->id, 'user'=>$user->id, 'confirm'=>1, 'sesskey'=>sesskey())); + $yesurl = new moodle_url($PAGE->url, array('action'=>'unassign', 'roleid'=>$role->id, 'user'=>$user->id, 'confirm'=>1, 'sesskey'=>sesskey())); $message = get_string('unassignconfirm', 'role', array('user'=>fullname($user, true), 'role'=>$role->localname)); $pagetitle = get_string('unassignarole', 'role', $role->localname); $pagecontent = $OUTPUT->confirm($message, $yesurl, $PAGE->url);