MDL-74075 core_badges: Check accepted criterias
This commit is contained in:
committed by
Sara Arjona
parent
5f1b314b50
commit
1cdc2e81f8
@@ -55,6 +55,12 @@ if ($badge->is_active() || $badge->is_locked()) {
|
||||
redirect($return);
|
||||
}
|
||||
|
||||
// Make sure the criteria type is accepted.
|
||||
$accepted = $badge->get_accepted_criteria();
|
||||
if (!in_array($type, $accepted)) {
|
||||
redirect($return);
|
||||
}
|
||||
|
||||
if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
||||
|
||||
Reference in New Issue
Block a user