Commit 946191f0 authored by Petr Skoda's avatar Petr Skoda
Browse files

minor coding style tweaks

parent ba571a89
......@@ -33,18 +33,17 @@ $userid = required_param('userid', PARAM_INT);
$courseid = required_param('courseid', PARAM_INT);
// Validate them and get the corresponding objects.
if (!$user = $DB->get_record('user', array('id' => $userid))) {
print_error('invaliduserid');
}
if (!$course = $DB->get_record('course', array('id' => $courseid))) {
print_error('invalidcourse');
}
$user = $DB->get_record('user', array('id' => $userid), '*', MUST_EXIST);
$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
$usercontext = get_context_instance(CONTEXT_USER, $user->id);
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
$baseurl = new moodle_url('/admin/roles/usersroles.php', array('userid'=>$userid, 'courseid'=>$courseid));
$PAGE->set_url($baseurl);
$PAGE->set_context($coursecontext);
/// Check login and permissions.
require_login($course);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment