fix public sharing of calendars

remotes/origin/stable4
Georg Ehrke 13 years ago
parent ea3499a712
commit 5d4c546693
  1. 4
      apps/calendar/share.php
  2. 2
      apps/calendar/templates/share.dropdown.php

@ -4,8 +4,8 @@ $token = strip_tags($_GET['t']);
$shared = OC_Calendar_Share::getElementByToken($token); $shared = OC_Calendar_Share::getElementByToken($token);
$nl = "\n\r"; $nl = "\n\r";
if($shared['type'] == OC_Calendar_Share::CALENDAR){ if($shared['type'] == OC_Calendar_Share::CALENDAR){
$calendar = OC_Calendar_App::getCalendar($cal, false); $calendar = OC_Calendar_App::getCalendar($shared['id'], false);
$calobjects = OC_Calendar_Object::all($cal); $calobjects = OC_Calendar_Object::all($shared['id']);
header('Content-Type: text/Calendar'); header('Content-Type: text/Calendar');
header('Content-Disposition: inline; filename=' . $calendar['displayname'] . '.ics'); header('Content-Disposition: inline; filename=' . $calendar['displayname'] . '.ics');
foreach($calobjects as $calobject){ foreach($calobjects as $calobject){

@ -73,5 +73,5 @@ echo html_select_options($allgroups, array());
</ul> </ul>
<div id="public"> <div id="public">
<input type="checkbox" id="publish" <?php echo ($public['share'])?'checked="checked"':'' ?>><label for="publish"><?php echo $l->t('make public'); ?></label><br> <input type="checkbox" id="publish" <?php echo ($public['share'])?'checked="checked"':'' ?>><label for="publish"><?php echo $l->t('make public'); ?></label><br>
<input type="text" id="public_token" value="<?php echo OC_Helper::linkToAbsolute('calendar', 'share.php?t=' . $public['share'], null, true) ; ?>" onmouseover="$('#public_token').select();" style="<?php echo (!$public['share'])?'display:none':'' ?>"> <input type="text" id="public_token" value="<?php echo OC_Helper::linkToAbsolute('apps/calendar', 'share.php?t=' . $public['share'], null, true) ; ?>" onmouseover="$('#public_token').select();" style="<?php echo (!$public['share'])?'display:none':'' ?>">
</div> </div>
Loading…
Cancel
Save