mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-27542 calendar export: fixed the following:
1. changing auth token to use user id instead of username 2. add fall back checking for old url 3. remove yui functionality to generate calendar url 4. add missing variable 5. fixed usercontext instance
This commit is contained in:
parent
735de1c276
commit
d52777b486
7 changed files with 49 additions and 36 deletions
|
@ -150,8 +150,8 @@ echo $OUTPUT->container_start('bottom');
|
|||
if (!empty($CFG->enablecalendarexport)) {
|
||||
echo $OUTPUT->single_button(new moodle_url('export.php', array('course'=>$courseid)), get_string('exportcalendar', 'calendar'));
|
||||
if (isloggedin()) {
|
||||
$authtoken = sha1($USER->username . $USER->password . $CFG->calendar_exportsalt);
|
||||
$link = new moodle_url('/calendar/export_execute.php', array('preset_what'=>'all', 'preset_time'=>'recentupcoming', 'username'=>$USER->username, 'authtoken'=>$authtoken));
|
||||
$authtoken = sha1($USER->id . $USER->password . $CFG->calendar_exportsalt);
|
||||
$link = new moodle_url('/calendar/export_execute.php', array('preset_what'=>'all', 'preset_time'=>'recentupcoming', 'userid' => $USER->id, 'authtoken'=>$authtoken));
|
||||
$icon = html_writer::empty_tag('img', array('src'=>$OUTPUT->pix_url('i/ical'), 'height'=>'14', 'width'=>'36', 'alt'=>get_string('ical', 'calendar'), 'title'=>get_string('quickdownloadcalendar', 'calendar')));
|
||||
echo html_writer::tag('a', $icon, array('href'=>$link));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue