Cannot create caldav calendar with same url for multiple users (with patch)
caldav driver does not allow two users to create a calendar with the same url because the check for existing calendar does not include user_id.
fix is simple:
+++ plugins/calendar/drivers/caldav/caldav_driver.php 2015-10-15 11:27:29.556106017 +0100
@@ -188,7 +188,7 @@
foreach ($calendars as $calendar)
{
// Skip already existent calendars
- $result = $this->rc->db->query("SELECT * FROM ".$this->db_calendars." WHERE caldav_url LIKE ?", $calendar['href']);
+ $result = $this->rc->db->query("SELECT * FROM ".$this->db_calendars." WHERE user_id=? and caldav_url LIKE ?", $this->rc->user->ID, $calendar['href']);
if($this->rc->db->affected_rows($result)) continue;
$cal['caldav_url'] = self::_encode_url($calendar['href']);
With this change multiple users can create calendar from same url. Use case is a shared calendar.