mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-68845 calendar: Move duplicated code to function
This commit is contained in:
parent
5486b031ee
commit
ea9c822fc3
4 changed files with 49 additions and 7 deletions
|
@ -141,10 +141,9 @@ $formdata = array(
|
|||
$exportform = new core_calendar_export_form(null, $formdata);
|
||||
$calendarurl = '';
|
||||
if ($data = $exportform->get_data()) {
|
||||
$password = $DB->get_record('user', array('id' => $USER->id), 'password');
|
||||
$params = array();
|
||||
$params['userid'] = $USER->id;
|
||||
$params['authtoken'] = sha1($USER->id . (isset($password->password) ? $password->password : '') . $CFG->calendar_exportsalt);
|
||||
$params['authtoken'] = calendar_get_export_token($USER);
|
||||
$params['preset_what'] = $data->events['exportevents'];
|
||||
$params['preset_time'] = $data->period['timeperiod'];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue