diff --git a/edit.php b/edit.php index c762320..6a642ae 100644 --- a/edit.php +++ b/edit.php @@ -20,7 +20,7 @@ $course = $DB->get_record('course', array('id'=>$courseid), '*', MUST_EXIST); $context = context_course::instance($course->id, MUST_EXIST); require_login($course); -require_capability('enrol/self:config', $context); +require_capability('enrol/apply:config', $context); $PAGE->set_url('/enrol/apply/edit.php', array('courseid'=>$course->id, 'id'=>$instanceid)); $PAGE->set_pagelayout('admin'); diff --git a/lib.php b/lib.php index c2d6199..2012d0b 100644 --- a/lib.php +++ b/lib.php @@ -32,7 +32,7 @@ class enrol_apply_plugin extends enrol_plugin { public function get_newinstance_link($courseid) { $context = context_course::instance($courseid, MUST_EXIST); - if (!has_capability('moodle/course:enrolconfig', $context) or !has_capability('enrol/manual:config', $context)) { + if (!has_capability('moodle/course:enrolconfig', $context) or !has_capability('enrol/apply:config', $context)) { return NULL; } // multiple instances supported - different roles with different password @@ -158,17 +158,17 @@ class enrol_apply_plugin extends enrol_plugin { $icons = array(); - if (has_capability('enrol/manual:config', $context)) { + if (has_capability('enrol/apply:config', $context)) { $editlink = new moodle_url("/enrol/apply/edit.php", array('courseid'=>$instance->courseid, 'id'=>$instance->id)); $icons[] = $OUTPUT->action_icon($editlink, new pix_icon('t/edit', get_string('edit'), 'core', array('class' => 'iconsmall'))); } - if (has_capability('enrol/manual:manage', $context)) { + if (has_capability('enrol/apply:manage', $context)) { $managelink = new moodle_url("/enrol/apply/apply.php", array('id'=>$_GET['id'],'enrolid'=>$instance->id)); $icons[] = $OUTPUT->action_icon($managelink, new pix_icon('i/users', get_string('confirmenrol', 'enrol_apply'), 'core', array('class'=>'iconsmall'))); } - if (has_capability("enrol/manual:enrol", $context)) { + if (has_capability("enrol/apply:enrol", $context)) { $enrollink = new moodle_url("/enrol/apply/enroluser.php", array('enrolid'=>$instance->id)); $icons[] = $OUTPUT->action_icon($enrollink, new pix_icon('t/enrolusers', get_string('enrolusers', 'enrol_apply'), 'core', array('class'=>'iconsmall'))); } diff --git a/unenroluser.php b/unenroluser.php index dfea543..9d423e4 100644 --- a/unenroluser.php +++ b/unenroluser.php @@ -50,8 +50,8 @@ if ($course->id == SITEID) { // Obviously require_login($course); -// Make sure the user can unenrol self enrolled users. -require_capability("enrol/self:unenrol", context_course::instance($course->id)); +// Make sure the user can unenrol users. +require_capability("enrol/apply:unenrol", context_course::instance($course->id)); // Get the enrolment manager for this course $manager = new course_enrolment_manager($PAGE, $course, $filter);