mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-34471 libraries: changing strictness of context_XXXX::instance() when needed
This commit is contained in:
parent
bf0f06b1be
commit
0d4d49d18a
2 changed files with 8 additions and 8 deletions
|
@ -89,7 +89,7 @@ class core_group_external extends external_api {
|
|||
}
|
||||
|
||||
// now security checks
|
||||
$context = context_course::instance($group->courseid);
|
||||
$context = context_course::instance($group->courseid, IGNORE_MISSING);
|
||||
try {
|
||||
self::validate_context($context);
|
||||
} catch (Exception $e) {
|
||||
|
@ -168,7 +168,7 @@ class core_group_external extends external_api {
|
|||
$group = groups_get_group($groupid, 'id, courseid, name, description, descriptionformat, enrolmentkey', MUST_EXIST);
|
||||
|
||||
// now security checks
|
||||
$context = context_course::instance($group->courseid);
|
||||
$context = context_course::instance($group->courseid, IGNORE_MISSING);
|
||||
try {
|
||||
self::validate_context($context);
|
||||
} catch (Exception $e) {
|
||||
|
@ -235,7 +235,7 @@ class core_group_external extends external_api {
|
|||
$params = self::validate_parameters(self::get_course_groups_parameters(), array('courseid'=>$courseid));
|
||||
|
||||
// now security checks
|
||||
$context = context_course::instance($params['courseid']);
|
||||
$context = context_course::instance($params['courseid'], IGNORE_MISSING);
|
||||
try {
|
||||
self::validate_context($context);
|
||||
} catch (Exception $e) {
|
||||
|
@ -318,7 +318,7 @@ class core_group_external extends external_api {
|
|||
}
|
||||
|
||||
// now security checks
|
||||
$context = context_course::instance($group->courseid);
|
||||
$context = context_course::instance($group->courseid, IGNORE_MISSING);
|
||||
try {
|
||||
self::validate_context($context);
|
||||
} catch (Exception $e) {
|
||||
|
@ -376,7 +376,7 @@ class core_group_external extends external_api {
|
|||
// validate params
|
||||
$group = groups_get_group($groupid, 'id, courseid, name, enrolmentkey', MUST_EXIST);
|
||||
// now security checks
|
||||
$context = context_course::instance($group->courseid);
|
||||
$context = context_course::instance($group->courseid, IGNORE_MISSING);
|
||||
try {
|
||||
self::validate_context($context);
|
||||
} catch (Exception $e) {
|
||||
|
@ -456,7 +456,7 @@ class core_group_external extends external_api {
|
|||
$user = $DB->get_record('user', array('id'=>$userid, 'deleted'=>0, 'mnethostid'=>$CFG->mnet_localhost_id), '*', MUST_EXIST);
|
||||
|
||||
// now security checks
|
||||
$context = context_course::instance($group->courseid);
|
||||
$context = context_course::instance($group->courseid, IGNORE_MISSING);
|
||||
try {
|
||||
self::validate_context($context);
|
||||
} catch (Exception $e) {
|
||||
|
@ -534,7 +534,7 @@ class core_group_external extends external_api {
|
|||
$user = $DB->get_record('user', array('id'=>$userid, 'deleted'=>0, 'mnethostid'=>$CFG->mnet_localhost_id), '*', MUST_EXIST);
|
||||
|
||||
// now security checks
|
||||
$context = context_course::instance($group->courseid);
|
||||
$context = context_course::instance($group->courseid, IGNORE_MISSING);
|
||||
try {
|
||||
self::validate_context($context);
|
||||
} catch (Exception $e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue