Changeset View
Changeset View
Standalone View
Standalone View
lib/Kolab/CalDAV/CalendarBackend.php
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | class CalendarBackend extends CalDAV\Backend\AbstractBackend implements CalDAV\Backend\SchedulingSupport | ||||
* Getter for a kolab_storage_folder representing the calendar for the given ID | * Getter for a kolab_storage_folder representing the calendar for the given ID | ||||
* | * | ||||
* @param string Calendar ID | * @param string Calendar ID | ||||
* @return object kolab_storage_folder instance | * @return object kolab_storage_folder instance | ||||
*/ | */ | ||||
public function get_storage_folder($id) | public function get_storage_folder($id) | ||||
{ | { | ||||
// resolve alias name | // resolve alias name | ||||
if ($this->aliases[$id]) { | if (!empty($this->aliases[$id])) { | ||||
$id = $this->aliases[$id]; | $id = $this->aliases[$id]; | ||||
} | } | ||||
if ($this->folders[$id]) { | if (!empty($this->folders[$id])) { | ||||
DAVBackend::check_storage_folder($this->folders[$id]); | DAVBackend::check_storage_folder($this->folders[$id]); | ||||
return $this->folders[$id]; | return $this->folders[$id]; | ||||
} | } | ||||
else { | else { | ||||
return DAVBackend::get_storage_folder($id, ''); | return DAVBackend::get_storage_folder($id, ''); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | class CalendarBackend extends CalDAV\Backend\AbstractBackend implements CalDAV\Backend\SchedulingSupport | ||||
public function getCalendarByName($calendarUri) | public function getCalendarByName($calendarUri) | ||||
{ | { | ||||
console(__METHOD__, $calendarUri); | console(__METHOD__, $calendarUri); | ||||
$this->_read_calendars(); | $this->_read_calendars(); | ||||
$id = $calendarUri; | $id = $calendarUri; | ||||
// resolve aliases (calendar by folder name) | // resolve aliases (calendar by folder name) | ||||
if ($this->aliases[$calendarUri]) { | if (!empty($this->aliases[$calendarUri])) { | ||||
$id = $this->aliases[$calendarUri]; | $id = $this->aliases[$calendarUri]; | ||||
} | } | ||||
if ($this->calendars[$id] && empty($this->calendars[$id]['principaluri'])) { | if (!empty($this->calendars[$id]) && empty($this->calendars[$id]['principaluri'])) { | ||||
$this->calendars[$id]['principaluri'] = 'principals/' . HTTPBasic::$current_user; | $this->calendars[$id]['principaluri'] = 'principals/' . HTTPBasic::$current_user; | ||||
} | } | ||||
// retry with subscribed = false (#2701) | // retry with subscribed = false (#2701) | ||||
if (empty($this->calendars[$id]) && !in_array($id, array('inbox','outbox','notifications')) && $this->subscribed === null && rcube::get_instance()->config->get('kolab_use_subscriptions')) { | if (empty($this->calendars[$id]) && !in_array($id, array('inbox','outbox','notifications')) && $this->subscribed === null && rcube::get_instance()->config->get('kolab_use_subscriptions')) { | ||||
$this->subscribed = false; | $this->subscribed = false; | ||||
unset($this->calendars); | unset($this->calendars); | ||||
return $this->getCalendarByName($calendarUri); | return $this->getCalendarByName($calendarUri); | ||||
▲ Show 20 Lines • Show All 1,001 Lines • Show Last 20 Lines |