mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-65973 calendar: Avoid sesskey checks in WS
External function submit_create_update_form should avoid any sesskey checks.
This commit is contained in:
parent
5dae8c0515
commit
bb0ce4793e
1 changed files with 5 additions and 0 deletions
|
@ -870,6 +870,11 @@ class core_calendar_external extends external_api {
|
||||||
self::validate_context($context);
|
self::validate_context($context);
|
||||||
parse_str($params['formdata'], $data);
|
parse_str($params['formdata'], $data);
|
||||||
|
|
||||||
|
if (WS_SERVER) {
|
||||||
|
// Request via WS, ignore sesskey checks in form library.
|
||||||
|
$USER->ignoresesskey = true;
|
||||||
|
}
|
||||||
|
|
||||||
$eventtype = isset($data['eventtype']) ? $data['eventtype'] : null;
|
$eventtype = isset($data['eventtype']) ? $data['eventtype'] : null;
|
||||||
$coursekey = ($eventtype == 'group') ? 'groupcourseid' : 'courseid';
|
$coursekey = ($eventtype == 'group') ? 'groupcourseid' : 'courseid';
|
||||||
$courseid = (!empty($data[$coursekey])) ? $data[$coursekey] : null;
|
$courseid = (!empty($data[$coursekey])) ? $data[$coursekey] : null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue