Passed
Push — master ( ab9207...b291d9 )
by Morris
10:44 queued 11s
created
apps/dav/lib/CalDAV/Calendar.php 1 patch
Indentation   +307 added lines, -307 removed lines patch added patch discarded remove patch
@@ -43,311 +43,311 @@
 block discarded – undo
43 43
  */
44 44
 class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
45 45
 
46
-	/** @var IConfig */
47
-	private $config;
48
-
49
-	public function __construct(BackendInterface $caldavBackend, $calendarInfo, IL10N $l10n, IConfig $config) {
50
-		parent::__construct($caldavBackend, $calendarInfo);
51
-
52
-		if ($this->getName() === BirthdayService::BIRTHDAY_CALENDAR_URI) {
53
-			$this->calendarInfo['{DAV:}displayname'] = $l10n->t('Contact birthdays');
54
-		}
55
-		if ($this->getName() === CalDavBackend::PERSONAL_CALENDAR_URI &&
56
-			$this->calendarInfo['{DAV:}displayname'] === CalDavBackend::PERSONAL_CALENDAR_NAME) {
57
-			$this->calendarInfo['{DAV:}displayname'] = $l10n->t('Personal');
58
-		}
59
-
60
-		$this->config = $config;
61
-	}
62
-
63
-	/**
64
-	 * Updates the list of shares.
65
-	 *
66
-	 * The first array is a list of people that are to be added to the
67
-	 * resource.
68
-	 *
69
-	 * Every element in the add array has the following properties:
70
-	 *   * href - A url. Usually a mailto: address
71
-	 *   * commonName - Usually a first and last name, or false
72
-	 *   * summary - A description of the share, can also be false
73
-	 *   * readOnly - A boolean value
74
-	 *
75
-	 * Every element in the remove array is just the address string.
76
-	 *
77
-	 * @param array $add
78
-	 * @param array $remove
79
-	 * @return void
80
-	 * @throws Forbidden
81
-	 */
82
-	public function updateShares(array $add, array $remove) {
83
-		if ($this->isShared()) {
84
-			throw new Forbidden();
85
-		}
86
-		$this->caldavBackend->updateShares($this, $add, $remove);
87
-	}
88
-
89
-	/**
90
-	 * Returns the list of people whom this resource is shared with.
91
-	 *
92
-	 * Every element in this array should have the following properties:
93
-	 *   * href - Often a mailto: address
94
-	 *   * commonName - Optional, for example a first + last name
95
-	 *   * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
96
-	 *   * readOnly - boolean
97
-	 *   * summary - Optional, a description for the share
98
-	 *
99
-	 * @return array
100
-	 */
101
-	public function getShares() {
102
-		if ($this->isShared()) {
103
-			return [];
104
-		}
105
-		return $this->caldavBackend->getShares($this->getResourceId());
106
-	}
107
-
108
-	/**
109
-	 * @return int
110
-	 */
111
-	public function getResourceId() {
112
-		return $this->calendarInfo['id'];
113
-	}
114
-
115
-	/**
116
-	 * @return string
117
-	 */
118
-	public function getPrincipalURI() {
119
-		return $this->calendarInfo['principaluri'];
120
-	}
121
-
122
-	public function getACL() {
123
-		$acl =  [
124
-			[
125
-				'privilege' => '{DAV:}read',
126
-				'principal' => $this->getOwner(),
127
-				'protected' => true,
128
-			]];
129
-		if ($this->getName() !== BirthdayService::BIRTHDAY_CALENDAR_URI) {
130
-			$acl[] = [
131
-				'privilege' => '{DAV:}write',
132
-				'principal' => $this->getOwner(),
133
-				'protected' => true,
134
-			];
135
-		} else {
136
-			$acl[] = [
137
-				'privilege' => '{DAV:}write-properties',
138
-				'principal' => $this->getOwner(),
139
-				'protected' => true,
140
-			];
141
-		}
142
-
143
-		if (!$this->isShared()) {
144
-			return $acl;
145
-		}
146
-
147
-		if ($this->getOwner() !== parent::getOwner()) {
148
-			$acl[] =  [
149
-					'privilege' => '{DAV:}read',
150
-					'principal' => parent::getOwner(),
151
-					'protected' => true,
152
-				];
153
-			if ($this->canWrite()) {
154
-				$acl[] = [
155
-					'privilege' => '{DAV:}write',
156
-					'principal' => parent::getOwner(),
157
-					'protected' => true,
158
-				];
159
-			} else {
160
-				$acl[] = [
161
-					'privilege' => '{DAV:}write-properties',
162
-					'principal' => parent::getOwner(),
163
-					'protected' => true,
164
-				];
165
-			}
166
-		}
167
-		if ($this->isPublic()) {
168
-			$acl[] = [
169
-				'privilege' => '{DAV:}read',
170
-				'principal' => 'principals/system/public',
171
-				'protected' => true,
172
-			];
173
-		}
174
-
175
-		$acl = $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl);
176
-		$allowedPrincipals = [$this->getOwner(), parent::getOwner(), 'principals/system/public'];
177
-		return array_filter($acl, function($rule) use ($allowedPrincipals) {
178
-			return \in_array($rule['principal'], $allowedPrincipals, true);
179
-		});
180
-	}
181
-
182
-	public function getChildACL() {
183
-		return $this->getACL();
184
-	}
185
-
186
-	public function getOwner() {
187
-		if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) {
188
-			return $this->calendarInfo['{http://owncloud.org/ns}owner-principal'];
189
-		}
190
-		return parent::getOwner();
191
-	}
192
-
193
-	public function delete() {
194
-		if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal']) &&
195
-			$this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri']) {
196
-			$principal = 'principal:' . parent::getOwner();
197
-			$shares = $this->caldavBackend->getShares($this->getResourceId());
198
-			$shares = array_filter($shares, function($share) use ($principal){
199
-				return $share['href'] === $principal;
200
-			});
201
-			if (empty($shares)) {
202
-				throw new Forbidden();
203
-			}
204
-
205
-			$this->caldavBackend->updateShares($this, [], [
206
-				$principal
207
-			]);
208
-			return;
209
-		}
210
-
211
-		// Remember when a user deleted their birthday calendar
212
-		// in order to not regenerate it on the next contacts change
213
-		if ($this->getName() === BirthdayService::BIRTHDAY_CALENDAR_URI) {
214
-			$principalURI = $this->getPrincipalURI();
215
-			$userId = substr($principalURI, 17);
216
-
217
-			$this->config->setUserValue($userId, 'dav', 'generateBirthdayCalendar', 'no');
218
-		}
219
-
220
-		parent::delete();
221
-	}
222
-
223
-	public function propPatch(PropPatch $propPatch) {
224
-		// parent::propPatch will only update calendars table
225
-		// if calendar is shared, changes have to be made to the properties table
226
-		if (!$this->isShared()) {
227
-			parent::propPatch($propPatch);
228
-		}
229
-	}
230
-
231
-	public function getChild($name) {
232
-
233
-		$obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $name);
234
-
235
-		if (!$obj) {
236
-			throw new NotFound('Calendar object not found');
237
-		}
238
-
239
-		if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) {
240
-			throw new NotFound('Calendar object not found');
241
-		}
242
-
243
-		$obj['acl'] = $this->getChildACL();
244
-
245
-		return new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
246
-
247
-	}
248
-
249
-	public function getChildren() {
250
-
251
-		$objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id']);
252
-		$children = [];
253
-		foreach ($objs as $obj) {
254
-			if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) {
255
-				continue;
256
-			}
257
-			$obj['acl'] = $this->getChildACL();
258
-			$children[] = new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
259
-		}
260
-		return $children;
261
-
262
-	}
263
-
264
-	public function getMultipleChildren(array $paths) {
265
-
266
-		$objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths);
267
-		$children = [];
268
-		foreach ($objs as $obj) {
269
-			if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) {
270
-				continue;
271
-			}
272
-			$obj['acl'] = $this->getChildACL();
273
-			$children[] = new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
274
-		}
275
-		return $children;
276
-
277
-	}
278
-
279
-	public function childExists($name) {
280
-		$obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $name);
281
-		if (!$obj) {
282
-			return false;
283
-		}
284
-		if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) {
285
-			return false;
286
-		}
287
-
288
-		return true;
289
-	}
290
-
291
-	public function calendarQuery(array $filters) {
292
-
293
-		$uris = $this->caldavBackend->calendarQuery($this->calendarInfo['id'], $filters);
294
-		if ($this->isShared()) {
295
-			return array_filter($uris, function ($uri) {
296
-				return $this->childExists($uri);
297
-			});
298
-		}
299
-
300
-		return $uris;
301
-	}
302
-
303
-	/**
304
-	 * @param boolean $value
305
-	 * @return string|null
306
-	 */
307
-	public function setPublishStatus($value) {
308
-		$publicUri = $this->caldavBackend->setPublishStatus($value, $this);
309
-		$this->calendarInfo['publicuri'] = $publicUri;
310
-		return $publicUri;
311
-	}
312
-
313
-	/**
314
-	 * @return mixed $value
315
-	 */
316
-	public function getPublishStatus() {
317
-		return $this->caldavBackend->getPublishStatus($this);
318
-	}
319
-
320
-	private function canWrite() {
321
-		if (isset($this->calendarInfo['{http://owncloud.org/ns}read-only'])) {
322
-			return !$this->calendarInfo['{http://owncloud.org/ns}read-only'];
323
-		}
324
-		return true;
325
-	}
326
-
327
-	private function isPublic() {
328
-		return isset($this->calendarInfo['{http://owncloud.org/ns}public']);
329
-	}
330
-
331
-	protected function isShared() {
332
-		if (!isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) {
333
-			return false;
334
-		}
335
-
336
-		return $this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri'];
337
-	}
338
-
339
-	public function isSubscription() {
340
-		return isset($this->calendarInfo['{http://calendarserver.org/ns/}source']);
341
-	}
342
-
343
-	/**
344
-	 * @inheritDoc
345
-	 */
346
-	public function getChanges($syncToken, $syncLevel, $limit = null) {
347
-		if (!$syncToken && $limit) {
348
-			throw new UnsupportedLimitOnInitialSyncException();
349
-		}
350
-
351
-		return parent::getChanges($syncToken, $syncLevel, $limit);
352
-	}
46
+    /** @var IConfig */
47
+    private $config;
48
+
49
+    public function __construct(BackendInterface $caldavBackend, $calendarInfo, IL10N $l10n, IConfig $config) {
50
+        parent::__construct($caldavBackend, $calendarInfo);
51
+
52
+        if ($this->getName() === BirthdayService::BIRTHDAY_CALENDAR_URI) {
53
+            $this->calendarInfo['{DAV:}displayname'] = $l10n->t('Contact birthdays');
54
+        }
55
+        if ($this->getName() === CalDavBackend::PERSONAL_CALENDAR_URI &&
56
+            $this->calendarInfo['{DAV:}displayname'] === CalDavBackend::PERSONAL_CALENDAR_NAME) {
57
+            $this->calendarInfo['{DAV:}displayname'] = $l10n->t('Personal');
58
+        }
59
+
60
+        $this->config = $config;
61
+    }
62
+
63
+    /**
64
+     * Updates the list of shares.
65
+     *
66
+     * The first array is a list of people that are to be added to the
67
+     * resource.
68
+     *
69
+     * Every element in the add array has the following properties:
70
+     *   * href - A url. Usually a mailto: address
71
+     *   * commonName - Usually a first and last name, or false
72
+     *   * summary - A description of the share, can also be false
73
+     *   * readOnly - A boolean value
74
+     *
75
+     * Every element in the remove array is just the address string.
76
+     *
77
+     * @param array $add
78
+     * @param array $remove
79
+     * @return void
80
+     * @throws Forbidden
81
+     */
82
+    public function updateShares(array $add, array $remove) {
83
+        if ($this->isShared()) {
84
+            throw new Forbidden();
85
+        }
86
+        $this->caldavBackend->updateShares($this, $add, $remove);
87
+    }
88
+
89
+    /**
90
+     * Returns the list of people whom this resource is shared with.
91
+     *
92
+     * Every element in this array should have the following properties:
93
+     *   * href - Often a mailto: address
94
+     *   * commonName - Optional, for example a first + last name
95
+     *   * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
96
+     *   * readOnly - boolean
97
+     *   * summary - Optional, a description for the share
98
+     *
99
+     * @return array
100
+     */
101
+    public function getShares() {
102
+        if ($this->isShared()) {
103
+            return [];
104
+        }
105
+        return $this->caldavBackend->getShares($this->getResourceId());
106
+    }
107
+
108
+    /**
109
+     * @return int
110
+     */
111
+    public function getResourceId() {
112
+        return $this->calendarInfo['id'];
113
+    }
114
+
115
+    /**
116
+     * @return string
117
+     */
118
+    public function getPrincipalURI() {
119
+        return $this->calendarInfo['principaluri'];
120
+    }
121
+
122
+    public function getACL() {
123
+        $acl =  [
124
+            [
125
+                'privilege' => '{DAV:}read',
126
+                'principal' => $this->getOwner(),
127
+                'protected' => true,
128
+            ]];
129
+        if ($this->getName() !== BirthdayService::BIRTHDAY_CALENDAR_URI) {
130
+            $acl[] = [
131
+                'privilege' => '{DAV:}write',
132
+                'principal' => $this->getOwner(),
133
+                'protected' => true,
134
+            ];
135
+        } else {
136
+            $acl[] = [
137
+                'privilege' => '{DAV:}write-properties',
138
+                'principal' => $this->getOwner(),
139
+                'protected' => true,
140
+            ];
141
+        }
142
+
143
+        if (!$this->isShared()) {
144
+            return $acl;
145
+        }
146
+
147
+        if ($this->getOwner() !== parent::getOwner()) {
148
+            $acl[] =  [
149
+                    'privilege' => '{DAV:}read',
150
+                    'principal' => parent::getOwner(),
151
+                    'protected' => true,
152
+                ];
153
+            if ($this->canWrite()) {
154
+                $acl[] = [
155
+                    'privilege' => '{DAV:}write',
156
+                    'principal' => parent::getOwner(),
157
+                    'protected' => true,
158
+                ];
159
+            } else {
160
+                $acl[] = [
161
+                    'privilege' => '{DAV:}write-properties',
162
+                    'principal' => parent::getOwner(),
163
+                    'protected' => true,
164
+                ];
165
+            }
166
+        }
167
+        if ($this->isPublic()) {
168
+            $acl[] = [
169
+                'privilege' => '{DAV:}read',
170
+                'principal' => 'principals/system/public',
171
+                'protected' => true,
172
+            ];
173
+        }
174
+
175
+        $acl = $this->caldavBackend->applyShareAcl($this->getResourceId(), $acl);
176
+        $allowedPrincipals = [$this->getOwner(), parent::getOwner(), 'principals/system/public'];
177
+        return array_filter($acl, function($rule) use ($allowedPrincipals) {
178
+            return \in_array($rule['principal'], $allowedPrincipals, true);
179
+        });
180
+    }
181
+
182
+    public function getChildACL() {
183
+        return $this->getACL();
184
+    }
185
+
186
+    public function getOwner() {
187
+        if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) {
188
+            return $this->calendarInfo['{http://owncloud.org/ns}owner-principal'];
189
+        }
190
+        return parent::getOwner();
191
+    }
192
+
193
+    public function delete() {
194
+        if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal']) &&
195
+            $this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri']) {
196
+            $principal = 'principal:' . parent::getOwner();
197
+            $shares = $this->caldavBackend->getShares($this->getResourceId());
198
+            $shares = array_filter($shares, function($share) use ($principal){
199
+                return $share['href'] === $principal;
200
+            });
201
+            if (empty($shares)) {
202
+                throw new Forbidden();
203
+            }
204
+
205
+            $this->caldavBackend->updateShares($this, [], [
206
+                $principal
207
+            ]);
208
+            return;
209
+        }
210
+
211
+        // Remember when a user deleted their birthday calendar
212
+        // in order to not regenerate it on the next contacts change
213
+        if ($this->getName() === BirthdayService::BIRTHDAY_CALENDAR_URI) {
214
+            $principalURI = $this->getPrincipalURI();
215
+            $userId = substr($principalURI, 17);
216
+
217
+            $this->config->setUserValue($userId, 'dav', 'generateBirthdayCalendar', 'no');
218
+        }
219
+
220
+        parent::delete();
221
+    }
222
+
223
+    public function propPatch(PropPatch $propPatch) {
224
+        // parent::propPatch will only update calendars table
225
+        // if calendar is shared, changes have to be made to the properties table
226
+        if (!$this->isShared()) {
227
+            parent::propPatch($propPatch);
228
+        }
229
+    }
230
+
231
+    public function getChild($name) {
232
+
233
+        $obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $name);
234
+
235
+        if (!$obj) {
236
+            throw new NotFound('Calendar object not found');
237
+        }
238
+
239
+        if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) {
240
+            throw new NotFound('Calendar object not found');
241
+        }
242
+
243
+        $obj['acl'] = $this->getChildACL();
244
+
245
+        return new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
246
+
247
+    }
248
+
249
+    public function getChildren() {
250
+
251
+        $objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id']);
252
+        $children = [];
253
+        foreach ($objs as $obj) {
254
+            if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) {
255
+                continue;
256
+            }
257
+            $obj['acl'] = $this->getChildACL();
258
+            $children[] = new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
259
+        }
260
+        return $children;
261
+
262
+    }
263
+
264
+    public function getMultipleChildren(array $paths) {
265
+
266
+        $objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths);
267
+        $children = [];
268
+        foreach ($objs as $obj) {
269
+            if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) {
270
+                continue;
271
+            }
272
+            $obj['acl'] = $this->getChildACL();
273
+            $children[] = new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
274
+        }
275
+        return $children;
276
+
277
+    }
278
+
279
+    public function childExists($name) {
280
+        $obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $name);
281
+        if (!$obj) {
282
+            return false;
283
+        }
284
+        if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) {
285
+            return false;
286
+        }
287
+
288
+        return true;
289
+    }
290
+
291
+    public function calendarQuery(array $filters) {
292
+
293
+        $uris = $this->caldavBackend->calendarQuery($this->calendarInfo['id'], $filters);
294
+        if ($this->isShared()) {
295
+            return array_filter($uris, function ($uri) {
296
+                return $this->childExists($uri);
297
+            });
298
+        }
299
+
300
+        return $uris;
301
+    }
302
+
303
+    /**
304
+     * @param boolean $value
305
+     * @return string|null
306
+     */
307
+    public function setPublishStatus($value) {
308
+        $publicUri = $this->caldavBackend->setPublishStatus($value, $this);
309
+        $this->calendarInfo['publicuri'] = $publicUri;
310
+        return $publicUri;
311
+    }
312
+
313
+    /**
314
+     * @return mixed $value
315
+     */
316
+    public function getPublishStatus() {
317
+        return $this->caldavBackend->getPublishStatus($this);
318
+    }
319
+
320
+    private function canWrite() {
321
+        if (isset($this->calendarInfo['{http://owncloud.org/ns}read-only'])) {
322
+            return !$this->calendarInfo['{http://owncloud.org/ns}read-only'];
323
+        }
324
+        return true;
325
+    }
326
+
327
+    private function isPublic() {
328
+        return isset($this->calendarInfo['{http://owncloud.org/ns}public']);
329
+    }
330
+
331
+    protected function isShared() {
332
+        if (!isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) {
333
+            return false;
334
+        }
335
+
336
+        return $this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri'];
337
+    }
338
+
339
+    public function isSubscription() {
340
+        return isset($this->calendarInfo['{http://calendarserver.org/ns/}source']);
341
+    }
342
+
343
+    /**
344
+     * @inheritDoc
345
+     */
346
+    public function getChanges($syncToken, $syncLevel, $limit = null) {
347
+        if (!$syncToken && $limit) {
348
+            throw new UnsupportedLimitOnInitialSyncException();
349
+        }
350
+
351
+        return parent::getChanges($syncToken, $syncLevel, $limit);
352
+    }
353 353
 }
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/CachedSubscription.php 1 patch
Indentation   +170 added lines, -170 removed lines patch added patch discarded remove patch
@@ -37,174 +37,174 @@
 block discarded – undo
37 37
  */
38 38
 class CachedSubscription extends \Sabre\CalDAV\Calendar {
39 39
 
40
-	/**
41
-	 * @return string
42
-	 */
43
-	public function getPrincipalURI():string {
44
-		return $this->calendarInfo['principaluri'];
45
-	}
46
-
47
-	/**
48
-	 * @return array
49
-	 */
50
-	public function getACL():array {
51
-		return [
52
-			[
53
-				'privilege' => '{DAV:}read',
54
-				'principal' => $this->getOwner(),
55
-				'protected' => true,
56
-			],
57
-			[
58
-				'privilege' => '{DAV:}read',
59
-				'principal' => $this->getOwner() . '/calendar-proxy-write',
60
-				'protected' => true,
61
-			],
62
-			[
63
-				'privilege' => '{DAV:}read',
64
-				'principal' => $this->getOwner() . '/calendar-proxy-read',
65
-				'protected' => true,
66
-			],
67
-			[
68
-				'privilege' => '{' . Plugin::NS_CALDAV . '}read-free-busy',
69
-				'principal' => '{DAV:}authenticated',
70
-				'protected' => true,
71
-			],
72
-		];
73
-	}
74
-
75
-	/**
76
-	 * @return array
77
-	 */
78
-	public function getChildACL():array {
79
-		return [
80
-			[
81
-				'privilege' => '{DAV:}read',
82
-				'principal' => $this->getOwner(),
83
-				'protected' => true,
84
-			],
85
-
86
-			[
87
-				'privilege' => '{DAV:}read',
88
-				'principal' => $this->getOwner() . '/calendar-proxy-write',
89
-				'protected' => true,
90
-			],
91
-			[
92
-				'privilege' => '{DAV:}read',
93
-				'principal' => $this->getOwner() . '/calendar-proxy-read',
94
-				'protected' => true,
95
-			],
96
-
97
-		];
98
-	}
99
-
100
-	/**
101
-	 * @return null|string
102
-	 */
103
-	public function getOwner() {
104
-		if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) {
105
-			return $this->calendarInfo['{http://owncloud.org/ns}owner-principal'];
106
-		}
107
-		return parent::getOwner();
108
-	}
109
-
110
-	/**
111
-	 *
112
-	 */
113
-	public function delete() {
114
-		$this->caldavBackend->deleteSubscription($this->calendarInfo['id']);
115
-	}
116
-
117
-	/**
118
-	 * @param PropPatch $propPatch
119
-	 */
120
-	public function propPatch(PropPatch $propPatch) {
121
-		$this->caldavBackend->updateSubscription($this->calendarInfo['id'], $propPatch);
122
-	}
123
-
124
-	/**
125
-	 * @param string $name
126
-	 * @return CalendarObject|\Sabre\CalDAV\ICalendarObject
127
-	 * @throws NotFound
128
-	 */
129
-	public function getChild($name) {
130
-		$obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $name, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
131
-		if (!$obj) {
132
-			throw new NotFound('Calendar object not found');
133
-		}
134
-
135
-		$obj['acl'] = $this->getChildACL();
136
-		return new CachedSubscriptionObject	($this->caldavBackend, $this->calendarInfo, $obj);
137
-
138
-	}
139
-
140
-	/**
141
-	 * @return array
142
-	 */
143
-	public function getChildren():array {
144
-		$objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id'], CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
145
-
146
-		$children = [];
147
-		foreach($objs as $obj) {
148
-			$children[] = new CachedSubscriptionObject($this->caldavBackend, $this->calendarInfo, $obj);
149
-		}
150
-
151
-		return $children;
152
-	}
153
-
154
-	/**
155
-	 * @param array $paths
156
-	 * @return array
157
-	 */
158
-	public function getMultipleChildren(array $paths):array {
159
-		$objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
160
-
161
-		$children = [];
162
-		foreach($objs as $obj) {
163
-			$children[] = new CachedSubscriptionObject($this->caldavBackend, $this->calendarInfo, $obj);
164
-		}
165
-
166
-		return $children;
167
-	}
168
-
169
-	/**
170
-	 * @param string $name
171
-	 * @param null $calendarData
172
-	 * @return null|string|void
173
-	 * @throws MethodNotAllowed
174
-	 */
175
-	public function createFile($name, $calendarData = null) {
176
-		throw new MethodNotAllowed('Creating objects in cached subscription is not allowed');
177
-	}
178
-
179
-	/**
180
-	 * @param string $name
181
-	 * @return bool
182
-	 */
183
-	public function childExists($name):bool {
184
-		$obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $name, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
185
-		if (!$obj) {
186
-			return false;
187
-		}
188
-
189
-		return true;
190
-	}
191
-
192
-	/**
193
-	 * @param array $filters
194
-	 * @return array
195
-	 */
196
-	public function calendarQuery(array $filters):array {
197
-		return $this->caldavBackend->calendarQuery($this->calendarInfo['id'], $filters, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
198
-	}
199
-
200
-	/**
201
-	 * @inheritDoc
202
-	 */
203
-	public function getChanges($syncToken, $syncLevel, $limit = null) {
204
-		if (!$syncToken && $limit) {
205
-			throw new UnsupportedLimitOnInitialSyncException();
206
-		}
207
-
208
-		return parent::getChanges($syncToken, $syncLevel, $limit);
209
-	}
40
+    /**
41
+     * @return string
42
+     */
43
+    public function getPrincipalURI():string {
44
+        return $this->calendarInfo['principaluri'];
45
+    }
46
+
47
+    /**
48
+     * @return array
49
+     */
50
+    public function getACL():array {
51
+        return [
52
+            [
53
+                'privilege' => '{DAV:}read',
54
+                'principal' => $this->getOwner(),
55
+                'protected' => true,
56
+            ],
57
+            [
58
+                'privilege' => '{DAV:}read',
59
+                'principal' => $this->getOwner() . '/calendar-proxy-write',
60
+                'protected' => true,
61
+            ],
62
+            [
63
+                'privilege' => '{DAV:}read',
64
+                'principal' => $this->getOwner() . '/calendar-proxy-read',
65
+                'protected' => true,
66
+            ],
67
+            [
68
+                'privilege' => '{' . Plugin::NS_CALDAV . '}read-free-busy',
69
+                'principal' => '{DAV:}authenticated',
70
+                'protected' => true,
71
+            ],
72
+        ];
73
+    }
74
+
75
+    /**
76
+     * @return array
77
+     */
78
+    public function getChildACL():array {
79
+        return [
80
+            [
81
+                'privilege' => '{DAV:}read',
82
+                'principal' => $this->getOwner(),
83
+                'protected' => true,
84
+            ],
85
+
86
+            [
87
+                'privilege' => '{DAV:}read',
88
+                'principal' => $this->getOwner() . '/calendar-proxy-write',
89
+                'protected' => true,
90
+            ],
91
+            [
92
+                'privilege' => '{DAV:}read',
93
+                'principal' => $this->getOwner() . '/calendar-proxy-read',
94
+                'protected' => true,
95
+            ],
96
+
97
+        ];
98
+    }
99
+
100
+    /**
101
+     * @return null|string
102
+     */
103
+    public function getOwner() {
104
+        if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) {
105
+            return $this->calendarInfo['{http://owncloud.org/ns}owner-principal'];
106
+        }
107
+        return parent::getOwner();
108
+    }
109
+
110
+    /**
111
+     *
112
+     */
113
+    public function delete() {
114
+        $this->caldavBackend->deleteSubscription($this->calendarInfo['id']);
115
+    }
116
+
117
+    /**
118
+     * @param PropPatch $propPatch
119
+     */
120
+    public function propPatch(PropPatch $propPatch) {
121
+        $this->caldavBackend->updateSubscription($this->calendarInfo['id'], $propPatch);
122
+    }
123
+
124
+    /**
125
+     * @param string $name
126
+     * @return CalendarObject|\Sabre\CalDAV\ICalendarObject
127
+     * @throws NotFound
128
+     */
129
+    public function getChild($name) {
130
+        $obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $name, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
131
+        if (!$obj) {
132
+            throw new NotFound('Calendar object not found');
133
+        }
134
+
135
+        $obj['acl'] = $this->getChildACL();
136
+        return new CachedSubscriptionObject	($this->caldavBackend, $this->calendarInfo, $obj);
137
+
138
+    }
139
+
140
+    /**
141
+     * @return array
142
+     */
143
+    public function getChildren():array {
144
+        $objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id'], CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
145
+
146
+        $children = [];
147
+        foreach($objs as $obj) {
148
+            $children[] = new CachedSubscriptionObject($this->caldavBackend, $this->calendarInfo, $obj);
149
+        }
150
+
151
+        return $children;
152
+    }
153
+
154
+    /**
155
+     * @param array $paths
156
+     * @return array
157
+     */
158
+    public function getMultipleChildren(array $paths):array {
159
+        $objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
160
+
161
+        $children = [];
162
+        foreach($objs as $obj) {
163
+            $children[] = new CachedSubscriptionObject($this->caldavBackend, $this->calendarInfo, $obj);
164
+        }
165
+
166
+        return $children;
167
+    }
168
+
169
+    /**
170
+     * @param string $name
171
+     * @param null $calendarData
172
+     * @return null|string|void
173
+     * @throws MethodNotAllowed
174
+     */
175
+    public function createFile($name, $calendarData = null) {
176
+        throw new MethodNotAllowed('Creating objects in cached subscription is not allowed');
177
+    }
178
+
179
+    /**
180
+     * @param string $name
181
+     * @return bool
182
+     */
183
+    public function childExists($name):bool {
184
+        $obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $name, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
185
+        if (!$obj) {
186
+            return false;
187
+        }
188
+
189
+        return true;
190
+    }
191
+
192
+    /**
193
+     * @param array $filters
194
+     * @return array
195
+     */
196
+    public function calendarQuery(array $filters):array {
197
+        return $this->caldavBackend->calendarQuery($this->calendarInfo['id'], $filters, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
198
+    }
199
+
200
+    /**
201
+     * @inheritDoc
202
+     */
203
+    public function getChanges($syncToken, $syncLevel, $limit = null) {
204
+        if (!$syncToken && $limit) {
205
+            throw new UnsupportedLimitOnInitialSyncException();
206
+        }
207
+
208
+        return parent::getChanges($syncToken, $syncLevel, $limit);
209
+    }
210 210
 }
Please login to merge, or discard this patch.
apps/dav/lib/CardDAV/CardDavBackend.php 2 patches
Indentation   +1112 added lines, -1112 removed lines patch added patch discarded remove patch
@@ -53,1116 +53,1116 @@
 block discarded – undo
53 53
 
54 54
 class CardDavBackend implements BackendInterface, SyncSupport {
55 55
 
56
-	const PERSONAL_ADDRESSBOOK_URI = 'contacts';
57
-	const PERSONAL_ADDRESSBOOK_NAME = 'Contacts';
58
-
59
-	/** @var Principal */
60
-	private $principalBackend;
61
-
62
-	/** @var string */
63
-	private $dbCardsTable = 'cards';
64
-
65
-	/** @var string */
66
-	private $dbCardsPropertiesTable = 'cards_properties';
67
-
68
-	/** @var IDBConnection */
69
-	private $db;
70
-
71
-	/** @var Backend */
72
-	private $sharingBackend;
73
-
74
-	/** @var array properties to index */
75
-	public static $indexProperties = array(
76
-			'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME',
77
-			'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD');
78
-
79
-	/**
80
-	 * @var string[] Map of uid => display name
81
-	 */
82
-	protected $userDisplayNames;
83
-
84
-	/** @var IUserManager */
85
-	private $userManager;
86
-
87
-	/** @var EventDispatcherInterface */
88
-	private $dispatcher;
89
-
90
-	/**
91
-	 * CardDavBackend constructor.
92
-	 *
93
-	 * @param IDBConnection $db
94
-	 * @param Principal $principalBackend
95
-	 * @param IUserManager $userManager
96
-	 * @param IGroupManager $groupManager
97
-	 * @param EventDispatcherInterface $dispatcher
98
-	 */
99
-	public function __construct(IDBConnection $db,
100
-								Principal $principalBackend,
101
-								IUserManager $userManager,
102
-								IGroupManager $groupManager,
103
-								EventDispatcherInterface $dispatcher) {
104
-		$this->db = $db;
105
-		$this->principalBackend = $principalBackend;
106
-		$this->userManager = $userManager;
107
-		$this->dispatcher = $dispatcher;
108
-		$this->sharingBackend = new Backend($this->db, $this->userManager, $groupManager, $principalBackend, 'addressbook');
109
-	}
110
-
111
-	/**
112
-	 * Return the number of address books for a principal
113
-	 *
114
-	 * @param $principalUri
115
-	 * @return int
116
-	 */
117
-	public function getAddressBooksForUserCount($principalUri) {
118
-		$principalUri = $this->convertPrincipal($principalUri, true);
119
-		$query = $this->db->getQueryBuilder();
120
-		$query->select($query->func()->count('*'))
121
-			->from('addressbooks')
122
-			->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
123
-
124
-		return (int)$query->execute()->fetchColumn();
125
-	}
126
-
127
-	/**
128
-	 * Returns the list of address books for a specific user.
129
-	 *
130
-	 * Every addressbook should have the following properties:
131
-	 *   id - an arbitrary unique id
132
-	 *   uri - the 'basename' part of the url
133
-	 *   principaluri - Same as the passed parameter
134
-	 *
135
-	 * Any additional clark-notation property may be passed besides this. Some
136
-	 * common ones are :
137
-	 *   {DAV:}displayname
138
-	 *   {urn:ietf:params:xml:ns:carddav}addressbook-description
139
-	 *   {http://calendarserver.org/ns/}getctag
140
-	 *
141
-	 * @param string $principalUri
142
-	 * @return array
143
-	 */
144
-	function getAddressBooksForUser($principalUri) {
145
-		$principalUriOriginal = $principalUri;
146
-		$principalUri = $this->convertPrincipal($principalUri, true);
147
-		$query = $this->db->getQueryBuilder();
148
-		$query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
149
-			->from('addressbooks')
150
-			->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
151
-
152
-		$addressBooks = [];
153
-
154
-		$result = $query->execute();
155
-		while($row = $result->fetch()) {
156
-			$addressBooks[$row['id']] = [
157
-				'id'  => $row['id'],
158
-				'uri' => $row['uri'],
159
-				'principaluri' => $this->convertPrincipal($row['principaluri'], false),
160
-				'{DAV:}displayname' => $row['displayname'],
161
-				'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
162
-				'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
163
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
164
-			];
165
-
166
-			$this->addOwnerPrincipal($addressBooks[$row['id']]);
167
-		}
168
-		$result->closeCursor();
169
-
170
-		// query for shared addressbooks
171
-		$principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true);
172
-		$principals = array_merge($principals, $this->principalBackend->getCircleMembership($principalUriOriginal));
173
-
174
-		$principals = array_map(function($principal) {
175
-			return urldecode($principal);
176
-		}, $principals);
177
-		$principals[]= $principalUri;
178
-
179
-		$query = $this->db->getQueryBuilder();
180
-		$result = $query->select(['a.id', 'a.uri', 'a.displayname', 'a.principaluri', 'a.description', 'a.synctoken', 's.access'])
181
-			->from('dav_shares', 's')
182
-			->join('s', 'addressbooks', 'a', $query->expr()->eq('s.resourceid', 'a.id'))
183
-			->where($query->expr()->in('s.principaluri', $query->createParameter('principaluri')))
184
-			->andWhere($query->expr()->eq('s.type', $query->createParameter('type')))
185
-			->setParameter('type', 'addressbook')
186
-			->setParameter('principaluri', $principals, IQueryBuilder::PARAM_STR_ARRAY)
187
-			->execute();
188
-
189
-		$readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only';
190
-		while($row = $result->fetch()) {
191
-			if ($row['principaluri'] === $principalUri) {
192
-				continue;
193
-			}
194
-
195
-			$readOnly = (int) $row['access'] === Backend::ACCESS_READ;
196
-			if (isset($addressBooks[$row['id']])) {
197
-				if ($readOnly) {
198
-					// New share can not have more permissions then the old one.
199
-					continue;
200
-				}
201
-				if (isset($addressBooks[$row['id']][$readOnlyPropertyName]) &&
202
-					$addressBooks[$row['id']][$readOnlyPropertyName] === 0) {
203
-					// Old share is already read-write, no more permissions can be gained
204
-					continue;
205
-				}
206
-			}
207
-
208
-			list(, $name) = \Sabre\Uri\split($row['principaluri']);
209
-			$uri = $row['uri'] . '_shared_by_' . $name;
210
-			$displayName = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')';
211
-
212
-			$addressBooks[$row['id']] = [
213
-				'id'  => $row['id'],
214
-				'uri' => $uri,
215
-				'principaluri' => $principalUriOriginal,
216
-				'{DAV:}displayname' => $displayName,
217
-				'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
218
-				'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
219
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
220
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $row['principaluri'],
221
-				$readOnlyPropertyName => $readOnly,
222
-			];
223
-
224
-			$this->addOwnerPrincipal($addressBooks[$row['id']]);
225
-		}
226
-		$result->closeCursor();
227
-
228
-		return array_values($addressBooks);
229
-	}
230
-
231
-	public function getUsersOwnAddressBooks($principalUri) {
232
-		$principalUri = $this->convertPrincipal($principalUri, true);
233
-		$query = $this->db->getQueryBuilder();
234
-		$query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
235
-			  ->from('addressbooks')
236
-			  ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
237
-
238
-		$addressBooks = [];
239
-
240
-		$result = $query->execute();
241
-		while($row = $result->fetch()) {
242
-			$addressBooks[$row['id']] = [
243
-				'id'  => $row['id'],
244
-				'uri' => $row['uri'],
245
-				'principaluri' => $this->convertPrincipal($row['principaluri'], false),
246
-				'{DAV:}displayname' => $row['displayname'],
247
-				'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
248
-				'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
249
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
250
-			];
251
-
252
-			$this->addOwnerPrincipal($addressBooks[$row['id']]);
253
-		}
254
-		$result->closeCursor();
255
-
256
-		return array_values($addressBooks);
257
-	}
258
-
259
-	private function getUserDisplayName($uid) {
260
-		if (!isset($this->userDisplayNames[$uid])) {
261
-			$user = $this->userManager->get($uid);
262
-
263
-			if ($user instanceof IUser) {
264
-				$this->userDisplayNames[$uid] = $user->getDisplayName();
265
-			} else {
266
-				$this->userDisplayNames[$uid] = $uid;
267
-			}
268
-		}
269
-
270
-		return $this->userDisplayNames[$uid];
271
-	}
272
-
273
-	/**
274
-	 * @param int $addressBookId
275
-	 */
276
-	public function getAddressBookById($addressBookId) {
277
-		$query = $this->db->getQueryBuilder();
278
-		$result = $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
279
-			->from('addressbooks')
280
-			->where($query->expr()->eq('id', $query->createNamedParameter($addressBookId)))
281
-			->execute();
282
-
283
-		$row = $result->fetch();
284
-		$result->closeCursor();
285
-		if ($row === false) {
286
-			return null;
287
-		}
288
-
289
-		$addressBook = [
290
-			'id'  => $row['id'],
291
-			'uri' => $row['uri'],
292
-			'principaluri' => $row['principaluri'],
293
-			'{DAV:}displayname' => $row['displayname'],
294
-			'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
295
-			'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
296
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
297
-		];
298
-
299
-		$this->addOwnerPrincipal($addressBook);
300
-
301
-		return $addressBook;
302
-	}
303
-
304
-	/**
305
-	 * @param $addressBookUri
306
-	 * @return array|null
307
-	 */
308
-	public function getAddressBooksByUri($principal, $addressBookUri) {
309
-		$query = $this->db->getQueryBuilder();
310
-		$result = $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
311
-			->from('addressbooks')
312
-			->where($query->expr()->eq('uri', $query->createNamedParameter($addressBookUri)))
313
-			->andWhere($query->expr()->eq('principaluri', $query->createNamedParameter($principal)))
314
-			->setMaxResults(1)
315
-			->execute();
316
-
317
-		$row = $result->fetch();
318
-		$result->closeCursor();
319
-		if ($row === false) {
320
-			return null;
321
-		}
322
-
323
-		$addressBook = [
324
-			'id'  => $row['id'],
325
-			'uri' => $row['uri'],
326
-			'principaluri' => $row['principaluri'],
327
-			'{DAV:}displayname' => $row['displayname'],
328
-			'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
329
-			'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
330
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
331
-		];
332
-
333
-		$this->addOwnerPrincipal($addressBook);
334
-
335
-		return $addressBook;
336
-	}
337
-
338
-	/**
339
-	 * Updates properties for an address book.
340
-	 *
341
-	 * The list of mutations is stored in a Sabre\DAV\PropPatch object.
342
-	 * To do the actual updates, you must tell this object which properties
343
-	 * you're going to process with the handle() method.
344
-	 *
345
-	 * Calling the handle method is like telling the PropPatch object "I
346
-	 * promise I can handle updating this property".
347
-	 *
348
-	 * Read the PropPatch documentation for more info and examples.
349
-	 *
350
-	 * @param string $addressBookId
351
-	 * @param \Sabre\DAV\PropPatch $propPatch
352
-	 * @return void
353
-	 */
354
-	function updateAddressBook($addressBookId, \Sabre\DAV\PropPatch $propPatch) {
355
-		$supportedProperties = [
356
-			'{DAV:}displayname',
357
-			'{' . Plugin::NS_CARDDAV . '}addressbook-description',
358
-		];
359
-
360
-		/**
361
-		 * @suppress SqlInjectionChecker
362
-		 */
363
-		$propPatch->handle($supportedProperties, function($mutations) use ($addressBookId) {
364
-
365
-			$updates = [];
366
-			foreach($mutations as $property=>$newValue) {
367
-
368
-				switch($property) {
369
-					case '{DAV:}displayname' :
370
-						$updates['displayname'] = $newValue;
371
-						break;
372
-					case '{' . Plugin::NS_CARDDAV . '}addressbook-description' :
373
-						$updates['description'] = $newValue;
374
-						break;
375
-				}
376
-			}
377
-			$query = $this->db->getQueryBuilder();
378
-			$query->update('addressbooks');
379
-
380
-			foreach($updates as $key=>$value) {
381
-				$query->set($key, $query->createNamedParameter($value));
382
-			}
383
-			$query->where($query->expr()->eq('id', $query->createNamedParameter($addressBookId)))
384
-			->execute();
385
-
386
-			$this->addChange($addressBookId, "", 2);
387
-
388
-			return true;
389
-
390
-		});
391
-	}
392
-
393
-	/**
394
-	 * Creates a new address book
395
-	 *
396
-	 * @param string $principalUri
397
-	 * @param string $url Just the 'basename' of the url.
398
-	 * @param array $properties
399
-	 * @return int
400
-	 * @throws BadRequest
401
-	 */
402
-	function createAddressBook($principalUri, $url, array $properties) {
403
-		$values = [
404
-			'displayname' => null,
405
-			'description' => null,
406
-			'principaluri' => $principalUri,
407
-			'uri' => $url,
408
-			'synctoken' => 1
409
-		];
410
-
411
-		foreach($properties as $property=>$newValue) {
412
-
413
-			switch($property) {
414
-				case '{DAV:}displayname' :
415
-					$values['displayname'] = $newValue;
416
-					break;
417
-				case '{' . Plugin::NS_CARDDAV . '}addressbook-description' :
418
-					$values['description'] = $newValue;
419
-					break;
420
-				default :
421
-					throw new BadRequest('Unknown property: ' . $property);
422
-			}
423
-
424
-		}
425
-
426
-		// Fallback to make sure the displayname is set. Some clients may refuse
427
-		// to work with addressbooks not having a displayname.
428
-		if(is_null($values['displayname'])) {
429
-			$values['displayname'] = $url;
430
-		}
431
-
432
-		$query = $this->db->getQueryBuilder();
433
-		$query->insert('addressbooks')
434
-			->values([
435
-				'uri' => $query->createParameter('uri'),
436
-				'displayname' => $query->createParameter('displayname'),
437
-				'description' => $query->createParameter('description'),
438
-				'principaluri' => $query->createParameter('principaluri'),
439
-				'synctoken' => $query->createParameter('synctoken'),
440
-			])
441
-			->setParameters($values)
442
-			->execute();
443
-
444
-		return $query->getLastInsertId();
445
-	}
446
-
447
-	/**
448
-	 * Deletes an entire addressbook and all its contents
449
-	 *
450
-	 * @param mixed $addressBookId
451
-	 * @return void
452
-	 */
453
-	function deleteAddressBook($addressBookId) {
454
-		$query = $this->db->getQueryBuilder();
455
-		$query->delete('cards')
456
-			->where($query->expr()->eq('addressbookid', $query->createParameter('addressbookid')))
457
-			->setParameter('addressbookid', $addressBookId)
458
-			->execute();
459
-
460
-		$query->delete('addressbookchanges')
461
-			->where($query->expr()->eq('addressbookid', $query->createParameter('addressbookid')))
462
-			->setParameter('addressbookid', $addressBookId)
463
-			->execute();
464
-
465
-		$query->delete('addressbooks')
466
-			->where($query->expr()->eq('id', $query->createParameter('id')))
467
-			->setParameter('id', $addressBookId)
468
-			->execute();
469
-
470
-		$this->sharingBackend->deleteAllShares($addressBookId);
471
-
472
-		$query->delete($this->dbCardsPropertiesTable)
473
-			->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
474
-			->execute();
475
-
476
-	}
477
-
478
-	/**
479
-	 * Returns all cards for a specific addressbook id.
480
-	 *
481
-	 * This method should return the following properties for each card:
482
-	 *   * carddata - raw vcard data
483
-	 *   * uri - Some unique url
484
-	 *   * lastmodified - A unix timestamp
485
-	 *
486
-	 * It's recommended to also return the following properties:
487
-	 *   * etag - A unique etag. This must change every time the card changes.
488
-	 *   * size - The size of the card in bytes.
489
-	 *
490
-	 * If these last two properties are provided, less time will be spent
491
-	 * calculating them. If they are specified, you can also ommit carddata.
492
-	 * This may speed up certain requests, especially with large cards.
493
-	 *
494
-	 * @param mixed $addressBookId
495
-	 * @return array
496
-	 */
497
-	function getCards($addressBookId) {
498
-		$query = $this->db->getQueryBuilder();
499
-		$query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
500
-			->from('cards')
501
-			->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
502
-
503
-		$cards = [];
504
-
505
-		$result = $query->execute();
506
-		while($row = $result->fetch()) {
507
-			$row['etag'] = '"' . $row['etag'] . '"';
508
-			$row['carddata'] = $this->readBlob($row['carddata']);
509
-			$cards[] = $row;
510
-		}
511
-		$result->closeCursor();
512
-
513
-		return $cards;
514
-	}
515
-
516
-	/**
517
-	 * Returns a specific card.
518
-	 *
519
-	 * The same set of properties must be returned as with getCards. The only
520
-	 * exception is that 'carddata' is absolutely required.
521
-	 *
522
-	 * If the card does not exist, you must return false.
523
-	 *
524
-	 * @param mixed $addressBookId
525
-	 * @param string $cardUri
526
-	 * @return array
527
-	 */
528
-	function getCard($addressBookId, $cardUri) {
529
-		$query = $this->db->getQueryBuilder();
530
-		$query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
531
-			->from('cards')
532
-			->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
533
-			->andWhere($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
534
-			->setMaxResults(1);
535
-
536
-		$result = $query->execute();
537
-		$row = $result->fetch();
538
-		if (!$row) {
539
-			return false;
540
-		}
541
-		$row['etag'] = '"' . $row['etag'] . '"';
542
-		$row['carddata'] = $this->readBlob($row['carddata']);
543
-
544
-		return $row;
545
-	}
546
-
547
-	/**
548
-	 * Returns a list of cards.
549
-	 *
550
-	 * This method should work identical to getCard, but instead return all the
551
-	 * cards in the list as an array.
552
-	 *
553
-	 * If the backend supports this, it may allow for some speed-ups.
554
-	 *
555
-	 * @param mixed $addressBookId
556
-	 * @param string[] $uris
557
-	 * @return array
558
-	 */
559
-	function getMultipleCards($addressBookId, array $uris) {
560
-		if (empty($uris)) {
561
-			return [];
562
-		}
563
-
564
-		$chunks = array_chunk($uris, 100);
565
-		$cards = [];
566
-
567
-		$query = $this->db->getQueryBuilder();
568
-		$query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
569
-			->from('cards')
570
-			->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
571
-			->andWhere($query->expr()->in('uri', $query->createParameter('uri')));
572
-
573
-		foreach ($chunks as $uris) {
574
-			$query->setParameter('uri', $uris, IQueryBuilder::PARAM_STR_ARRAY);
575
-			$result = $query->execute();
576
-
577
-			while ($row = $result->fetch()) {
578
-				$row['etag'] = '"' . $row['etag'] . '"';
579
-				$row['carddata'] = $this->readBlob($row['carddata']);
580
-				$cards[] = $row;
581
-			}
582
-			$result->closeCursor();
583
-		}
584
-		return $cards;
585
-	}
586
-
587
-	/**
588
-	 * Creates a new card.
589
-	 *
590
-	 * The addressbook id will be passed as the first argument. This is the
591
-	 * same id as it is returned from the getAddressBooksForUser method.
592
-	 *
593
-	 * The cardUri is a base uri, and doesn't include the full path. The
594
-	 * cardData argument is the vcard body, and is passed as a string.
595
-	 *
596
-	 * It is possible to return an ETag from this method. This ETag is for the
597
-	 * newly created resource, and must be enclosed with double quotes (that
598
-	 * is, the string itself must contain the double quotes).
599
-	 *
600
-	 * You should only return the ETag if you store the carddata as-is. If a
601
-	 * subsequent GET request on the same card does not have the same body,
602
-	 * byte-by-byte and you did return an ETag here, clients tend to get
603
-	 * confused.
604
-	 *
605
-	 * If you don't return an ETag, you can just return null.
606
-	 *
607
-	 * @param mixed $addressBookId
608
-	 * @param string $cardUri
609
-	 * @param string $cardData
610
-	 * @return string
611
-	 */
612
-	function createCard($addressBookId, $cardUri, $cardData) {
613
-		$etag = md5($cardData);
614
-		$uid = $this->getUID($cardData);
615
-
616
-		$q = $this->db->getQueryBuilder();
617
-		$q->select('uid')
618
-			->from('cards')
619
-			->where($q->expr()->eq('addressbookid', $q->createNamedParameter($addressBookId)))
620
-			->andWhere($q->expr()->eq('uid', $q->createNamedParameter($uid)))
621
-			->setMaxResults(1);
622
-		$result = $q->execute();
623
-		$count = (bool) $result->fetchColumn();
624
-		$result->closeCursor();
625
-		if ($count) {
626
-			throw new \Sabre\DAV\Exception\BadRequest('VCard object with uid already exists in this addressbook collection.');
627
-		}
628
-
629
-		$query = $this->db->getQueryBuilder();
630
-		$query->insert('cards')
631
-			->values([
632
-				'carddata' => $query->createNamedParameter($cardData, IQueryBuilder::PARAM_LOB),
633
-				'uri' => $query->createNamedParameter($cardUri),
634
-				'lastmodified' => $query->createNamedParameter(time()),
635
-				'addressbookid' => $query->createNamedParameter($addressBookId),
636
-				'size' => $query->createNamedParameter(strlen($cardData)),
637
-				'etag' => $query->createNamedParameter($etag),
638
-				'uid' => $query->createNamedParameter($uid),
639
-			])
640
-			->execute();
641
-
642
-		$this->addChange($addressBookId, $cardUri, 1);
643
-		$this->updateProperties($addressBookId, $cardUri, $cardData);
644
-
645
-		$this->dispatcher->dispatch('\OCA\DAV\CardDAV\CardDavBackend::createCard',
646
-			new GenericEvent(null, [
647
-				'addressBookId' => $addressBookId,
648
-				'cardUri' => $cardUri,
649
-				'cardData' => $cardData]));
650
-
651
-		return '"' . $etag . '"';
652
-	}
653
-
654
-	/**
655
-	 * Updates a card.
656
-	 *
657
-	 * The addressbook id will be passed as the first argument. This is the
658
-	 * same id as it is returned from the getAddressBooksForUser method.
659
-	 *
660
-	 * The cardUri is a base uri, and doesn't include the full path. The
661
-	 * cardData argument is the vcard body, and is passed as a string.
662
-	 *
663
-	 * It is possible to return an ETag from this method. This ETag should
664
-	 * match that of the updated resource, and must be enclosed with double
665
-	 * quotes (that is: the string itself must contain the actual quotes).
666
-	 *
667
-	 * You should only return the ETag if you store the carddata as-is. If a
668
-	 * subsequent GET request on the same card does not have the same body,
669
-	 * byte-by-byte and you did return an ETag here, clients tend to get
670
-	 * confused.
671
-	 *
672
-	 * If you don't return an ETag, you can just return null.
673
-	 *
674
-	 * @param mixed $addressBookId
675
-	 * @param string $cardUri
676
-	 * @param string $cardData
677
-	 * @return string
678
-	 */
679
-	function updateCard($addressBookId, $cardUri, $cardData) {
680
-
681
-		$uid = $this->getUID($cardData);
682
-		$etag = md5($cardData);
683
-		$query = $this->db->getQueryBuilder();
684
-		$query->update('cards')
685
-			->set('carddata', $query->createNamedParameter($cardData, IQueryBuilder::PARAM_LOB))
686
-			->set('lastmodified', $query->createNamedParameter(time()))
687
-			->set('size', $query->createNamedParameter(strlen($cardData)))
688
-			->set('etag', $query->createNamedParameter($etag))
689
-			->set('uid', $query->createNamedParameter($uid))
690
-			->where($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
691
-			->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
692
-			->execute();
693
-
694
-		$this->addChange($addressBookId, $cardUri, 2);
695
-		$this->updateProperties($addressBookId, $cardUri, $cardData);
696
-
697
-		$this->dispatcher->dispatch('\OCA\DAV\CardDAV\CardDavBackend::updateCard',
698
-			new GenericEvent(null, [
699
-				'addressBookId' => $addressBookId,
700
-				'cardUri' => $cardUri,
701
-				'cardData' => $cardData]));
702
-
703
-		return '"' . $etag . '"';
704
-	}
705
-
706
-	/**
707
-	 * Deletes a card
708
-	 *
709
-	 * @param mixed $addressBookId
710
-	 * @param string $cardUri
711
-	 * @return bool
712
-	 */
713
-	function deleteCard($addressBookId, $cardUri) {
714
-		try {
715
-			$cardId = $this->getCardId($addressBookId, $cardUri);
716
-		} catch (\InvalidArgumentException $e) {
717
-			$cardId = null;
718
-		}
719
-		$query = $this->db->getQueryBuilder();
720
-		$ret = $query->delete('cards')
721
-			->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
722
-			->andWhere($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
723
-			->execute();
724
-
725
-		$this->addChange($addressBookId, $cardUri, 3);
726
-
727
-		$this->dispatcher->dispatch('\OCA\DAV\CardDAV\CardDavBackend::deleteCard',
728
-			new GenericEvent(null, [
729
-				'addressBookId' => $addressBookId,
730
-				'cardUri' => $cardUri]));
731
-
732
-		if ($ret === 1) {
733
-			if ($cardId !== null) {
734
-				$this->purgeProperties($addressBookId, $cardId);
735
-			}
736
-			return true;
737
-		}
738
-
739
-		return false;
740
-	}
741
-
742
-	/**
743
-	 * The getChanges method returns all the changes that have happened, since
744
-	 * the specified syncToken in the specified address book.
745
-	 *
746
-	 * This function should return an array, such as the following:
747
-	 *
748
-	 * [
749
-	 *   'syncToken' => 'The current synctoken',
750
-	 *   'added'   => [
751
-	 *      'new.txt',
752
-	 *   ],
753
-	 *   'modified'   => [
754
-	 *      'modified.txt',
755
-	 *   ],
756
-	 *   'deleted' => [
757
-	 *      'foo.php.bak',
758
-	 *      'old.txt'
759
-	 *   ]
760
-	 * ];
761
-	 *
762
-	 * The returned syncToken property should reflect the *current* syncToken
763
-	 * of the calendar, as reported in the {http://sabredav.org/ns}sync-token
764
-	 * property. This is needed here too, to ensure the operation is atomic.
765
-	 *
766
-	 * If the $syncToken argument is specified as null, this is an initial
767
-	 * sync, and all members should be reported.
768
-	 *
769
-	 * The modified property is an array of nodenames that have changed since
770
-	 * the last token.
771
-	 *
772
-	 * The deleted property is an array with nodenames, that have been deleted
773
-	 * from collection.
774
-	 *
775
-	 * The $syncLevel argument is basically the 'depth' of the report. If it's
776
-	 * 1, you only have to report changes that happened only directly in
777
-	 * immediate descendants. If it's 2, it should also include changes from
778
-	 * the nodes below the child collections. (grandchildren)
779
-	 *
780
-	 * The $limit argument allows a client to specify how many results should
781
-	 * be returned at most. If the limit is not specified, it should be treated
782
-	 * as infinite.
783
-	 *
784
-	 * If the limit (infinite or not) is higher than you're willing to return,
785
-	 * you should throw a Sabre\DAV\Exception\TooMuchMatches() exception.
786
-	 *
787
-	 * If the syncToken is expired (due to data cleanup) or unknown, you must
788
-	 * return null.
789
-	 *
790
-	 * The limit is 'suggestive'. You are free to ignore it.
791
-	 *
792
-	 * @param string $addressBookId
793
-	 * @param string $syncToken
794
-	 * @param int $syncLevel
795
-	 * @param int $limit
796
-	 * @return array
797
-	 */
798
-	function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null) {
799
-		// Current synctoken
800
-		$stmt = $this->db->prepare('SELECT `synctoken` FROM `*PREFIX*addressbooks` WHERE `id` = ?');
801
-		$stmt->execute([ $addressBookId ]);
802
-		$currentToken = $stmt->fetchColumn(0);
803
-
804
-		if (is_null($currentToken)) return null;
805
-
806
-		$result = [
807
-			'syncToken' => $currentToken,
808
-			'added'     => [],
809
-			'modified'  => [],
810
-			'deleted'   => [],
811
-		];
812
-
813
-		if ($syncToken) {
814
-
815
-			$query = "SELECT `uri`, `operation` FROM `*PREFIX*addressbookchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `addressbookid` = ? ORDER BY `synctoken`";
816
-			if ($limit>0) {
817
-				$query .= " LIMIT " . (int)$limit;
818
-			}
819
-
820
-			// Fetching all changes
821
-			$stmt = $this->db->prepare($query);
822
-			$stmt->execute([$syncToken, $currentToken, $addressBookId]);
823
-
824
-			$changes = [];
825
-
826
-			// This loop ensures that any duplicates are overwritten, only the
827
-			// last change on a node is relevant.
828
-			while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
829
-
830
-				$changes[$row['uri']] = $row['operation'];
831
-
832
-			}
833
-
834
-			foreach($changes as $uri => $operation) {
835
-
836
-				switch($operation) {
837
-					case 1:
838
-						$result['added'][] = $uri;
839
-						break;
840
-					case 2:
841
-						$result['modified'][] = $uri;
842
-						break;
843
-					case 3:
844
-						$result['deleted'][] = $uri;
845
-						break;
846
-				}
847
-
848
-			}
849
-		} else {
850
-			// No synctoken supplied, this is the initial sync.
851
-			$query = "SELECT `uri` FROM `*PREFIX*cards` WHERE `addressbookid` = ?";
852
-			$stmt = $this->db->prepare($query);
853
-			$stmt->execute([$addressBookId]);
854
-
855
-			$result['added'] = $stmt->fetchAll(\PDO::FETCH_COLUMN);
856
-		}
857
-		return $result;
858
-	}
859
-
860
-	/**
861
-	 * Adds a change record to the addressbookchanges table.
862
-	 *
863
-	 * @param mixed $addressBookId
864
-	 * @param string $objectUri
865
-	 * @param int $operation 1 = add, 2 = modify, 3 = delete
866
-	 * @return void
867
-	 */
868
-	protected function addChange($addressBookId, $objectUri, $operation) {
869
-		$sql = 'INSERT INTO `*PREFIX*addressbookchanges`(`uri`, `synctoken`, `addressbookid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*addressbooks` WHERE `id` = ?';
870
-		$stmt = $this->db->prepare($sql);
871
-		$stmt->execute([
872
-			$objectUri,
873
-			$addressBookId,
874
-			$operation,
875
-			$addressBookId
876
-		]);
877
-		$stmt = $this->db->prepare('UPDATE `*PREFIX*addressbooks` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?');
878
-		$stmt->execute([
879
-			$addressBookId
880
-		]);
881
-	}
882
-
883
-	private function readBlob($cardData) {
884
-		if (is_resource($cardData)) {
885
-			return stream_get_contents($cardData);
886
-		}
887
-
888
-		return $cardData;
889
-	}
890
-
891
-	/**
892
-	 * @param IShareable $shareable
893
-	 * @param string[] $add
894
-	 * @param string[] $remove
895
-	 */
896
-	public function updateShares(IShareable $shareable, $add, $remove) {
897
-		$this->sharingBackend->updateShares($shareable, $add, $remove);
898
-	}
899
-
900
-	/**
901
-	 * search contact
902
-	 *
903
-	 * @param int $addressBookId
904
-	 * @param string $pattern which should match within the $searchProperties
905
-	 * @param array $searchProperties defines the properties within the query pattern should match
906
-	 * @return array an array of contacts which are arrays of key-value-pairs
907
-	 */
908
-	public function search($addressBookId, $pattern, $searchProperties) {
909
-		$query = $this->db->getQueryBuilder();
910
-		$query2 = $this->db->getQueryBuilder();
911
-
912
-		$query2->selectDistinct('cp.cardid')->from($this->dbCardsPropertiesTable, 'cp');
913
-		$query2->andWhere($query2->expr()->eq('cp.addressbookid', $query->createNamedParameter($addressBookId)));
914
-		$or = $query2->expr()->orX();
915
-		foreach ($searchProperties as $property) {
916
-			$or->add($query2->expr()->eq('cp.name', $query->createNamedParameter($property)));
917
-		}
918
-		$query2->andWhere($or);
919
-
920
-		// No need for like when the pattern is empty
921
-		if ('' !== $pattern) {
922
-			$query2->andWhere($query2->expr()->ilike('cp.value', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%')));
923
-		}
924
-
925
-		$query->select('c.carddata', 'c.uri')->from($this->dbCardsTable, 'c')
926
-			->where($query->expr()->in('c.id', $query->createFunction($query2->getSQL())));
927
-
928
-		$result = $query->execute();
929
-		$cards = $result->fetchAll();
930
-
931
-		$result->closeCursor();
932
-
933
-		return array_map(function($array) {
934
-			$array['carddata'] = $this->readBlob($array['carddata']);
935
-			return $array;
936
-		}, $cards);
937
-	}
938
-
939
-	/**
940
-	 * @param int $bookId
941
-	 * @param string $name
942
-	 * @return array
943
-	 */
944
-	public function collectCardProperties($bookId, $name) {
945
-		$query = $this->db->getQueryBuilder();
946
-		$result = $query->selectDistinct('value')
947
-			->from($this->dbCardsPropertiesTable)
948
-			->where($query->expr()->eq('name', $query->createNamedParameter($name)))
949
-			->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($bookId)))
950
-			->execute();
951
-
952
-		$all = $result->fetchAll(PDO::FETCH_COLUMN);
953
-		$result->closeCursor();
954
-
955
-		return $all;
956
-	}
957
-
958
-	/**
959
-	 * get URI from a given contact
960
-	 *
961
-	 * @param int $id
962
-	 * @return string
963
-	 */
964
-	public function getCardUri($id) {
965
-		$query = $this->db->getQueryBuilder();
966
-		$query->select('uri')->from($this->dbCardsTable)
967
-				->where($query->expr()->eq('id', $query->createParameter('id')))
968
-				->setParameter('id', $id);
969
-
970
-		$result = $query->execute();
971
-		$uri = $result->fetch();
972
-		$result->closeCursor();
973
-
974
-		if (!isset($uri['uri'])) {
975
-			throw new \InvalidArgumentException('Card does not exists: ' . $id);
976
-		}
977
-
978
-		return $uri['uri'];
979
-	}
980
-
981
-	/**
982
-	 * return contact with the given URI
983
-	 *
984
-	 * @param int $addressBookId
985
-	 * @param string $uri
986
-	 * @returns array
987
-	 */
988
-	public function getContact($addressBookId, $uri) {
989
-		$result = [];
990
-		$query = $this->db->getQueryBuilder();
991
-		$query->select('*')->from($this->dbCardsTable)
992
-				->where($query->expr()->eq('uri', $query->createNamedParameter($uri)))
993
-				->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
994
-		$queryResult = $query->execute();
995
-		$contact = $queryResult->fetch();
996
-		$queryResult->closeCursor();
997
-
998
-		if (is_array($contact)) {
999
-			$result = $contact;
1000
-		}
1001
-
1002
-		return $result;
1003
-	}
1004
-
1005
-	/**
1006
-	 * Returns the list of people whom this address book is shared with.
1007
-	 *
1008
-	 * Every element in this array should have the following properties:
1009
-	 *   * href - Often a mailto: address
1010
-	 *   * commonName - Optional, for example a first + last name
1011
-	 *   * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
1012
-	 *   * readOnly - boolean
1013
-	 *   * summary - Optional, a description for the share
1014
-	 *
1015
-	 * @return array
1016
-	 */
1017
-	public function getShares($addressBookId) {
1018
-		return $this->sharingBackend->getShares($addressBookId);
1019
-	}
1020
-
1021
-	/**
1022
-	 * update properties table
1023
-	 *
1024
-	 * @param int $addressBookId
1025
-	 * @param string $cardUri
1026
-	 * @param string $vCardSerialized
1027
-	 */
1028
-	protected function updateProperties($addressBookId, $cardUri, $vCardSerialized) {
1029
-		$cardId = $this->getCardId($addressBookId, $cardUri);
1030
-		$vCard = $this->readCard($vCardSerialized);
1031
-
1032
-		$this->purgeProperties($addressBookId, $cardId);
1033
-
1034
-		$query = $this->db->getQueryBuilder();
1035
-		$query->insert($this->dbCardsPropertiesTable)
1036
-			->values(
1037
-				[
1038
-					'addressbookid' => $query->createNamedParameter($addressBookId),
1039
-					'cardid' => $query->createNamedParameter($cardId),
1040
-					'name' => $query->createParameter('name'),
1041
-					'value' => $query->createParameter('value'),
1042
-					'preferred' => $query->createParameter('preferred')
1043
-				]
1044
-			);
1045
-
1046
-		foreach ($vCard->children() as $property) {
1047
-			if(!in_array($property->name, self::$indexProperties)) {
1048
-				continue;
1049
-			}
1050
-			$preferred = 0;
1051
-			foreach($property->parameters as $parameter) {
1052
-				if ($parameter->name === 'TYPE' && strtoupper($parameter->getValue()) === 'PREF') {
1053
-					$preferred = 1;
1054
-					break;
1055
-				}
1056
-			}
1057
-			$query->setParameter('name', $property->name);
1058
-			$query->setParameter('value', substr($property->getValue(), 0, 254));
1059
-			$query->setParameter('preferred', $preferred);
1060
-			$query->execute();
1061
-		}
1062
-	}
1063
-
1064
-	/**
1065
-	 * read vCard data into a vCard object
1066
-	 *
1067
-	 * @param string $cardData
1068
-	 * @return VCard
1069
-	 */
1070
-	protected function readCard($cardData) {
1071
-		return  Reader::read($cardData);
1072
-	}
1073
-
1074
-	/**
1075
-	 * delete all properties from a given card
1076
-	 *
1077
-	 * @param int $addressBookId
1078
-	 * @param int $cardId
1079
-	 */
1080
-	protected function purgeProperties($addressBookId, $cardId) {
1081
-		$query = $this->db->getQueryBuilder();
1082
-		$query->delete($this->dbCardsPropertiesTable)
1083
-			->where($query->expr()->eq('cardid', $query->createNamedParameter($cardId)))
1084
-			->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
1085
-		$query->execute();
1086
-	}
1087
-
1088
-	/**
1089
-	 * get ID from a given contact
1090
-	 *
1091
-	 * @param int $addressBookId
1092
-	 * @param string $uri
1093
-	 * @return int
1094
-	 */
1095
-	protected function getCardId($addressBookId, $uri) {
1096
-		$query = $this->db->getQueryBuilder();
1097
-		$query->select('id')->from($this->dbCardsTable)
1098
-			->where($query->expr()->eq('uri', $query->createNamedParameter($uri)))
1099
-			->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
1100
-
1101
-		$result = $query->execute();
1102
-		$cardIds = $result->fetch();
1103
-		$result->closeCursor();
1104
-
1105
-		if (!isset($cardIds['id'])) {
1106
-			throw new \InvalidArgumentException('Card does not exists: ' . $uri);
1107
-		}
1108
-
1109
-		return (int)$cardIds['id'];
1110
-	}
1111
-
1112
-	/**
1113
-	 * For shared address books the sharee is set in the ACL of the address book
1114
-	 * @param $addressBookId
1115
-	 * @param $acl
1116
-	 * @return array
1117
-	 */
1118
-	public function applyShareAcl($addressBookId, $acl) {
1119
-		return $this->sharingBackend->applyShareAcl($addressBookId, $acl);
1120
-	}
1121
-
1122
-	private function convertPrincipal($principalUri, $toV2) {
1123
-		if ($this->principalBackend->getPrincipalPrefix() === 'principals') {
1124
-			list(, $name) = \Sabre\Uri\split($principalUri);
1125
-			if ($toV2 === true) {
1126
-				return "principals/users/$name";
1127
-			}
1128
-			return "principals/$name";
1129
-		}
1130
-		return $principalUri;
1131
-	}
1132
-
1133
-	private function addOwnerPrincipal(&$addressbookInfo) {
1134
-		$ownerPrincipalKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal';
1135
-		$displaynameKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}owner-displayname';
1136
-		if (isset($addressbookInfo[$ownerPrincipalKey])) {
1137
-			$uri = $addressbookInfo[$ownerPrincipalKey];
1138
-		} else {
1139
-			$uri = $addressbookInfo['principaluri'];
1140
-		}
1141
-
1142
-		$principalInformation = $this->principalBackend->getPrincipalByPath($uri);
1143
-		if (isset($principalInformation['{DAV:}displayname'])) {
1144
-			$addressbookInfo[$displaynameKey] = $principalInformation['{DAV:}displayname'];
1145
-		}
1146
-	}
1147
-
1148
-	/**
1149
-	 * Extract UID from vcard
1150
-	 *
1151
-	 * @param string $cardData the vcard raw data
1152
-	 * @return string the uid
1153
-	 * @throws BadRequest if no UID is available
1154
-	 */
1155
-	private function getUID($cardData) {
1156
-		if ($cardData != '') {
1157
-			$vCard = Reader::read($cardData);
1158
-			if ($vCard->UID) {
1159
-				$uid = $vCard->UID->getValue();
1160
-				return $uid;
1161
-			}
1162
-			// should already be handled, but just in case
1163
-			throw new BadRequest('vCards on CardDAV servers MUST have a UID property');
1164
-		}
1165
-		// should already be handled, but just in case
1166
-		throw new BadRequest('vCard can not be empty');
1167
-	}
56
+    const PERSONAL_ADDRESSBOOK_URI = 'contacts';
57
+    const PERSONAL_ADDRESSBOOK_NAME = 'Contacts';
58
+
59
+    /** @var Principal */
60
+    private $principalBackend;
61
+
62
+    /** @var string */
63
+    private $dbCardsTable = 'cards';
64
+
65
+    /** @var string */
66
+    private $dbCardsPropertiesTable = 'cards_properties';
67
+
68
+    /** @var IDBConnection */
69
+    private $db;
70
+
71
+    /** @var Backend */
72
+    private $sharingBackend;
73
+
74
+    /** @var array properties to index */
75
+    public static $indexProperties = array(
76
+            'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME',
77
+            'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD');
78
+
79
+    /**
80
+     * @var string[] Map of uid => display name
81
+     */
82
+    protected $userDisplayNames;
83
+
84
+    /** @var IUserManager */
85
+    private $userManager;
86
+
87
+    /** @var EventDispatcherInterface */
88
+    private $dispatcher;
89
+
90
+    /**
91
+     * CardDavBackend constructor.
92
+     *
93
+     * @param IDBConnection $db
94
+     * @param Principal $principalBackend
95
+     * @param IUserManager $userManager
96
+     * @param IGroupManager $groupManager
97
+     * @param EventDispatcherInterface $dispatcher
98
+     */
99
+    public function __construct(IDBConnection $db,
100
+                                Principal $principalBackend,
101
+                                IUserManager $userManager,
102
+                                IGroupManager $groupManager,
103
+                                EventDispatcherInterface $dispatcher) {
104
+        $this->db = $db;
105
+        $this->principalBackend = $principalBackend;
106
+        $this->userManager = $userManager;
107
+        $this->dispatcher = $dispatcher;
108
+        $this->sharingBackend = new Backend($this->db, $this->userManager, $groupManager, $principalBackend, 'addressbook');
109
+    }
110
+
111
+    /**
112
+     * Return the number of address books for a principal
113
+     *
114
+     * @param $principalUri
115
+     * @return int
116
+     */
117
+    public function getAddressBooksForUserCount($principalUri) {
118
+        $principalUri = $this->convertPrincipal($principalUri, true);
119
+        $query = $this->db->getQueryBuilder();
120
+        $query->select($query->func()->count('*'))
121
+            ->from('addressbooks')
122
+            ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
123
+
124
+        return (int)$query->execute()->fetchColumn();
125
+    }
126
+
127
+    /**
128
+     * Returns the list of address books for a specific user.
129
+     *
130
+     * Every addressbook should have the following properties:
131
+     *   id - an arbitrary unique id
132
+     *   uri - the 'basename' part of the url
133
+     *   principaluri - Same as the passed parameter
134
+     *
135
+     * Any additional clark-notation property may be passed besides this. Some
136
+     * common ones are :
137
+     *   {DAV:}displayname
138
+     *   {urn:ietf:params:xml:ns:carddav}addressbook-description
139
+     *   {http://calendarserver.org/ns/}getctag
140
+     *
141
+     * @param string $principalUri
142
+     * @return array
143
+     */
144
+    function getAddressBooksForUser($principalUri) {
145
+        $principalUriOriginal = $principalUri;
146
+        $principalUri = $this->convertPrincipal($principalUri, true);
147
+        $query = $this->db->getQueryBuilder();
148
+        $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
149
+            ->from('addressbooks')
150
+            ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
151
+
152
+        $addressBooks = [];
153
+
154
+        $result = $query->execute();
155
+        while($row = $result->fetch()) {
156
+            $addressBooks[$row['id']] = [
157
+                'id'  => $row['id'],
158
+                'uri' => $row['uri'],
159
+                'principaluri' => $this->convertPrincipal($row['principaluri'], false),
160
+                '{DAV:}displayname' => $row['displayname'],
161
+                '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
162
+                '{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
163
+                '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
164
+            ];
165
+
166
+            $this->addOwnerPrincipal($addressBooks[$row['id']]);
167
+        }
168
+        $result->closeCursor();
169
+
170
+        // query for shared addressbooks
171
+        $principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true);
172
+        $principals = array_merge($principals, $this->principalBackend->getCircleMembership($principalUriOriginal));
173
+
174
+        $principals = array_map(function($principal) {
175
+            return urldecode($principal);
176
+        }, $principals);
177
+        $principals[]= $principalUri;
178
+
179
+        $query = $this->db->getQueryBuilder();
180
+        $result = $query->select(['a.id', 'a.uri', 'a.displayname', 'a.principaluri', 'a.description', 'a.synctoken', 's.access'])
181
+            ->from('dav_shares', 's')
182
+            ->join('s', 'addressbooks', 'a', $query->expr()->eq('s.resourceid', 'a.id'))
183
+            ->where($query->expr()->in('s.principaluri', $query->createParameter('principaluri')))
184
+            ->andWhere($query->expr()->eq('s.type', $query->createParameter('type')))
185
+            ->setParameter('type', 'addressbook')
186
+            ->setParameter('principaluri', $principals, IQueryBuilder::PARAM_STR_ARRAY)
187
+            ->execute();
188
+
189
+        $readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only';
190
+        while($row = $result->fetch()) {
191
+            if ($row['principaluri'] === $principalUri) {
192
+                continue;
193
+            }
194
+
195
+            $readOnly = (int) $row['access'] === Backend::ACCESS_READ;
196
+            if (isset($addressBooks[$row['id']])) {
197
+                if ($readOnly) {
198
+                    // New share can not have more permissions then the old one.
199
+                    continue;
200
+                }
201
+                if (isset($addressBooks[$row['id']][$readOnlyPropertyName]) &&
202
+                    $addressBooks[$row['id']][$readOnlyPropertyName] === 0) {
203
+                    // Old share is already read-write, no more permissions can be gained
204
+                    continue;
205
+                }
206
+            }
207
+
208
+            list(, $name) = \Sabre\Uri\split($row['principaluri']);
209
+            $uri = $row['uri'] . '_shared_by_' . $name;
210
+            $displayName = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')';
211
+
212
+            $addressBooks[$row['id']] = [
213
+                'id'  => $row['id'],
214
+                'uri' => $uri,
215
+                'principaluri' => $principalUriOriginal,
216
+                '{DAV:}displayname' => $displayName,
217
+                '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
218
+                '{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
219
+                '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
220
+                '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $row['principaluri'],
221
+                $readOnlyPropertyName => $readOnly,
222
+            ];
223
+
224
+            $this->addOwnerPrincipal($addressBooks[$row['id']]);
225
+        }
226
+        $result->closeCursor();
227
+
228
+        return array_values($addressBooks);
229
+    }
230
+
231
+    public function getUsersOwnAddressBooks($principalUri) {
232
+        $principalUri = $this->convertPrincipal($principalUri, true);
233
+        $query = $this->db->getQueryBuilder();
234
+        $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
235
+                ->from('addressbooks')
236
+                ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
237
+
238
+        $addressBooks = [];
239
+
240
+        $result = $query->execute();
241
+        while($row = $result->fetch()) {
242
+            $addressBooks[$row['id']] = [
243
+                'id'  => $row['id'],
244
+                'uri' => $row['uri'],
245
+                'principaluri' => $this->convertPrincipal($row['principaluri'], false),
246
+                '{DAV:}displayname' => $row['displayname'],
247
+                '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
248
+                '{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
249
+                '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
250
+            ];
251
+
252
+            $this->addOwnerPrincipal($addressBooks[$row['id']]);
253
+        }
254
+        $result->closeCursor();
255
+
256
+        return array_values($addressBooks);
257
+    }
258
+
259
+    private function getUserDisplayName($uid) {
260
+        if (!isset($this->userDisplayNames[$uid])) {
261
+            $user = $this->userManager->get($uid);
262
+
263
+            if ($user instanceof IUser) {
264
+                $this->userDisplayNames[$uid] = $user->getDisplayName();
265
+            } else {
266
+                $this->userDisplayNames[$uid] = $uid;
267
+            }
268
+        }
269
+
270
+        return $this->userDisplayNames[$uid];
271
+    }
272
+
273
+    /**
274
+     * @param int $addressBookId
275
+     */
276
+    public function getAddressBookById($addressBookId) {
277
+        $query = $this->db->getQueryBuilder();
278
+        $result = $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
279
+            ->from('addressbooks')
280
+            ->where($query->expr()->eq('id', $query->createNamedParameter($addressBookId)))
281
+            ->execute();
282
+
283
+        $row = $result->fetch();
284
+        $result->closeCursor();
285
+        if ($row === false) {
286
+            return null;
287
+        }
288
+
289
+        $addressBook = [
290
+            'id'  => $row['id'],
291
+            'uri' => $row['uri'],
292
+            'principaluri' => $row['principaluri'],
293
+            '{DAV:}displayname' => $row['displayname'],
294
+            '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
295
+            '{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
296
+            '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
297
+        ];
298
+
299
+        $this->addOwnerPrincipal($addressBook);
300
+
301
+        return $addressBook;
302
+    }
303
+
304
+    /**
305
+     * @param $addressBookUri
306
+     * @return array|null
307
+     */
308
+    public function getAddressBooksByUri($principal, $addressBookUri) {
309
+        $query = $this->db->getQueryBuilder();
310
+        $result = $query->select(['id', 'uri', 'displayname', 'principaluri', 'description', 'synctoken'])
311
+            ->from('addressbooks')
312
+            ->where($query->expr()->eq('uri', $query->createNamedParameter($addressBookUri)))
313
+            ->andWhere($query->expr()->eq('principaluri', $query->createNamedParameter($principal)))
314
+            ->setMaxResults(1)
315
+            ->execute();
316
+
317
+        $row = $result->fetch();
318
+        $result->closeCursor();
319
+        if ($row === false) {
320
+            return null;
321
+        }
322
+
323
+        $addressBook = [
324
+            'id'  => $row['id'],
325
+            'uri' => $row['uri'],
326
+            'principaluri' => $row['principaluri'],
327
+            '{DAV:}displayname' => $row['displayname'],
328
+            '{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
329
+            '{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
330
+            '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
331
+        ];
332
+
333
+        $this->addOwnerPrincipal($addressBook);
334
+
335
+        return $addressBook;
336
+    }
337
+
338
+    /**
339
+     * Updates properties for an address book.
340
+     *
341
+     * The list of mutations is stored in a Sabre\DAV\PropPatch object.
342
+     * To do the actual updates, you must tell this object which properties
343
+     * you're going to process with the handle() method.
344
+     *
345
+     * Calling the handle method is like telling the PropPatch object "I
346
+     * promise I can handle updating this property".
347
+     *
348
+     * Read the PropPatch documentation for more info and examples.
349
+     *
350
+     * @param string $addressBookId
351
+     * @param \Sabre\DAV\PropPatch $propPatch
352
+     * @return void
353
+     */
354
+    function updateAddressBook($addressBookId, \Sabre\DAV\PropPatch $propPatch) {
355
+        $supportedProperties = [
356
+            '{DAV:}displayname',
357
+            '{' . Plugin::NS_CARDDAV . '}addressbook-description',
358
+        ];
359
+
360
+        /**
361
+         * @suppress SqlInjectionChecker
362
+         */
363
+        $propPatch->handle($supportedProperties, function($mutations) use ($addressBookId) {
364
+
365
+            $updates = [];
366
+            foreach($mutations as $property=>$newValue) {
367
+
368
+                switch($property) {
369
+                    case '{DAV:}displayname' :
370
+                        $updates['displayname'] = $newValue;
371
+                        break;
372
+                    case '{' . Plugin::NS_CARDDAV . '}addressbook-description' :
373
+                        $updates['description'] = $newValue;
374
+                        break;
375
+                }
376
+            }
377
+            $query = $this->db->getQueryBuilder();
378
+            $query->update('addressbooks');
379
+
380
+            foreach($updates as $key=>$value) {
381
+                $query->set($key, $query->createNamedParameter($value));
382
+            }
383
+            $query->where($query->expr()->eq('id', $query->createNamedParameter($addressBookId)))
384
+            ->execute();
385
+
386
+            $this->addChange($addressBookId, "", 2);
387
+
388
+            return true;
389
+
390
+        });
391
+    }
392
+
393
+    /**
394
+     * Creates a new address book
395
+     *
396
+     * @param string $principalUri
397
+     * @param string $url Just the 'basename' of the url.
398
+     * @param array $properties
399
+     * @return int
400
+     * @throws BadRequest
401
+     */
402
+    function createAddressBook($principalUri, $url, array $properties) {
403
+        $values = [
404
+            'displayname' => null,
405
+            'description' => null,
406
+            'principaluri' => $principalUri,
407
+            'uri' => $url,
408
+            'synctoken' => 1
409
+        ];
410
+
411
+        foreach($properties as $property=>$newValue) {
412
+
413
+            switch($property) {
414
+                case '{DAV:}displayname' :
415
+                    $values['displayname'] = $newValue;
416
+                    break;
417
+                case '{' . Plugin::NS_CARDDAV . '}addressbook-description' :
418
+                    $values['description'] = $newValue;
419
+                    break;
420
+                default :
421
+                    throw new BadRequest('Unknown property: ' . $property);
422
+            }
423
+
424
+        }
425
+
426
+        // Fallback to make sure the displayname is set. Some clients may refuse
427
+        // to work with addressbooks not having a displayname.
428
+        if(is_null($values['displayname'])) {
429
+            $values['displayname'] = $url;
430
+        }
431
+
432
+        $query = $this->db->getQueryBuilder();
433
+        $query->insert('addressbooks')
434
+            ->values([
435
+                'uri' => $query->createParameter('uri'),
436
+                'displayname' => $query->createParameter('displayname'),
437
+                'description' => $query->createParameter('description'),
438
+                'principaluri' => $query->createParameter('principaluri'),
439
+                'synctoken' => $query->createParameter('synctoken'),
440
+            ])
441
+            ->setParameters($values)
442
+            ->execute();
443
+
444
+        return $query->getLastInsertId();
445
+    }
446
+
447
+    /**
448
+     * Deletes an entire addressbook and all its contents
449
+     *
450
+     * @param mixed $addressBookId
451
+     * @return void
452
+     */
453
+    function deleteAddressBook($addressBookId) {
454
+        $query = $this->db->getQueryBuilder();
455
+        $query->delete('cards')
456
+            ->where($query->expr()->eq('addressbookid', $query->createParameter('addressbookid')))
457
+            ->setParameter('addressbookid', $addressBookId)
458
+            ->execute();
459
+
460
+        $query->delete('addressbookchanges')
461
+            ->where($query->expr()->eq('addressbookid', $query->createParameter('addressbookid')))
462
+            ->setParameter('addressbookid', $addressBookId)
463
+            ->execute();
464
+
465
+        $query->delete('addressbooks')
466
+            ->where($query->expr()->eq('id', $query->createParameter('id')))
467
+            ->setParameter('id', $addressBookId)
468
+            ->execute();
469
+
470
+        $this->sharingBackend->deleteAllShares($addressBookId);
471
+
472
+        $query->delete($this->dbCardsPropertiesTable)
473
+            ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
474
+            ->execute();
475
+
476
+    }
477
+
478
+    /**
479
+     * Returns all cards for a specific addressbook id.
480
+     *
481
+     * This method should return the following properties for each card:
482
+     *   * carddata - raw vcard data
483
+     *   * uri - Some unique url
484
+     *   * lastmodified - A unix timestamp
485
+     *
486
+     * It's recommended to also return the following properties:
487
+     *   * etag - A unique etag. This must change every time the card changes.
488
+     *   * size - The size of the card in bytes.
489
+     *
490
+     * If these last two properties are provided, less time will be spent
491
+     * calculating them. If they are specified, you can also ommit carddata.
492
+     * This may speed up certain requests, especially with large cards.
493
+     *
494
+     * @param mixed $addressBookId
495
+     * @return array
496
+     */
497
+    function getCards($addressBookId) {
498
+        $query = $this->db->getQueryBuilder();
499
+        $query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
500
+            ->from('cards')
501
+            ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
502
+
503
+        $cards = [];
504
+
505
+        $result = $query->execute();
506
+        while($row = $result->fetch()) {
507
+            $row['etag'] = '"' . $row['etag'] . '"';
508
+            $row['carddata'] = $this->readBlob($row['carddata']);
509
+            $cards[] = $row;
510
+        }
511
+        $result->closeCursor();
512
+
513
+        return $cards;
514
+    }
515
+
516
+    /**
517
+     * Returns a specific card.
518
+     *
519
+     * The same set of properties must be returned as with getCards. The only
520
+     * exception is that 'carddata' is absolutely required.
521
+     *
522
+     * If the card does not exist, you must return false.
523
+     *
524
+     * @param mixed $addressBookId
525
+     * @param string $cardUri
526
+     * @return array
527
+     */
528
+    function getCard($addressBookId, $cardUri) {
529
+        $query = $this->db->getQueryBuilder();
530
+        $query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
531
+            ->from('cards')
532
+            ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
533
+            ->andWhere($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
534
+            ->setMaxResults(1);
535
+
536
+        $result = $query->execute();
537
+        $row = $result->fetch();
538
+        if (!$row) {
539
+            return false;
540
+        }
541
+        $row['etag'] = '"' . $row['etag'] . '"';
542
+        $row['carddata'] = $this->readBlob($row['carddata']);
543
+
544
+        return $row;
545
+    }
546
+
547
+    /**
548
+     * Returns a list of cards.
549
+     *
550
+     * This method should work identical to getCard, but instead return all the
551
+     * cards in the list as an array.
552
+     *
553
+     * If the backend supports this, it may allow for some speed-ups.
554
+     *
555
+     * @param mixed $addressBookId
556
+     * @param string[] $uris
557
+     * @return array
558
+     */
559
+    function getMultipleCards($addressBookId, array $uris) {
560
+        if (empty($uris)) {
561
+            return [];
562
+        }
563
+
564
+        $chunks = array_chunk($uris, 100);
565
+        $cards = [];
566
+
567
+        $query = $this->db->getQueryBuilder();
568
+        $query->select(['id', 'uri', 'lastmodified', 'etag', 'size', 'carddata', 'uid'])
569
+            ->from('cards')
570
+            ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
571
+            ->andWhere($query->expr()->in('uri', $query->createParameter('uri')));
572
+
573
+        foreach ($chunks as $uris) {
574
+            $query->setParameter('uri', $uris, IQueryBuilder::PARAM_STR_ARRAY);
575
+            $result = $query->execute();
576
+
577
+            while ($row = $result->fetch()) {
578
+                $row['etag'] = '"' . $row['etag'] . '"';
579
+                $row['carddata'] = $this->readBlob($row['carddata']);
580
+                $cards[] = $row;
581
+            }
582
+            $result->closeCursor();
583
+        }
584
+        return $cards;
585
+    }
586
+
587
+    /**
588
+     * Creates a new card.
589
+     *
590
+     * The addressbook id will be passed as the first argument. This is the
591
+     * same id as it is returned from the getAddressBooksForUser method.
592
+     *
593
+     * The cardUri is a base uri, and doesn't include the full path. The
594
+     * cardData argument is the vcard body, and is passed as a string.
595
+     *
596
+     * It is possible to return an ETag from this method. This ETag is for the
597
+     * newly created resource, and must be enclosed with double quotes (that
598
+     * is, the string itself must contain the double quotes).
599
+     *
600
+     * You should only return the ETag if you store the carddata as-is. If a
601
+     * subsequent GET request on the same card does not have the same body,
602
+     * byte-by-byte and you did return an ETag here, clients tend to get
603
+     * confused.
604
+     *
605
+     * If you don't return an ETag, you can just return null.
606
+     *
607
+     * @param mixed $addressBookId
608
+     * @param string $cardUri
609
+     * @param string $cardData
610
+     * @return string
611
+     */
612
+    function createCard($addressBookId, $cardUri, $cardData) {
613
+        $etag = md5($cardData);
614
+        $uid = $this->getUID($cardData);
615
+
616
+        $q = $this->db->getQueryBuilder();
617
+        $q->select('uid')
618
+            ->from('cards')
619
+            ->where($q->expr()->eq('addressbookid', $q->createNamedParameter($addressBookId)))
620
+            ->andWhere($q->expr()->eq('uid', $q->createNamedParameter($uid)))
621
+            ->setMaxResults(1);
622
+        $result = $q->execute();
623
+        $count = (bool) $result->fetchColumn();
624
+        $result->closeCursor();
625
+        if ($count) {
626
+            throw new \Sabre\DAV\Exception\BadRequest('VCard object with uid already exists in this addressbook collection.');
627
+        }
628
+
629
+        $query = $this->db->getQueryBuilder();
630
+        $query->insert('cards')
631
+            ->values([
632
+                'carddata' => $query->createNamedParameter($cardData, IQueryBuilder::PARAM_LOB),
633
+                'uri' => $query->createNamedParameter($cardUri),
634
+                'lastmodified' => $query->createNamedParameter(time()),
635
+                'addressbookid' => $query->createNamedParameter($addressBookId),
636
+                'size' => $query->createNamedParameter(strlen($cardData)),
637
+                'etag' => $query->createNamedParameter($etag),
638
+                'uid' => $query->createNamedParameter($uid),
639
+            ])
640
+            ->execute();
641
+
642
+        $this->addChange($addressBookId, $cardUri, 1);
643
+        $this->updateProperties($addressBookId, $cardUri, $cardData);
644
+
645
+        $this->dispatcher->dispatch('\OCA\DAV\CardDAV\CardDavBackend::createCard',
646
+            new GenericEvent(null, [
647
+                'addressBookId' => $addressBookId,
648
+                'cardUri' => $cardUri,
649
+                'cardData' => $cardData]));
650
+
651
+        return '"' . $etag . '"';
652
+    }
653
+
654
+    /**
655
+     * Updates a card.
656
+     *
657
+     * The addressbook id will be passed as the first argument. This is the
658
+     * same id as it is returned from the getAddressBooksForUser method.
659
+     *
660
+     * The cardUri is a base uri, and doesn't include the full path. The
661
+     * cardData argument is the vcard body, and is passed as a string.
662
+     *
663
+     * It is possible to return an ETag from this method. This ETag should
664
+     * match that of the updated resource, and must be enclosed with double
665
+     * quotes (that is: the string itself must contain the actual quotes).
666
+     *
667
+     * You should only return the ETag if you store the carddata as-is. If a
668
+     * subsequent GET request on the same card does not have the same body,
669
+     * byte-by-byte and you did return an ETag here, clients tend to get
670
+     * confused.
671
+     *
672
+     * If you don't return an ETag, you can just return null.
673
+     *
674
+     * @param mixed $addressBookId
675
+     * @param string $cardUri
676
+     * @param string $cardData
677
+     * @return string
678
+     */
679
+    function updateCard($addressBookId, $cardUri, $cardData) {
680
+
681
+        $uid = $this->getUID($cardData);
682
+        $etag = md5($cardData);
683
+        $query = $this->db->getQueryBuilder();
684
+        $query->update('cards')
685
+            ->set('carddata', $query->createNamedParameter($cardData, IQueryBuilder::PARAM_LOB))
686
+            ->set('lastmodified', $query->createNamedParameter(time()))
687
+            ->set('size', $query->createNamedParameter(strlen($cardData)))
688
+            ->set('etag', $query->createNamedParameter($etag))
689
+            ->set('uid', $query->createNamedParameter($uid))
690
+            ->where($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
691
+            ->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
692
+            ->execute();
693
+
694
+        $this->addChange($addressBookId, $cardUri, 2);
695
+        $this->updateProperties($addressBookId, $cardUri, $cardData);
696
+
697
+        $this->dispatcher->dispatch('\OCA\DAV\CardDAV\CardDavBackend::updateCard',
698
+            new GenericEvent(null, [
699
+                'addressBookId' => $addressBookId,
700
+                'cardUri' => $cardUri,
701
+                'cardData' => $cardData]));
702
+
703
+        return '"' . $etag . '"';
704
+    }
705
+
706
+    /**
707
+     * Deletes a card
708
+     *
709
+     * @param mixed $addressBookId
710
+     * @param string $cardUri
711
+     * @return bool
712
+     */
713
+    function deleteCard($addressBookId, $cardUri) {
714
+        try {
715
+            $cardId = $this->getCardId($addressBookId, $cardUri);
716
+        } catch (\InvalidArgumentException $e) {
717
+            $cardId = null;
718
+        }
719
+        $query = $this->db->getQueryBuilder();
720
+        $ret = $query->delete('cards')
721
+            ->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
722
+            ->andWhere($query->expr()->eq('uri', $query->createNamedParameter($cardUri)))
723
+            ->execute();
724
+
725
+        $this->addChange($addressBookId, $cardUri, 3);
726
+
727
+        $this->dispatcher->dispatch('\OCA\DAV\CardDAV\CardDavBackend::deleteCard',
728
+            new GenericEvent(null, [
729
+                'addressBookId' => $addressBookId,
730
+                'cardUri' => $cardUri]));
731
+
732
+        if ($ret === 1) {
733
+            if ($cardId !== null) {
734
+                $this->purgeProperties($addressBookId, $cardId);
735
+            }
736
+            return true;
737
+        }
738
+
739
+        return false;
740
+    }
741
+
742
+    /**
743
+     * The getChanges method returns all the changes that have happened, since
744
+     * the specified syncToken in the specified address book.
745
+     *
746
+     * This function should return an array, such as the following:
747
+     *
748
+     * [
749
+     *   'syncToken' => 'The current synctoken',
750
+     *   'added'   => [
751
+     *      'new.txt',
752
+     *   ],
753
+     *   'modified'   => [
754
+     *      'modified.txt',
755
+     *   ],
756
+     *   'deleted' => [
757
+     *      'foo.php.bak',
758
+     *      'old.txt'
759
+     *   ]
760
+     * ];
761
+     *
762
+     * The returned syncToken property should reflect the *current* syncToken
763
+     * of the calendar, as reported in the {http://sabredav.org/ns}sync-token
764
+     * property. This is needed here too, to ensure the operation is atomic.
765
+     *
766
+     * If the $syncToken argument is specified as null, this is an initial
767
+     * sync, and all members should be reported.
768
+     *
769
+     * The modified property is an array of nodenames that have changed since
770
+     * the last token.
771
+     *
772
+     * The deleted property is an array with nodenames, that have been deleted
773
+     * from collection.
774
+     *
775
+     * The $syncLevel argument is basically the 'depth' of the report. If it's
776
+     * 1, you only have to report changes that happened only directly in
777
+     * immediate descendants. If it's 2, it should also include changes from
778
+     * the nodes below the child collections. (grandchildren)
779
+     *
780
+     * The $limit argument allows a client to specify how many results should
781
+     * be returned at most. If the limit is not specified, it should be treated
782
+     * as infinite.
783
+     *
784
+     * If the limit (infinite or not) is higher than you're willing to return,
785
+     * you should throw a Sabre\DAV\Exception\TooMuchMatches() exception.
786
+     *
787
+     * If the syncToken is expired (due to data cleanup) or unknown, you must
788
+     * return null.
789
+     *
790
+     * The limit is 'suggestive'. You are free to ignore it.
791
+     *
792
+     * @param string $addressBookId
793
+     * @param string $syncToken
794
+     * @param int $syncLevel
795
+     * @param int $limit
796
+     * @return array
797
+     */
798
+    function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null) {
799
+        // Current synctoken
800
+        $stmt = $this->db->prepare('SELECT `synctoken` FROM `*PREFIX*addressbooks` WHERE `id` = ?');
801
+        $stmt->execute([ $addressBookId ]);
802
+        $currentToken = $stmt->fetchColumn(0);
803
+
804
+        if (is_null($currentToken)) return null;
805
+
806
+        $result = [
807
+            'syncToken' => $currentToken,
808
+            'added'     => [],
809
+            'modified'  => [],
810
+            'deleted'   => [],
811
+        ];
812
+
813
+        if ($syncToken) {
814
+
815
+            $query = "SELECT `uri`, `operation` FROM `*PREFIX*addressbookchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `addressbookid` = ? ORDER BY `synctoken`";
816
+            if ($limit>0) {
817
+                $query .= " LIMIT " . (int)$limit;
818
+            }
819
+
820
+            // Fetching all changes
821
+            $stmt = $this->db->prepare($query);
822
+            $stmt->execute([$syncToken, $currentToken, $addressBookId]);
823
+
824
+            $changes = [];
825
+
826
+            // This loop ensures that any duplicates are overwritten, only the
827
+            // last change on a node is relevant.
828
+            while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
829
+
830
+                $changes[$row['uri']] = $row['operation'];
831
+
832
+            }
833
+
834
+            foreach($changes as $uri => $operation) {
835
+
836
+                switch($operation) {
837
+                    case 1:
838
+                        $result['added'][] = $uri;
839
+                        break;
840
+                    case 2:
841
+                        $result['modified'][] = $uri;
842
+                        break;
843
+                    case 3:
844
+                        $result['deleted'][] = $uri;
845
+                        break;
846
+                }
847
+
848
+            }
849
+        } else {
850
+            // No synctoken supplied, this is the initial sync.
851
+            $query = "SELECT `uri` FROM `*PREFIX*cards` WHERE `addressbookid` = ?";
852
+            $stmt = $this->db->prepare($query);
853
+            $stmt->execute([$addressBookId]);
854
+
855
+            $result['added'] = $stmt->fetchAll(\PDO::FETCH_COLUMN);
856
+        }
857
+        return $result;
858
+    }
859
+
860
+    /**
861
+     * Adds a change record to the addressbookchanges table.
862
+     *
863
+     * @param mixed $addressBookId
864
+     * @param string $objectUri
865
+     * @param int $operation 1 = add, 2 = modify, 3 = delete
866
+     * @return void
867
+     */
868
+    protected function addChange($addressBookId, $objectUri, $operation) {
869
+        $sql = 'INSERT INTO `*PREFIX*addressbookchanges`(`uri`, `synctoken`, `addressbookid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*addressbooks` WHERE `id` = ?';
870
+        $stmt = $this->db->prepare($sql);
871
+        $stmt->execute([
872
+            $objectUri,
873
+            $addressBookId,
874
+            $operation,
875
+            $addressBookId
876
+        ]);
877
+        $stmt = $this->db->prepare('UPDATE `*PREFIX*addressbooks` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?');
878
+        $stmt->execute([
879
+            $addressBookId
880
+        ]);
881
+    }
882
+
883
+    private function readBlob($cardData) {
884
+        if (is_resource($cardData)) {
885
+            return stream_get_contents($cardData);
886
+        }
887
+
888
+        return $cardData;
889
+    }
890
+
891
+    /**
892
+     * @param IShareable $shareable
893
+     * @param string[] $add
894
+     * @param string[] $remove
895
+     */
896
+    public function updateShares(IShareable $shareable, $add, $remove) {
897
+        $this->sharingBackend->updateShares($shareable, $add, $remove);
898
+    }
899
+
900
+    /**
901
+     * search contact
902
+     *
903
+     * @param int $addressBookId
904
+     * @param string $pattern which should match within the $searchProperties
905
+     * @param array $searchProperties defines the properties within the query pattern should match
906
+     * @return array an array of contacts which are arrays of key-value-pairs
907
+     */
908
+    public function search($addressBookId, $pattern, $searchProperties) {
909
+        $query = $this->db->getQueryBuilder();
910
+        $query2 = $this->db->getQueryBuilder();
911
+
912
+        $query2->selectDistinct('cp.cardid')->from($this->dbCardsPropertiesTable, 'cp');
913
+        $query2->andWhere($query2->expr()->eq('cp.addressbookid', $query->createNamedParameter($addressBookId)));
914
+        $or = $query2->expr()->orX();
915
+        foreach ($searchProperties as $property) {
916
+            $or->add($query2->expr()->eq('cp.name', $query->createNamedParameter($property)));
917
+        }
918
+        $query2->andWhere($or);
919
+
920
+        // No need for like when the pattern is empty
921
+        if ('' !== $pattern) {
922
+            $query2->andWhere($query2->expr()->ilike('cp.value', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%')));
923
+        }
924
+
925
+        $query->select('c.carddata', 'c.uri')->from($this->dbCardsTable, 'c')
926
+            ->where($query->expr()->in('c.id', $query->createFunction($query2->getSQL())));
927
+
928
+        $result = $query->execute();
929
+        $cards = $result->fetchAll();
930
+
931
+        $result->closeCursor();
932
+
933
+        return array_map(function($array) {
934
+            $array['carddata'] = $this->readBlob($array['carddata']);
935
+            return $array;
936
+        }, $cards);
937
+    }
938
+
939
+    /**
940
+     * @param int $bookId
941
+     * @param string $name
942
+     * @return array
943
+     */
944
+    public function collectCardProperties($bookId, $name) {
945
+        $query = $this->db->getQueryBuilder();
946
+        $result = $query->selectDistinct('value')
947
+            ->from($this->dbCardsPropertiesTable)
948
+            ->where($query->expr()->eq('name', $query->createNamedParameter($name)))
949
+            ->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($bookId)))
950
+            ->execute();
951
+
952
+        $all = $result->fetchAll(PDO::FETCH_COLUMN);
953
+        $result->closeCursor();
954
+
955
+        return $all;
956
+    }
957
+
958
+    /**
959
+     * get URI from a given contact
960
+     *
961
+     * @param int $id
962
+     * @return string
963
+     */
964
+    public function getCardUri($id) {
965
+        $query = $this->db->getQueryBuilder();
966
+        $query->select('uri')->from($this->dbCardsTable)
967
+                ->where($query->expr()->eq('id', $query->createParameter('id')))
968
+                ->setParameter('id', $id);
969
+
970
+        $result = $query->execute();
971
+        $uri = $result->fetch();
972
+        $result->closeCursor();
973
+
974
+        if (!isset($uri['uri'])) {
975
+            throw new \InvalidArgumentException('Card does not exists: ' . $id);
976
+        }
977
+
978
+        return $uri['uri'];
979
+    }
980
+
981
+    /**
982
+     * return contact with the given URI
983
+     *
984
+     * @param int $addressBookId
985
+     * @param string $uri
986
+     * @returns array
987
+     */
988
+    public function getContact($addressBookId, $uri) {
989
+        $result = [];
990
+        $query = $this->db->getQueryBuilder();
991
+        $query->select('*')->from($this->dbCardsTable)
992
+                ->where($query->expr()->eq('uri', $query->createNamedParameter($uri)))
993
+                ->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
994
+        $queryResult = $query->execute();
995
+        $contact = $queryResult->fetch();
996
+        $queryResult->closeCursor();
997
+
998
+        if (is_array($contact)) {
999
+            $result = $contact;
1000
+        }
1001
+
1002
+        return $result;
1003
+    }
1004
+
1005
+    /**
1006
+     * Returns the list of people whom this address book is shared with.
1007
+     *
1008
+     * Every element in this array should have the following properties:
1009
+     *   * href - Often a mailto: address
1010
+     *   * commonName - Optional, for example a first + last name
1011
+     *   * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
1012
+     *   * readOnly - boolean
1013
+     *   * summary - Optional, a description for the share
1014
+     *
1015
+     * @return array
1016
+     */
1017
+    public function getShares($addressBookId) {
1018
+        return $this->sharingBackend->getShares($addressBookId);
1019
+    }
1020
+
1021
+    /**
1022
+     * update properties table
1023
+     *
1024
+     * @param int $addressBookId
1025
+     * @param string $cardUri
1026
+     * @param string $vCardSerialized
1027
+     */
1028
+    protected function updateProperties($addressBookId, $cardUri, $vCardSerialized) {
1029
+        $cardId = $this->getCardId($addressBookId, $cardUri);
1030
+        $vCard = $this->readCard($vCardSerialized);
1031
+
1032
+        $this->purgeProperties($addressBookId, $cardId);
1033
+
1034
+        $query = $this->db->getQueryBuilder();
1035
+        $query->insert($this->dbCardsPropertiesTable)
1036
+            ->values(
1037
+                [
1038
+                    'addressbookid' => $query->createNamedParameter($addressBookId),
1039
+                    'cardid' => $query->createNamedParameter($cardId),
1040
+                    'name' => $query->createParameter('name'),
1041
+                    'value' => $query->createParameter('value'),
1042
+                    'preferred' => $query->createParameter('preferred')
1043
+                ]
1044
+            );
1045
+
1046
+        foreach ($vCard->children() as $property) {
1047
+            if(!in_array($property->name, self::$indexProperties)) {
1048
+                continue;
1049
+            }
1050
+            $preferred = 0;
1051
+            foreach($property->parameters as $parameter) {
1052
+                if ($parameter->name === 'TYPE' && strtoupper($parameter->getValue()) === 'PREF') {
1053
+                    $preferred = 1;
1054
+                    break;
1055
+                }
1056
+            }
1057
+            $query->setParameter('name', $property->name);
1058
+            $query->setParameter('value', substr($property->getValue(), 0, 254));
1059
+            $query->setParameter('preferred', $preferred);
1060
+            $query->execute();
1061
+        }
1062
+    }
1063
+
1064
+    /**
1065
+     * read vCard data into a vCard object
1066
+     *
1067
+     * @param string $cardData
1068
+     * @return VCard
1069
+     */
1070
+    protected function readCard($cardData) {
1071
+        return  Reader::read($cardData);
1072
+    }
1073
+
1074
+    /**
1075
+     * delete all properties from a given card
1076
+     *
1077
+     * @param int $addressBookId
1078
+     * @param int $cardId
1079
+     */
1080
+    protected function purgeProperties($addressBookId, $cardId) {
1081
+        $query = $this->db->getQueryBuilder();
1082
+        $query->delete($this->dbCardsPropertiesTable)
1083
+            ->where($query->expr()->eq('cardid', $query->createNamedParameter($cardId)))
1084
+            ->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
1085
+        $query->execute();
1086
+    }
1087
+
1088
+    /**
1089
+     * get ID from a given contact
1090
+     *
1091
+     * @param int $addressBookId
1092
+     * @param string $uri
1093
+     * @return int
1094
+     */
1095
+    protected function getCardId($addressBookId, $uri) {
1096
+        $query = $this->db->getQueryBuilder();
1097
+        $query->select('id')->from($this->dbCardsTable)
1098
+            ->where($query->expr()->eq('uri', $query->createNamedParameter($uri)))
1099
+            ->andWhere($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)));
1100
+
1101
+        $result = $query->execute();
1102
+        $cardIds = $result->fetch();
1103
+        $result->closeCursor();
1104
+
1105
+        if (!isset($cardIds['id'])) {
1106
+            throw new \InvalidArgumentException('Card does not exists: ' . $uri);
1107
+        }
1108
+
1109
+        return (int)$cardIds['id'];
1110
+    }
1111
+
1112
+    /**
1113
+     * For shared address books the sharee is set in the ACL of the address book
1114
+     * @param $addressBookId
1115
+     * @param $acl
1116
+     * @return array
1117
+     */
1118
+    public function applyShareAcl($addressBookId, $acl) {
1119
+        return $this->sharingBackend->applyShareAcl($addressBookId, $acl);
1120
+    }
1121
+
1122
+    private function convertPrincipal($principalUri, $toV2) {
1123
+        if ($this->principalBackend->getPrincipalPrefix() === 'principals') {
1124
+            list(, $name) = \Sabre\Uri\split($principalUri);
1125
+            if ($toV2 === true) {
1126
+                return "principals/users/$name";
1127
+            }
1128
+            return "principals/$name";
1129
+        }
1130
+        return $principalUri;
1131
+    }
1132
+
1133
+    private function addOwnerPrincipal(&$addressbookInfo) {
1134
+        $ownerPrincipalKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal';
1135
+        $displaynameKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}owner-displayname';
1136
+        if (isset($addressbookInfo[$ownerPrincipalKey])) {
1137
+            $uri = $addressbookInfo[$ownerPrincipalKey];
1138
+        } else {
1139
+            $uri = $addressbookInfo['principaluri'];
1140
+        }
1141
+
1142
+        $principalInformation = $this->principalBackend->getPrincipalByPath($uri);
1143
+        if (isset($principalInformation['{DAV:}displayname'])) {
1144
+            $addressbookInfo[$displaynameKey] = $principalInformation['{DAV:}displayname'];
1145
+        }
1146
+    }
1147
+
1148
+    /**
1149
+     * Extract UID from vcard
1150
+     *
1151
+     * @param string $cardData the vcard raw data
1152
+     * @return string the uid
1153
+     * @throws BadRequest if no UID is available
1154
+     */
1155
+    private function getUID($cardData) {
1156
+        if ($cardData != '') {
1157
+            $vCard = Reader::read($cardData);
1158
+            if ($vCard->UID) {
1159
+                $uid = $vCard->UID->getValue();
1160
+                return $uid;
1161
+            }
1162
+            // should already be handled, but just in case
1163
+            throw new BadRequest('vCards on CardDAV servers MUST have a UID property');
1164
+        }
1165
+        // should already be handled, but just in case
1166
+        throw new BadRequest('vCard can not be empty');
1167
+    }
1168 1168
 }
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 			->from('addressbooks')
122 122
 			->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)));
123 123
 
124
-		return (int)$query->execute()->fetchColumn();
124
+		return (int) $query->execute()->fetchColumn();
125 125
 	}
126 126
 
127 127
 	/**
@@ -152,15 +152,15 @@  discard block
 block discarded – undo
152 152
 		$addressBooks = [];
153 153
 
154 154
 		$result = $query->execute();
155
-		while($row = $result->fetch()) {
155
+		while ($row = $result->fetch()) {
156 156
 			$addressBooks[$row['id']] = [
157 157
 				'id'  => $row['id'],
158 158
 				'uri' => $row['uri'],
159 159
 				'principaluri' => $this->convertPrincipal($row['principaluri'], false),
160 160
 				'{DAV:}displayname' => $row['displayname'],
161
-				'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
161
+				'{'.Plugin::NS_CARDDAV.'}addressbook-description' => $row['description'],
162 162
 				'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
163
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
163
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
164 164
 			];
165 165
 
166 166
 			$this->addOwnerPrincipal($addressBooks[$row['id']]);
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 		$principals = array_map(function($principal) {
175 175
 			return urldecode($principal);
176 176
 		}, $principals);
177
-		$principals[]= $principalUri;
177
+		$principals[] = $principalUri;
178 178
 
179 179
 		$query = $this->db->getQueryBuilder();
180 180
 		$result = $query->select(['a.id', 'a.uri', 'a.displayname', 'a.principaluri', 'a.description', 'a.synctoken', 's.access'])
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
 			->setParameter('principaluri', $principals, IQueryBuilder::PARAM_STR_ARRAY)
187 187
 			->execute();
188 188
 
189
-		$readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only';
190
-		while($row = $result->fetch()) {
189
+		$readOnlyPropertyName = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only';
190
+		while ($row = $result->fetch()) {
191 191
 			if ($row['principaluri'] === $principalUri) {
192 192
 				continue;
193 193
 			}
@@ -206,18 +206,18 @@  discard block
 block discarded – undo
206 206
 			}
207 207
 
208 208
 			list(, $name) = \Sabre\Uri\split($row['principaluri']);
209
-			$uri = $row['uri'] . '_shared_by_' . $name;
210
-			$displayName = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')';
209
+			$uri = $row['uri'].'_shared_by_'.$name;
210
+			$displayName = $row['displayname'].' ('.$this->getUserDisplayName($name).')';
211 211
 
212 212
 			$addressBooks[$row['id']] = [
213 213
 				'id'  => $row['id'],
214 214
 				'uri' => $uri,
215 215
 				'principaluri' => $principalUriOriginal,
216 216
 				'{DAV:}displayname' => $displayName,
217
-				'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
217
+				'{'.Plugin::NS_CARDDAV.'}addressbook-description' => $row['description'],
218 218
 				'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
219
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
220
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $row['principaluri'],
219
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
220
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $row['principaluri'],
221 221
 				$readOnlyPropertyName => $readOnly,
222 222
 			];
223 223
 
@@ -238,15 +238,15 @@  discard block
 block discarded – undo
238 238
 		$addressBooks = [];
239 239
 
240 240
 		$result = $query->execute();
241
-		while($row = $result->fetch()) {
241
+		while ($row = $result->fetch()) {
242 242
 			$addressBooks[$row['id']] = [
243 243
 				'id'  => $row['id'],
244 244
 				'uri' => $row['uri'],
245 245
 				'principaluri' => $this->convertPrincipal($row['principaluri'], false),
246 246
 				'{DAV:}displayname' => $row['displayname'],
247
-				'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
247
+				'{'.Plugin::NS_CARDDAV.'}addressbook-description' => $row['description'],
248 248
 				'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
249
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
249
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
250 250
 			];
251 251
 
252 252
 			$this->addOwnerPrincipal($addressBooks[$row['id']]);
@@ -291,9 +291,9 @@  discard block
 block discarded – undo
291 291
 			'uri' => $row['uri'],
292 292
 			'principaluri' => $row['principaluri'],
293 293
 			'{DAV:}displayname' => $row['displayname'],
294
-			'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
294
+			'{'.Plugin::NS_CARDDAV.'}addressbook-description' => $row['description'],
295 295
 			'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
296
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
296
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
297 297
 		];
298 298
 
299 299
 		$this->addOwnerPrincipal($addressBook);
@@ -325,9 +325,9 @@  discard block
 block discarded – undo
325 325
 			'uri' => $row['uri'],
326 326
 			'principaluri' => $row['principaluri'],
327 327
 			'{DAV:}displayname' => $row['displayname'],
328
-			'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
328
+			'{'.Plugin::NS_CARDDAV.'}addressbook-description' => $row['description'],
329 329
 			'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
330
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
330
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
331 331
 		];
332 332
 
333 333
 		$this->addOwnerPrincipal($addressBook);
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 	function updateAddressBook($addressBookId, \Sabre\DAV\PropPatch $propPatch) {
355 355
 		$supportedProperties = [
356 356
 			'{DAV:}displayname',
357
-			'{' . Plugin::NS_CARDDAV . '}addressbook-description',
357
+			'{'.Plugin::NS_CARDDAV.'}addressbook-description',
358 358
 		];
359 359
 
360 360
 		/**
@@ -363,13 +363,13 @@  discard block
 block discarded – undo
363 363
 		$propPatch->handle($supportedProperties, function($mutations) use ($addressBookId) {
364 364
 
365 365
 			$updates = [];
366
-			foreach($mutations as $property=>$newValue) {
366
+			foreach ($mutations as $property=>$newValue) {
367 367
 
368
-				switch($property) {
368
+				switch ($property) {
369 369
 					case '{DAV:}displayname' :
370 370
 						$updates['displayname'] = $newValue;
371 371
 						break;
372
-					case '{' . Plugin::NS_CARDDAV . '}addressbook-description' :
372
+					case '{'.Plugin::NS_CARDDAV.'}addressbook-description' :
373 373
 						$updates['description'] = $newValue;
374 374
 						break;
375 375
 				}
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 			$query = $this->db->getQueryBuilder();
378 378
 			$query->update('addressbooks');
379 379
 
380
-			foreach($updates as $key=>$value) {
380
+			foreach ($updates as $key=>$value) {
381 381
 				$query->set($key, $query->createNamedParameter($value));
382 382
 			}
383 383
 			$query->where($query->expr()->eq('id', $query->createNamedParameter($addressBookId)))
@@ -408,24 +408,24 @@  discard block
 block discarded – undo
408 408
 			'synctoken' => 1
409 409
 		];
410 410
 
411
-		foreach($properties as $property=>$newValue) {
411
+		foreach ($properties as $property=>$newValue) {
412 412
 
413
-			switch($property) {
413
+			switch ($property) {
414 414
 				case '{DAV:}displayname' :
415 415
 					$values['displayname'] = $newValue;
416 416
 					break;
417
-				case '{' . Plugin::NS_CARDDAV . '}addressbook-description' :
417
+				case '{'.Plugin::NS_CARDDAV.'}addressbook-description' :
418 418
 					$values['description'] = $newValue;
419 419
 					break;
420 420
 				default :
421
-					throw new BadRequest('Unknown property: ' . $property);
421
+					throw new BadRequest('Unknown property: '.$property);
422 422
 			}
423 423
 
424 424
 		}
425 425
 
426 426
 		// Fallback to make sure the displayname is set. Some clients may refuse
427 427
 		// to work with addressbooks not having a displayname.
428
-		if(is_null($values['displayname'])) {
428
+		if (is_null($values['displayname'])) {
429 429
 			$values['displayname'] = $url;
430 430
 		}
431 431
 
@@ -503,8 +503,8 @@  discard block
 block discarded – undo
503 503
 		$cards = [];
504 504
 
505 505
 		$result = $query->execute();
506
-		while($row = $result->fetch()) {
507
-			$row['etag'] = '"' . $row['etag'] . '"';
506
+		while ($row = $result->fetch()) {
507
+			$row['etag'] = '"'.$row['etag'].'"';
508 508
 			$row['carddata'] = $this->readBlob($row['carddata']);
509 509
 			$cards[] = $row;
510 510
 		}
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 		if (!$row) {
539 539
 			return false;
540 540
 		}
541
-		$row['etag'] = '"' . $row['etag'] . '"';
541
+		$row['etag'] = '"'.$row['etag'].'"';
542 542
 		$row['carddata'] = $this->readBlob($row['carddata']);
543 543
 
544 544
 		return $row;
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
 			$result = $query->execute();
576 576
 
577 577
 			while ($row = $result->fetch()) {
578
-				$row['etag'] = '"' . $row['etag'] . '"';
578
+				$row['etag'] = '"'.$row['etag'].'"';
579 579
 				$row['carddata'] = $this->readBlob($row['carddata']);
580 580
 				$cards[] = $row;
581 581
 			}
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 				'cardUri' => $cardUri,
649 649
 				'cardData' => $cardData]));
650 650
 
651
-		return '"' . $etag . '"';
651
+		return '"'.$etag.'"';
652 652
 	}
653 653
 
654 654
 	/**
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 				'cardUri' => $cardUri,
701 701
 				'cardData' => $cardData]));
702 702
 
703
-		return '"' . $etag . '"';
703
+		return '"'.$etag.'"';
704 704
 	}
705 705
 
706 706
 	/**
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 	function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null) {
799 799
 		// Current synctoken
800 800
 		$stmt = $this->db->prepare('SELECT `synctoken` FROM `*PREFIX*addressbooks` WHERE `id` = ?');
801
-		$stmt->execute([ $addressBookId ]);
801
+		$stmt->execute([$addressBookId]);
802 802
 		$currentToken = $stmt->fetchColumn(0);
803 803
 
804 804
 		if (is_null($currentToken)) return null;
@@ -813,8 +813,8 @@  discard block
 block discarded – undo
813 813
 		if ($syncToken) {
814 814
 
815 815
 			$query = "SELECT `uri`, `operation` FROM `*PREFIX*addressbookchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `addressbookid` = ? ORDER BY `synctoken`";
816
-			if ($limit>0) {
817
-				$query .= " LIMIT " . (int)$limit;
816
+			if ($limit > 0) {
817
+				$query .= " LIMIT ".(int) $limit;
818 818
 			}
819 819
 
820 820
 			// Fetching all changes
@@ -825,15 +825,15 @@  discard block
 block discarded – undo
825 825
 
826 826
 			// This loop ensures that any duplicates are overwritten, only the
827 827
 			// last change on a node is relevant.
828
-			while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
828
+			while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
829 829
 
830 830
 				$changes[$row['uri']] = $row['operation'];
831 831
 
832 832
 			}
833 833
 
834
-			foreach($changes as $uri => $operation) {
834
+			foreach ($changes as $uri => $operation) {
835 835
 
836
-				switch($operation) {
836
+				switch ($operation) {
837 837
 					case 1:
838 838
 						$result['added'][] = $uri;
839 839
 						break;
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
 
920 920
 		// No need for like when the pattern is empty
921 921
 		if ('' !== $pattern) {
922
-			$query2->andWhere($query2->expr()->ilike('cp.value', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%')));
922
+			$query2->andWhere($query2->expr()->ilike('cp.value', $query->createNamedParameter('%'.$this->db->escapeLikeParameter($pattern).'%')));
923 923
 		}
924 924
 
925 925
 		$query->select('c.carddata', 'c.uri')->from($this->dbCardsTable, 'c')
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
 		$result->closeCursor();
973 973
 
974 974
 		if (!isset($uri['uri'])) {
975
-			throw new \InvalidArgumentException('Card does not exists: ' . $id);
975
+			throw new \InvalidArgumentException('Card does not exists: '.$id);
976 976
 		}
977 977
 
978 978
 		return $uri['uri'];
@@ -1044,11 +1044,11 @@  discard block
 block discarded – undo
1044 1044
 			);
1045 1045
 
1046 1046
 		foreach ($vCard->children() as $property) {
1047
-			if(!in_array($property->name, self::$indexProperties)) {
1047
+			if (!in_array($property->name, self::$indexProperties)) {
1048 1048
 				continue;
1049 1049
 			}
1050 1050
 			$preferred = 0;
1051
-			foreach($property->parameters as $parameter) {
1051
+			foreach ($property->parameters as $parameter) {
1052 1052
 				if ($parameter->name === 'TYPE' && strtoupper($parameter->getValue()) === 'PREF') {
1053 1053
 					$preferred = 1;
1054 1054
 					break;
@@ -1103,10 +1103,10 @@  discard block
 block discarded – undo
1103 1103
 		$result->closeCursor();
1104 1104
 
1105 1105
 		if (!isset($cardIds['id'])) {
1106
-			throw new \InvalidArgumentException('Card does not exists: ' . $uri);
1106
+			throw new \InvalidArgumentException('Card does not exists: '.$uri);
1107 1107
 		}
1108 1108
 
1109
-		return (int)$cardIds['id'];
1109
+		return (int) $cardIds['id'];
1110 1110
 	}
1111 1111
 
1112 1112
 	/**
@@ -1131,8 +1131,8 @@  discard block
 block discarded – undo
1131 1131
 	}
1132 1132
 
1133 1133
 	private function addOwnerPrincipal(&$addressbookInfo) {
1134
-		$ownerPrincipalKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal';
1135
-		$displaynameKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}owner-displayname';
1134
+		$ownerPrincipalKey = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal';
1135
+		$displaynameKey = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD.'}owner-displayname';
1136 1136
 		if (isset($addressbookInfo[$ownerPrincipalKey])) {
1137 1137
 			$uri = $addressbookInfo[$ownerPrincipalKey];
1138 1138
 		} else {
Please login to merge, or discard this patch.
apps/dav/lib/CardDAV/AddressBook.php 1 patch
Indentation   +189 added lines, -189 removed lines patch added patch discarded remove patch
@@ -39,193 +39,193 @@
 block discarded – undo
39 39
  */
40 40
 class AddressBook extends \Sabre\CardDAV\AddressBook implements IShareable {
41 41
 
42
-	/**
43
-	 * AddressBook constructor.
44
-	 *
45
-	 * @param BackendInterface $carddavBackend
46
-	 * @param array $addressBookInfo
47
-	 * @param IL10N $l10n
48
-	 */
49
-	public function __construct(BackendInterface $carddavBackend, array $addressBookInfo, IL10N $l10n) {
50
-		parent::__construct($carddavBackend, $addressBookInfo);
51
-
52
-		if ($this->addressBookInfo['{DAV:}displayname'] === CardDavBackend::PERSONAL_ADDRESSBOOK_NAME &&
53
-			$this->getName() === CardDavBackend::PERSONAL_ADDRESSBOOK_URI) {
54
-			$this->addressBookInfo['{DAV:}displayname'] = $l10n->t('Contacts');
55
-		}
56
-	}
57
-
58
-	/**
59
-	 * Updates the list of shares.
60
-	 *
61
-	 * The first array is a list of people that are to be added to the
62
-	 * addressbook.
63
-	 *
64
-	 * Every element in the add array has the following properties:
65
-	 *   * href - A url. Usually a mailto: address
66
-	 *   * commonName - Usually a first and last name, or false
67
-	 *   * summary - A description of the share, can also be false
68
-	 *   * readOnly - A boolean value
69
-	 *
70
-	 * Every element in the remove array is just the address string.
71
-	 *
72
-	 * @param array $add
73
-	 * @param array $remove
74
-	 * @return void
75
-	 * @throws Forbidden
76
-	 */
77
-	public function updateShares(array $add, array $remove) {
78
-		if ($this->isShared()) {
79
-			throw new Forbidden();
80
-		}
81
-		$this->carddavBackend->updateShares($this, $add, $remove);
82
-	}
83
-
84
-	/**
85
-	 * Returns the list of people whom this addressbook is shared with.
86
-	 *
87
-	 * Every element in this array should have the following properties:
88
-	 *   * href - Often a mailto: address
89
-	 *   * commonName - Optional, for example a first + last name
90
-	 *   * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
91
-	 *   * readOnly - boolean
92
-	 *   * summary - Optional, a description for the share
93
-	 *
94
-	 * @return array
95
-	 */
96
-	public function getShares() {
97
-		if ($this->isShared()) {
98
-			return [];
99
-		}
100
-		return $this->carddavBackend->getShares($this->getResourceId());
101
-	}
102
-
103
-	public function getACL() {
104
-		$acl =  [
105
-			[
106
-				'privilege' => '{DAV:}read',
107
-				'principal' => $this->getOwner(),
108
-				'protected' => true,
109
-			],[
110
-				'privilege' => '{DAV:}write',
111
-				'principal' => $this->getOwner(),
112
-				'protected' => true,
113
-			]
114
-		];
115
-
116
-		if ($this->getOwner() === 'principals/system/system') {
117
-			$acl[] = [
118
-				'privilege' => '{DAV:}read',
119
-				'principal' => '{DAV:}authenticated',
120
-				'protected' => true,
121
-			];
122
-		}
123
-
124
-		if (!$this->isShared()) {
125
-			return $acl;
126
-		}
127
-
128
-		if ($this->getOwner() !== parent::getOwner()) {
129
-			$acl[] =  [
130
-					'privilege' => '{DAV:}read',
131
-					'principal' => parent::getOwner(),
132
-					'protected' => true,
133
-				];
134
-			if ($this->canWrite()) {
135
-				$acl[] = [
136
-					'privilege' => '{DAV:}write',
137
-					'principal' => parent::getOwner(),
138
-					'protected' => true,
139
-				];
140
-			}
141
-		}
142
-
143
-		$acl = $this->carddavBackend->applyShareAcl($this->getResourceId(), $acl);
144
-		$allowedPrincipals = [$this->getOwner(), parent::getOwner(), 'principals/system/system'];
145
-		return array_filter($acl, function($rule) use ($allowedPrincipals) {
146
-			return \in_array($rule['principal'], $allowedPrincipals, true);
147
-		});
148
-	}
149
-
150
-	public function getChildACL() {
151
-		return $this->getACL();
152
-	}
153
-
154
-	public function getChild($name) {
155
-
156
-		$obj = $this->carddavBackend->getCard($this->addressBookInfo['id'], $name);
157
-		if (!$obj) {
158
-			throw new NotFound('Card not found');
159
-		}
160
-		$obj['acl'] = $this->getChildACL();
161
-		return new Card($this->carddavBackend, $this->addressBookInfo, $obj);
162
-
163
-	}
164
-
165
-	/**
166
-	 * @return int
167
-	 */
168
-	public function getResourceId() {
169
-		return $this->addressBookInfo['id'];
170
-	}
171
-
172
-	public function getOwner() {
173
-		if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) {
174
-			return $this->addressBookInfo['{http://owncloud.org/ns}owner-principal'];
175
-		}
176
-		return parent::getOwner();
177
-	}
178
-
179
-	public function delete() {
180
-		if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) {
181
-			$principal = 'principal:' . parent::getOwner();
182
-			$shares = $this->carddavBackend->getShares($this->getResourceId());
183
-			$shares = array_filter($shares, function($share) use ($principal){
184
-				return $share['href'] === $principal;
185
-			});
186
-			if (empty($shares)) {
187
-				throw new Forbidden();
188
-			}
189
-
190
-			$this->carddavBackend->updateShares($this, [], [
191
-				$principal
192
-			]);
193
-			return;
194
-		}
195
-		parent::delete();
196
-	}
197
-
198
-	public function propPatch(PropPatch $propPatch) {
199
-		if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) {
200
-			throw new Forbidden();
201
-		}
202
-		parent::propPatch($propPatch);
203
-	}
204
-
205
-	public function getContactsGroups() {
206
-		return $this->carddavBackend->collectCardProperties($this->getResourceId(), 'CATEGORIES');
207
-	}
208
-
209
-	private function isShared() {
210
-		if (!isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) {
211
-			return false;
212
-		}
213
-
214
-		return $this->addressBookInfo['{http://owncloud.org/ns}owner-principal'] !== $this->addressBookInfo['principaluri'];
215
-	}
216
-
217
-	private function canWrite() {
218
-		if (isset($this->addressBookInfo['{http://owncloud.org/ns}read-only'])) {
219
-			return !$this->addressBookInfo['{http://owncloud.org/ns}read-only'];
220
-		}
221
-		return true;
222
-	}
223
-
224
-	public function getChanges($syncToken, $syncLevel, $limit = null) {
225
-		if (!$syncToken && $limit) {
226
-			throw new UnsupportedLimitOnInitialSyncException();
227
-		}
228
-
229
-		return parent::getChanges($syncToken, $syncLevel, $limit);
230
-	}
42
+    /**
43
+     * AddressBook constructor.
44
+     *
45
+     * @param BackendInterface $carddavBackend
46
+     * @param array $addressBookInfo
47
+     * @param IL10N $l10n
48
+     */
49
+    public function __construct(BackendInterface $carddavBackend, array $addressBookInfo, IL10N $l10n) {
50
+        parent::__construct($carddavBackend, $addressBookInfo);
51
+
52
+        if ($this->addressBookInfo['{DAV:}displayname'] === CardDavBackend::PERSONAL_ADDRESSBOOK_NAME &&
53
+            $this->getName() === CardDavBackend::PERSONAL_ADDRESSBOOK_URI) {
54
+            $this->addressBookInfo['{DAV:}displayname'] = $l10n->t('Contacts');
55
+        }
56
+    }
57
+
58
+    /**
59
+     * Updates the list of shares.
60
+     *
61
+     * The first array is a list of people that are to be added to the
62
+     * addressbook.
63
+     *
64
+     * Every element in the add array has the following properties:
65
+     *   * href - A url. Usually a mailto: address
66
+     *   * commonName - Usually a first and last name, or false
67
+     *   * summary - A description of the share, can also be false
68
+     *   * readOnly - A boolean value
69
+     *
70
+     * Every element in the remove array is just the address string.
71
+     *
72
+     * @param array $add
73
+     * @param array $remove
74
+     * @return void
75
+     * @throws Forbidden
76
+     */
77
+    public function updateShares(array $add, array $remove) {
78
+        if ($this->isShared()) {
79
+            throw new Forbidden();
80
+        }
81
+        $this->carddavBackend->updateShares($this, $add, $remove);
82
+    }
83
+
84
+    /**
85
+     * Returns the list of people whom this addressbook is shared with.
86
+     *
87
+     * Every element in this array should have the following properties:
88
+     *   * href - Often a mailto: address
89
+     *   * commonName - Optional, for example a first + last name
90
+     *   * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants.
91
+     *   * readOnly - boolean
92
+     *   * summary - Optional, a description for the share
93
+     *
94
+     * @return array
95
+     */
96
+    public function getShares() {
97
+        if ($this->isShared()) {
98
+            return [];
99
+        }
100
+        return $this->carddavBackend->getShares($this->getResourceId());
101
+    }
102
+
103
+    public function getACL() {
104
+        $acl =  [
105
+            [
106
+                'privilege' => '{DAV:}read',
107
+                'principal' => $this->getOwner(),
108
+                'protected' => true,
109
+            ],[
110
+                'privilege' => '{DAV:}write',
111
+                'principal' => $this->getOwner(),
112
+                'protected' => true,
113
+            ]
114
+        ];
115
+
116
+        if ($this->getOwner() === 'principals/system/system') {
117
+            $acl[] = [
118
+                'privilege' => '{DAV:}read',
119
+                'principal' => '{DAV:}authenticated',
120
+                'protected' => true,
121
+            ];
122
+        }
123
+
124
+        if (!$this->isShared()) {
125
+            return $acl;
126
+        }
127
+
128
+        if ($this->getOwner() !== parent::getOwner()) {
129
+            $acl[] =  [
130
+                    'privilege' => '{DAV:}read',
131
+                    'principal' => parent::getOwner(),
132
+                    'protected' => true,
133
+                ];
134
+            if ($this->canWrite()) {
135
+                $acl[] = [
136
+                    'privilege' => '{DAV:}write',
137
+                    'principal' => parent::getOwner(),
138
+                    'protected' => true,
139
+                ];
140
+            }
141
+        }
142
+
143
+        $acl = $this->carddavBackend->applyShareAcl($this->getResourceId(), $acl);
144
+        $allowedPrincipals = [$this->getOwner(), parent::getOwner(), 'principals/system/system'];
145
+        return array_filter($acl, function($rule) use ($allowedPrincipals) {
146
+            return \in_array($rule['principal'], $allowedPrincipals, true);
147
+        });
148
+    }
149
+
150
+    public function getChildACL() {
151
+        return $this->getACL();
152
+    }
153
+
154
+    public function getChild($name) {
155
+
156
+        $obj = $this->carddavBackend->getCard($this->addressBookInfo['id'], $name);
157
+        if (!$obj) {
158
+            throw new NotFound('Card not found');
159
+        }
160
+        $obj['acl'] = $this->getChildACL();
161
+        return new Card($this->carddavBackend, $this->addressBookInfo, $obj);
162
+
163
+    }
164
+
165
+    /**
166
+     * @return int
167
+     */
168
+    public function getResourceId() {
169
+        return $this->addressBookInfo['id'];
170
+    }
171
+
172
+    public function getOwner() {
173
+        if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) {
174
+            return $this->addressBookInfo['{http://owncloud.org/ns}owner-principal'];
175
+        }
176
+        return parent::getOwner();
177
+    }
178
+
179
+    public function delete() {
180
+        if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) {
181
+            $principal = 'principal:' . parent::getOwner();
182
+            $shares = $this->carddavBackend->getShares($this->getResourceId());
183
+            $shares = array_filter($shares, function($share) use ($principal){
184
+                return $share['href'] === $principal;
185
+            });
186
+            if (empty($shares)) {
187
+                throw new Forbidden();
188
+            }
189
+
190
+            $this->carddavBackend->updateShares($this, [], [
191
+                $principal
192
+            ]);
193
+            return;
194
+        }
195
+        parent::delete();
196
+    }
197
+
198
+    public function propPatch(PropPatch $propPatch) {
199
+        if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) {
200
+            throw new Forbidden();
201
+        }
202
+        parent::propPatch($propPatch);
203
+    }
204
+
205
+    public function getContactsGroups() {
206
+        return $this->carddavBackend->collectCardProperties($this->getResourceId(), 'CATEGORIES');
207
+    }
208
+
209
+    private function isShared() {
210
+        if (!isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) {
211
+            return false;
212
+        }
213
+
214
+        return $this->addressBookInfo['{http://owncloud.org/ns}owner-principal'] !== $this->addressBookInfo['principaluri'];
215
+    }
216
+
217
+    private function canWrite() {
218
+        if (isset($this->addressBookInfo['{http://owncloud.org/ns}read-only'])) {
219
+            return !$this->addressBookInfo['{http://owncloud.org/ns}read-only'];
220
+        }
221
+        return true;
222
+    }
223
+
224
+    public function getChanges($syncToken, $syncLevel, $limit = null) {
225
+        if (!$syncToken && $limit) {
226
+            throw new UnsupportedLimitOnInitialSyncException();
227
+        }
228
+
229
+        return parent::getChanges($syncToken, $syncLevel, $limit);
230
+    }
231 231
 }
Please login to merge, or discard this patch.
apps/dav/lib/Exception/UnsupportedLimitOnInitialSyncException.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -32,10 +32,10 @@
 block discarded – undo
32 32
  */
33 33
 class UnsupportedLimitOnInitialSyncException extends InsufficientStorage {
34 34
 
35
-	/**
36
-	 * @inheritDoc
37
-	 */
38
-	public function serialize(Server $server, \DOMElement $errorNode) {
39
-		$errorNode->appendChild($errorNode->ownerDocument->createElementNS('DAV:', 'd:number-of-matches-within-limits'));
40
-	}
35
+    /**
36
+     * @inheritDoc
37
+     */
38
+    public function serialize(Server $server, \DOMElement $errorNode) {
39
+        $errorNode->appendChild($errorNode->ownerDocument->createElementNS('DAV:', 'd:number-of-matches-within-limits'));
40
+    }
41 41
 }
Please login to merge, or discard this patch.
apps/dav/composer/composer/autoload_static.php 1 patch
Spacing   +199 added lines, -199 removed lines patch added patch discarded remove patch
@@ -6,218 +6,218 @@
 block discarded – undo
6 6
 
7 7
 class ComposerStaticInitDAV
8 8
 {
9
-    public static $prefixLengthsPsr4 = array (
9
+    public static $prefixLengthsPsr4 = array(
10 10
         'O' => 
11
-        array (
11
+        array(
12 12
             'OCA\\DAV\\' => 8,
13 13
         ),
14 14
     );
15 15
 
16
-    public static $prefixDirsPsr4 = array (
16
+    public static $prefixDirsPsr4 = array(
17 17
         'OCA\\DAV\\' => 
18
-        array (
19
-            0 => __DIR__ . '/..' . '/../lib',
18
+        array(
19
+            0 => __DIR__.'/..'.'/../lib',
20 20
         ),
21 21
     );
22 22
 
23
-    public static $classMap = array (
24
-        'OCA\\DAV\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
25
-        'OCA\\DAV\\AppInfo\\PluginManager' => __DIR__ . '/..' . '/../lib/AppInfo/PluginManager.php',
26
-        'OCA\\DAV\\Avatars\\AvatarHome' => __DIR__ . '/..' . '/../lib/Avatars/AvatarHome.php',
27
-        'OCA\\DAV\\Avatars\\AvatarNode' => __DIR__ . '/..' . '/../lib/Avatars/AvatarNode.php',
28
-        'OCA\\DAV\\Avatars\\RootCollection' => __DIR__ . '/..' . '/../lib/Avatars/RootCollection.php',
29
-        'OCA\\DAV\\BackgroundJob\\CleanupDirectLinksJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/CleanupDirectLinksJob.php',
30
-        'OCA\\DAV\\BackgroundJob\\CleanupInvitationTokenJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/CleanupInvitationTokenJob.php',
31
-        'OCA\\DAV\\BackgroundJob\\GenerateBirthdayCalendarBackgroundJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php',
32
-        'OCA\\DAV\\BackgroundJob\\RefreshWebcalJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/RefreshWebcalJob.php',
33
-        'OCA\\DAV\\BackgroundJob\\RegisterRegenerateBirthdayCalendars' => __DIR__ . '/..' . '/../lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php',
34
-        'OCA\\DAV\\BackgroundJob\\UpdateCalendarResourcesRoomsBackgroundJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php',
35
-        'OCA\\DAV\\BackgroundJob\\UploadCleanup' => __DIR__ . '/..' . '/../lib/BackgroundJob/UploadCleanup.php',
36
-        'OCA\\DAV\\CalDAV\\Activity\\Backend' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Backend.php',
37
-        'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Filter/Calendar.php',
38
-        'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Filter/Todo.php',
39
-        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Base.php',
40
-        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Calendar.php',
41
-        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Event.php',
42
-        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Provider/Todo.php',
43
-        'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Calendar.php',
44
-        'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Event.php',
45
-        'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => __DIR__ . '/..' . '/../lib/CalDAV/Activity/Setting/Todo.php',
46
-        'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => __DIR__ . '/..' . '/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php',
47
-        'OCA\\DAV\\CalDAV\\BirthdayService' => __DIR__ . '/..' . '/../lib/CalDAV/BirthdayService.php',
48
-        'OCA\\DAV\\CalDAV\\CachedSubscription' => __DIR__ . '/..' . '/../lib/CalDAV/CachedSubscription.php',
49
-        'OCA\\DAV\\CalDAV\\CachedSubscriptionObject' => __DIR__ . '/..' . '/../lib/CalDAV/CachedSubscriptionObject.php',
50
-        'OCA\\DAV\\CalDAV\\CalDavBackend' => __DIR__ . '/..' . '/../lib/CalDAV/CalDavBackend.php',
51
-        'OCA\\DAV\\CalDAV\\Calendar' => __DIR__ . '/..' . '/../lib/CalDAV/Calendar.php',
52
-        'OCA\\DAV\\CalDAV\\CalendarHome' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarHome.php',
53
-        'OCA\\DAV\\CalDAV\\CalendarImpl' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarImpl.php',
54
-        'OCA\\DAV\\CalDAV\\CalendarManager' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarManager.php',
55
-        'OCA\\DAV\\CalDAV\\CalendarObject' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarObject.php',
56
-        'OCA\\DAV\\CalDAV\\CalendarRoot' => __DIR__ . '/..' . '/../lib/CalDAV/CalendarRoot.php',
57
-        'OCA\\DAV\\CalDAV\\InvitationResponse\\InvitationResponseServer' => __DIR__ . '/..' . '/../lib/CalDAV/InvitationResponse/InvitationResponseServer.php',
58
-        'OCA\\DAV\\CalDAV\\Outbox' => __DIR__ . '/..' . '/../lib/CalDAV/Outbox.php',
59
-        'OCA\\DAV\\CalDAV\\Plugin' => __DIR__ . '/..' . '/../lib/CalDAV/Plugin.php',
60
-        'OCA\\DAV\\CalDAV\\Principal\\Collection' => __DIR__ . '/..' . '/../lib/CalDAV/Principal/Collection.php',
61
-        'OCA\\DAV\\CalDAV\\Principal\\User' => __DIR__ . '/..' . '/../lib/CalDAV/Principal/User.php',
62
-        'OCA\\DAV\\CalDAV\\PublicCalendar' => __DIR__ . '/..' . '/../lib/CalDAV/PublicCalendar.php',
63
-        'OCA\\DAV\\CalDAV\\PublicCalendarObject' => __DIR__ . '/..' . '/../lib/CalDAV/PublicCalendarObject.php',
64
-        'OCA\\DAV\\CalDAV\\PublicCalendarRoot' => __DIR__ . '/..' . '/../lib/CalDAV/PublicCalendarRoot.php',
65
-        'OCA\\DAV\\CalDAV\\Publishing\\PublishPlugin' => __DIR__ . '/..' . '/../lib/CalDAV/Publishing/PublishPlugin.php',
66
-        'OCA\\DAV\\CalDAV\\Publishing\\Xml\\Publisher' => __DIR__ . '/..' . '/../lib/CalDAV/Publishing/Xml/Publisher.php',
67
-        'OCA\\DAV\\CalDAV\\ResourceBooking\\AbstractPrincipalBackend' => __DIR__ . '/..' . '/../lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php',
68
-        'OCA\\DAV\\CalDAV\\ResourceBooking\\ResourcePrincipalBackend' => __DIR__ . '/..' . '/../lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php',
69
-        'OCA\\DAV\\CalDAV\\ResourceBooking\\RoomPrincipalBackend' => __DIR__ . '/..' . '/../lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php',
70
-        'OCA\\DAV\\CalDAV\\Schedule\\IMipPlugin' => __DIR__ . '/..' . '/../lib/CalDAV/Schedule/IMipPlugin.php',
71
-        'OCA\\DAV\\CalDAV\\Schedule\\Plugin' => __DIR__ . '/..' . '/../lib/CalDAV/Schedule/Plugin.php',
72
-        'OCA\\DAV\\CalDAV\\Search\\SearchPlugin' => __DIR__ . '/..' . '/../lib/CalDAV/Search/SearchPlugin.php',
73
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\CompFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/CompFilter.php',
74
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\LimitFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/LimitFilter.php',
75
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\OffsetFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/OffsetFilter.php',
76
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\ParamFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/ParamFilter.php',
77
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\PropFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/PropFilter.php',
78
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\SearchTermFilter' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php',
79
-        'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport' => __DIR__ . '/..' . '/../lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php',
80
-        'OCA\\DAV\\CalDAV\\WebcalCaching\\Plugin' => __DIR__ . '/..' . '/../lib/CalDAV/WebcalCaching/Plugin.php',
81
-        'OCA\\DAV\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php',
82
-        'OCA\\DAV\\CardDAV\\AddressBook' => __DIR__ . '/..' . '/../lib/CardDAV/AddressBook.php',
83
-        'OCA\\DAV\\CardDAV\\AddressBookImpl' => __DIR__ . '/..' . '/../lib/CardDAV/AddressBookImpl.php',
84
-        'OCA\\DAV\\CardDAV\\AddressBookRoot' => __DIR__ . '/..' . '/../lib/CardDAV/AddressBookRoot.php',
85
-        'OCA\\DAV\\CardDAV\\CardDavBackend' => __DIR__ . '/..' . '/../lib/CardDAV/CardDavBackend.php',
86
-        'OCA\\DAV\\CardDAV\\ContactsManager' => __DIR__ . '/..' . '/../lib/CardDAV/ContactsManager.php',
87
-        'OCA\\DAV\\CardDAV\\Converter' => __DIR__ . '/..' . '/../lib/CardDAV/Converter.php',
88
-        'OCA\\DAV\\CardDAV\\HasPhotoPlugin' => __DIR__ . '/..' . '/../lib/CardDAV/HasPhotoPlugin.php',
89
-        'OCA\\DAV\\CardDAV\\ImageExportPlugin' => __DIR__ . '/..' . '/../lib/CardDAV/ImageExportPlugin.php',
90
-        'OCA\\DAV\\CardDAV\\MultiGetExportPlugin' => __DIR__ . '/..' . '/../lib/CardDAV/MultiGetExportPlugin.php',
91
-        'OCA\\DAV\\CardDAV\\PhotoCache' => __DIR__ . '/..' . '/../lib/CardDAV/PhotoCache.php',
92
-        'OCA\\DAV\\CardDAV\\Plugin' => __DIR__ . '/..' . '/../lib/CardDAV/Plugin.php',
93
-        'OCA\\DAV\\CardDAV\\SyncService' => __DIR__ . '/..' . '/../lib/CardDAV/SyncService.php',
94
-        'OCA\\DAV\\CardDAV\\SystemAddressbook' => __DIR__ . '/..' . '/../lib/CardDAV/SystemAddressbook.php',
95
-        'OCA\\DAV\\CardDAV\\UserAddressBooks' => __DIR__ . '/..' . '/../lib/CardDAV/UserAddressBooks.php',
96
-        'OCA\\DAV\\CardDAV\\Xml\\Groups' => __DIR__ . '/..' . '/../lib/CardDAV/Xml/Groups.php',
97
-        'OCA\\DAV\\Command\\CreateAddressBook' => __DIR__ . '/..' . '/../lib/Command/CreateAddressBook.php',
98
-        'OCA\\DAV\\Command\\CreateCalendar' => __DIR__ . '/..' . '/../lib/Command/CreateCalendar.php',
99
-        'OCA\\DAV\\Command\\ListCalendars' => __DIR__ . '/..' . '/../lib/Command/ListCalendars.php',
100
-        'OCA\\DAV\\Command\\MoveCalendar' => __DIR__ . '/..' . '/../lib/Command/MoveCalendar.php',
101
-        'OCA\\DAV\\Command\\RemoveInvalidShares' => __DIR__ . '/..' . '/../lib/Command/RemoveInvalidShares.php',
102
-        'OCA\\DAV\\Command\\SyncBirthdayCalendar' => __DIR__ . '/..' . '/../lib/Command/SyncBirthdayCalendar.php',
103
-        'OCA\\DAV\\Command\\SyncSystemAddressBook' => __DIR__ . '/..' . '/../lib/Command/SyncSystemAddressBook.php',
104
-        'OCA\\DAV\\Comments\\CommentNode' => __DIR__ . '/..' . '/../lib/Comments/CommentNode.php',
105
-        'OCA\\DAV\\Comments\\CommentsPlugin' => __DIR__ . '/..' . '/../lib/Comments/CommentsPlugin.php',
106
-        'OCA\\DAV\\Comments\\EntityCollection' => __DIR__ . '/..' . '/../lib/Comments/EntityCollection.php',
107
-        'OCA\\DAV\\Comments\\EntityTypeCollection' => __DIR__ . '/..' . '/../lib/Comments/EntityTypeCollection.php',
108
-        'OCA\\DAV\\Comments\\RootCollection' => __DIR__ . '/..' . '/../lib/Comments/RootCollection.php',
109
-        'OCA\\DAV\\Connector\\LegacyDAVACL' => __DIR__ . '/..' . '/../lib/Connector/LegacyDAVACL.php',
110
-        'OCA\\DAV\\Connector\\PublicAuth' => __DIR__ . '/..' . '/../lib/Connector/PublicAuth.php',
111
-        'OCA\\DAV\\Connector\\Sabre\\AnonymousOptionsPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/AnonymousOptionsPlugin.php',
112
-        'OCA\\DAV\\Connector\\Sabre\\AppEnabledPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/AppEnabledPlugin.php',
113
-        'OCA\\DAV\\Connector\\Sabre\\Auth' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Auth.php',
114
-        'OCA\\DAV\\Connector\\Sabre\\BearerAuth' => __DIR__ . '/..' . '/../lib/Connector/Sabre/BearerAuth.php',
115
-        'OCA\\DAV\\Connector\\Sabre\\BlockLegacyClientPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/BlockLegacyClientPlugin.php',
116
-        'OCA\\DAV\\Connector\\Sabre\\CachingTree' => __DIR__ . '/..' . '/../lib/Connector/Sabre/CachingTree.php',
117
-        'OCA\\DAV\\Connector\\Sabre\\ChecksumList' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ChecksumList.php',
118
-        'OCA\\DAV\\Connector\\Sabre\\CommentPropertiesPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/CommentPropertiesPlugin.php',
119
-        'OCA\\DAV\\Connector\\Sabre\\CopyEtagHeaderPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/CopyEtagHeaderPlugin.php',
120
-        'OCA\\DAV\\Connector\\Sabre\\CustomPropertiesBackend' => __DIR__ . '/..' . '/../lib/Connector/Sabre/CustomPropertiesBackend.php',
121
-        'OCA\\DAV\\Connector\\Sabre\\DavAclPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/DavAclPlugin.php',
122
-        'OCA\\DAV\\Connector\\Sabre\\Directory' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Directory.php',
123
-        'OCA\\DAV\\Connector\\Sabre\\DummyGetResponsePlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/DummyGetResponsePlugin.php',
124
-        'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ExceptionLoggerPlugin.php',
125
-        'OCA\\DAV\\Connector\\Sabre\\Exception\\EntityTooLarge' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/EntityTooLarge.php',
126
-        'OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/FileLocked.php',
127
-        'OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/Forbidden.php',
128
-        'OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/InvalidPath.php',
129
-        'OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/PasswordLoginForbidden.php',
130
-        'OCA\\DAV\\Connector\\Sabre\\Exception\\UnsupportedMediaType' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Exception/UnsupportedMediaType.php',
131
-        'OCA\\DAV\\Connector\\Sabre\\FakeLockerPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/FakeLockerPlugin.php',
132
-        'OCA\\DAV\\Connector\\Sabre\\File' => __DIR__ . '/..' . '/../lib/Connector/Sabre/File.php',
133
-        'OCA\\DAV\\Connector\\Sabre\\FilesPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/FilesPlugin.php',
134
-        'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/FilesReportPlugin.php',
135
-        'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/LockPlugin.php',
136
-        'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/MaintenancePlugin.php',
137
-        'OCA\\DAV\\Connector\\Sabre\\Node' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Node.php',
138
-        'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ObjectTree.php',
139
-        'OCA\\DAV\\Connector\\Sabre\\Principal' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Principal.php',
140
-        'OCA\\DAV\\Connector\\Sabre\\QuotaPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/QuotaPlugin.php',
141
-        'OCA\\DAV\\Connector\\Sabre\\Server' => __DIR__ . '/..' . '/../lib/Connector/Sabre/Server.php',
142
-        'OCA\\DAV\\Connector\\Sabre\\ServerFactory' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ServerFactory.php',
143
-        'OCA\\DAV\\Connector\\Sabre\\ShareTypeList' => __DIR__ . '/..' . '/../lib/Connector/Sabre/ShareTypeList.php',
144
-        'OCA\\DAV\\Connector\\Sabre\\SharesPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/SharesPlugin.php',
145
-        'OCA\\DAV\\Connector\\Sabre\\TagList' => __DIR__ . '/..' . '/../lib/Connector/Sabre/TagList.php',
146
-        'OCA\\DAV\\Connector\\Sabre\\TagsPlugin' => __DIR__ . '/..' . '/../lib/Connector/Sabre/TagsPlugin.php',
147
-        'OCA\\DAV\\Controller\\BirthdayCalendarController' => __DIR__ . '/..' . '/../lib/Controller/BirthdayCalendarController.php',
148
-        'OCA\\DAV\\Controller\\DirectController' => __DIR__ . '/..' . '/../lib/Controller/DirectController.php',
149
-        'OCA\\DAV\\Controller\\InvitationResponseController' => __DIR__ . '/..' . '/../lib/Controller/InvitationResponseController.php',
150
-        'OCA\\DAV\\DAV\\CustomPropertiesBackend' => __DIR__ . '/..' . '/../lib/DAV/CustomPropertiesBackend.php',
151
-        'OCA\\DAV\\DAV\\GroupPrincipalBackend' => __DIR__ . '/..' . '/../lib/DAV/GroupPrincipalBackend.php',
152
-        'OCA\\DAV\\DAV\\PublicAuth' => __DIR__ . '/..' . '/../lib/DAV/PublicAuth.php',
153
-        'OCA\\DAV\\DAV\\Sharing\\Backend' => __DIR__ . '/..' . '/../lib/DAV/Sharing/Backend.php',
154
-        'OCA\\DAV\\DAV\\Sharing\\IShareable' => __DIR__ . '/..' . '/../lib/DAV/Sharing/IShareable.php',
155
-        'OCA\\DAV\\DAV\\Sharing\\Plugin' => __DIR__ . '/..' . '/../lib/DAV/Sharing/Plugin.php',
156
-        'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite' => __DIR__ . '/..' . '/../lib/DAV/Sharing/Xml/Invite.php',
157
-        'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest' => __DIR__ . '/..' . '/../lib/DAV/Sharing/Xml/ShareRequest.php',
158
-        'OCA\\DAV\\DAV\\SystemPrincipalBackend' => __DIR__ . '/..' . '/../lib/DAV/SystemPrincipalBackend.php',
159
-        'OCA\\DAV\\Db\\Direct' => __DIR__ . '/..' . '/../lib/Db/Direct.php',
160
-        'OCA\\DAV\\Db\\DirectMapper' => __DIR__ . '/..' . '/../lib/Db/DirectMapper.php',
161
-        'OCA\\DAV\\Direct\\DirectFile' => __DIR__ . '/..' . '/../lib/Direct/DirectFile.php',
162
-        'OCA\\DAV\\Direct\\DirectHome' => __DIR__ . '/..' . '/../lib/Direct/DirectHome.php',
163
-        'OCA\\DAV\\Direct\\Server' => __DIR__ . '/..' . '/../lib/Direct/Server.php',
164
-        'OCA\\DAV\\Direct\\ServerFactory' => __DIR__ . '/..' . '/../lib/Direct/ServerFactory.php',
165
-        'OCA\\DAV\\Exception\\UnsupportedLimitOnInitialSyncException' => __DIR__ . '/..' . '/../lib/Exception/UnsupportedLimitOnInitialSyncException.php',
166
-        'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => __DIR__ . '/..' . '/../lib/Files/BrowserErrorPagePlugin.php',
167
-        'OCA\\DAV\\Files\\FileSearchBackend' => __DIR__ . '/..' . '/../lib/Files/FileSearchBackend.php',
168
-        'OCA\\DAV\\Files\\FilesHome' => __DIR__ . '/..' . '/../lib/Files/FilesHome.php',
169
-        'OCA\\DAV\\Files\\LazySearchBackend' => __DIR__ . '/..' . '/../lib/Files/LazySearchBackend.php',
170
-        'OCA\\DAV\\Files\\RootCollection' => __DIR__ . '/..' . '/../lib/Files/RootCollection.php',
171
-        'OCA\\DAV\\Files\\Sharing\\FilesDropPlugin' => __DIR__ . '/..' . '/../lib/Files/Sharing/FilesDropPlugin.php',
172
-        'OCA\\DAV\\Files\\Sharing\\PublicLinkCheckPlugin' => __DIR__ . '/..' . '/../lib/Files/Sharing/PublicLinkCheckPlugin.php',
173
-        'OCA\\DAV\\HookManager' => __DIR__ . '/..' . '/../lib/HookManager.php',
174
-        'OCA\\DAV\\Migration\\BuildCalendarSearchIndex' => __DIR__ . '/..' . '/../lib/Migration/BuildCalendarSearchIndex.php',
175
-        'OCA\\DAV\\Migration\\BuildCalendarSearchIndexBackgroundJob' => __DIR__ . '/..' . '/../lib/Migration/BuildCalendarSearchIndexBackgroundJob.php',
176
-        'OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue' => __DIR__ . '/..' . '/../lib/Migration/CalDAVRemoveEmptyValue.php',
177
-        'OCA\\DAV\\Migration\\ChunkCleanup' => __DIR__ . '/..' . '/../lib/Migration/ChunkCleanup.php',
178
-        'OCA\\DAV\\Migration\\FixBirthdayCalendarComponent' => __DIR__ . '/..' . '/../lib/Migration/FixBirthdayCalendarComponent.php',
179
-        'OCA\\DAV\\Migration\\RefreshWebcalJobRegistrar' => __DIR__ . '/..' . '/../lib/Migration/RefreshWebcalJobRegistrar.php',
180
-        'OCA\\DAV\\Migration\\RegenerateBirthdayCalendars' => __DIR__ . '/..' . '/../lib/Migration/RegenerateBirthdayCalendars.php',
181
-        'OCA\\DAV\\Migration\\RemoveClassifiedEventActivity' => __DIR__ . '/..' . '/../lib/Migration/RemoveClassifiedEventActivity.php',
182
-        'OCA\\DAV\\Migration\\RemoveOrphanEventsAndContacts' => __DIR__ . '/..' . '/../lib/Migration/RemoveOrphanEventsAndContacts.php',
183
-        'OCA\\DAV\\Migration\\Version1004Date20170825134824' => __DIR__ . '/..' . '/../lib/Migration/Version1004Date20170825134824.php',
184
-        'OCA\\DAV\\Migration\\Version1004Date20170919104507' => __DIR__ . '/..' . '/../lib/Migration/Version1004Date20170919104507.php',
185
-        'OCA\\DAV\\Migration\\Version1004Date20170924124212' => __DIR__ . '/..' . '/../lib/Migration/Version1004Date20170924124212.php',
186
-        'OCA\\DAV\\Migration\\Version1004Date20170926103422' => __DIR__ . '/..' . '/../lib/Migration/Version1004Date20170926103422.php',
187
-        'OCA\\DAV\\Migration\\Version1005Date20180413093149' => __DIR__ . '/..' . '/../lib/Migration/Version1005Date20180413093149.php',
188
-        'OCA\\DAV\\Migration\\Version1005Date20180530124431' => __DIR__ . '/..' . '/../lib/Migration/Version1005Date20180530124431.php',
189
-        'OCA\\DAV\\Migration\\Version1006Date20180619154313' => __DIR__ . '/..' . '/../lib/Migration/Version1006Date20180619154313.php',
190
-        'OCA\\DAV\\Migration\\Version1006Date20180628111625' => __DIR__ . '/..' . '/../lib/Migration/Version1006Date20180628111625.php',
191
-        'OCA\\DAV\\Migration\\Version1008Date20181030113700' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181030113700.php',
192
-        'OCA\\DAV\\Migration\\Version1008Date20181105104826' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181105104826.php',
193
-        'OCA\\DAV\\Migration\\Version1008Date20181105104833' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181105104833.php',
194
-        'OCA\\DAV\\Migration\\Version1008Date20181105110300' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181105110300.php',
195
-        'OCA\\DAV\\Migration\\Version1008Date20181105112049' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181105112049.php',
196
-        'OCA\\DAV\\Migration\\Version1008Date20181114084440' => __DIR__ . '/..' . '/../lib/Migration/Version1008Date20181114084440.php',
197
-        'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningNode' => __DIR__ . '/..' . '/../lib/Provisioning/Apple/AppleProvisioningNode.php',
198
-        'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningPlugin' => __DIR__ . '/..' . '/../lib/Provisioning/Apple/AppleProvisioningPlugin.php',
199
-        'OCA\\DAV\\RootCollection' => __DIR__ . '/..' . '/../lib/RootCollection.php',
200
-        'OCA\\DAV\\Server' => __DIR__ . '/..' . '/../lib/Server.php',
201
-        'OCA\\DAV\\Settings\\CalDAVSettings' => __DIR__ . '/..' . '/../lib/Settings/CalDAVSettings.php',
202
-        'OCA\\DAV\\SystemTag\\SystemTagMappingNode' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagMappingNode.php',
203
-        'OCA\\DAV\\SystemTag\\SystemTagNode' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagNode.php',
204
-        'OCA\\DAV\\SystemTag\\SystemTagPlugin' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagPlugin.php',
205
-        'OCA\\DAV\\SystemTag\\SystemTagsByIdCollection' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagsByIdCollection.php',
206
-        'OCA\\DAV\\SystemTag\\SystemTagsObjectMappingCollection' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagsObjectMappingCollection.php',
207
-        'OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagsObjectTypeCollection.php',
208
-        'OCA\\DAV\\SystemTag\\SystemTagsRelationsCollection' => __DIR__ . '/..' . '/../lib/SystemTag/SystemTagsRelationsCollection.php',
209
-        'OCA\\DAV\\Upload\\AssemblyStream' => __DIR__ . '/..' . '/../lib/Upload/AssemblyStream.php',
210
-        'OCA\\DAV\\Upload\\ChunkingPlugin' => __DIR__ . '/..' . '/../lib/Upload/ChunkingPlugin.php',
211
-        'OCA\\DAV\\Upload\\CleanupService' => __DIR__ . '/..' . '/../lib/Upload/CleanupService.php',
212
-        'OCA\\DAV\\Upload\\FutureFile' => __DIR__ . '/..' . '/../lib/Upload/FutureFile.php',
213
-        'OCA\\DAV\\Upload\\RootCollection' => __DIR__ . '/..' . '/../lib/Upload/RootCollection.php',
214
-        'OCA\\DAV\\Upload\\UploadFolder' => __DIR__ . '/..' . '/../lib/Upload/UploadFolder.php',
215
-        'OCA\\DAV\\Upload\\UploadHome' => __DIR__ . '/..' . '/../lib/Upload/UploadHome.php',
23
+    public static $classMap = array(
24
+        'OCA\\DAV\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php',
25
+        'OCA\\DAV\\AppInfo\\PluginManager' => __DIR__.'/..'.'/../lib/AppInfo/PluginManager.php',
26
+        'OCA\\DAV\\Avatars\\AvatarHome' => __DIR__.'/..'.'/../lib/Avatars/AvatarHome.php',
27
+        'OCA\\DAV\\Avatars\\AvatarNode' => __DIR__.'/..'.'/../lib/Avatars/AvatarNode.php',
28
+        'OCA\\DAV\\Avatars\\RootCollection' => __DIR__.'/..'.'/../lib/Avatars/RootCollection.php',
29
+        'OCA\\DAV\\BackgroundJob\\CleanupDirectLinksJob' => __DIR__.'/..'.'/../lib/BackgroundJob/CleanupDirectLinksJob.php',
30
+        'OCA\\DAV\\BackgroundJob\\CleanupInvitationTokenJob' => __DIR__.'/..'.'/../lib/BackgroundJob/CleanupInvitationTokenJob.php',
31
+        'OCA\\DAV\\BackgroundJob\\GenerateBirthdayCalendarBackgroundJob' => __DIR__.'/..'.'/../lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php',
32
+        'OCA\\DAV\\BackgroundJob\\RefreshWebcalJob' => __DIR__.'/..'.'/../lib/BackgroundJob/RefreshWebcalJob.php',
33
+        'OCA\\DAV\\BackgroundJob\\RegisterRegenerateBirthdayCalendars' => __DIR__.'/..'.'/../lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php',
34
+        'OCA\\DAV\\BackgroundJob\\UpdateCalendarResourcesRoomsBackgroundJob' => __DIR__.'/..'.'/../lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php',
35
+        'OCA\\DAV\\BackgroundJob\\UploadCleanup' => __DIR__.'/..'.'/../lib/BackgroundJob/UploadCleanup.php',
36
+        'OCA\\DAV\\CalDAV\\Activity\\Backend' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Backend.php',
37
+        'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Filter/Calendar.php',
38
+        'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Filter/Todo.php',
39
+        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Provider/Base.php',
40
+        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Provider/Calendar.php',
41
+        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Provider/Event.php',
42
+        'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Provider/Todo.php',
43
+        'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Setting/Calendar.php',
44
+        'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Setting/Event.php',
45
+        'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => __DIR__.'/..'.'/../lib/CalDAV/Activity/Setting/Todo.php',
46
+        'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => __DIR__.'/..'.'/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php',
47
+        'OCA\\DAV\\CalDAV\\BirthdayService' => __DIR__.'/..'.'/../lib/CalDAV/BirthdayService.php',
48
+        'OCA\\DAV\\CalDAV\\CachedSubscription' => __DIR__.'/..'.'/../lib/CalDAV/CachedSubscription.php',
49
+        'OCA\\DAV\\CalDAV\\CachedSubscriptionObject' => __DIR__.'/..'.'/../lib/CalDAV/CachedSubscriptionObject.php',
50
+        'OCA\\DAV\\CalDAV\\CalDavBackend' => __DIR__.'/..'.'/../lib/CalDAV/CalDavBackend.php',
51
+        'OCA\\DAV\\CalDAV\\Calendar' => __DIR__.'/..'.'/../lib/CalDAV/Calendar.php',
52
+        'OCA\\DAV\\CalDAV\\CalendarHome' => __DIR__.'/..'.'/../lib/CalDAV/CalendarHome.php',
53
+        'OCA\\DAV\\CalDAV\\CalendarImpl' => __DIR__.'/..'.'/../lib/CalDAV/CalendarImpl.php',
54
+        'OCA\\DAV\\CalDAV\\CalendarManager' => __DIR__.'/..'.'/../lib/CalDAV/CalendarManager.php',
55
+        'OCA\\DAV\\CalDAV\\CalendarObject' => __DIR__.'/..'.'/../lib/CalDAV/CalendarObject.php',
56
+        'OCA\\DAV\\CalDAV\\CalendarRoot' => __DIR__.'/..'.'/../lib/CalDAV/CalendarRoot.php',
57
+        'OCA\\DAV\\CalDAV\\InvitationResponse\\InvitationResponseServer' => __DIR__.'/..'.'/../lib/CalDAV/InvitationResponse/InvitationResponseServer.php',
58
+        'OCA\\DAV\\CalDAV\\Outbox' => __DIR__.'/..'.'/../lib/CalDAV/Outbox.php',
59
+        'OCA\\DAV\\CalDAV\\Plugin' => __DIR__.'/..'.'/../lib/CalDAV/Plugin.php',
60
+        'OCA\\DAV\\CalDAV\\Principal\\Collection' => __DIR__.'/..'.'/../lib/CalDAV/Principal/Collection.php',
61
+        'OCA\\DAV\\CalDAV\\Principal\\User' => __DIR__.'/..'.'/../lib/CalDAV/Principal/User.php',
62
+        'OCA\\DAV\\CalDAV\\PublicCalendar' => __DIR__.'/..'.'/../lib/CalDAV/PublicCalendar.php',
63
+        'OCA\\DAV\\CalDAV\\PublicCalendarObject' => __DIR__.'/..'.'/../lib/CalDAV/PublicCalendarObject.php',
64
+        'OCA\\DAV\\CalDAV\\PublicCalendarRoot' => __DIR__.'/..'.'/../lib/CalDAV/PublicCalendarRoot.php',
65
+        'OCA\\DAV\\CalDAV\\Publishing\\PublishPlugin' => __DIR__.'/..'.'/../lib/CalDAV/Publishing/PublishPlugin.php',
66
+        'OCA\\DAV\\CalDAV\\Publishing\\Xml\\Publisher' => __DIR__.'/..'.'/../lib/CalDAV/Publishing/Xml/Publisher.php',
67
+        'OCA\\DAV\\CalDAV\\ResourceBooking\\AbstractPrincipalBackend' => __DIR__.'/..'.'/../lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php',
68
+        'OCA\\DAV\\CalDAV\\ResourceBooking\\ResourcePrincipalBackend' => __DIR__.'/..'.'/../lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php',
69
+        'OCA\\DAV\\CalDAV\\ResourceBooking\\RoomPrincipalBackend' => __DIR__.'/..'.'/../lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php',
70
+        'OCA\\DAV\\CalDAV\\Schedule\\IMipPlugin' => __DIR__.'/..'.'/../lib/CalDAV/Schedule/IMipPlugin.php',
71
+        'OCA\\DAV\\CalDAV\\Schedule\\Plugin' => __DIR__.'/..'.'/../lib/CalDAV/Schedule/Plugin.php',
72
+        'OCA\\DAV\\CalDAV\\Search\\SearchPlugin' => __DIR__.'/..'.'/../lib/CalDAV/Search/SearchPlugin.php',
73
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\CompFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/CompFilter.php',
74
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\LimitFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/LimitFilter.php',
75
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\OffsetFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/OffsetFilter.php',
76
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\ParamFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/ParamFilter.php',
77
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\PropFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/PropFilter.php',
78
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\SearchTermFilter' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php',
79
+        'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport' => __DIR__.'/..'.'/../lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php',
80
+        'OCA\\DAV\\CalDAV\\WebcalCaching\\Plugin' => __DIR__.'/..'.'/../lib/CalDAV/WebcalCaching/Plugin.php',
81
+        'OCA\\DAV\\Capabilities' => __DIR__.'/..'.'/../lib/Capabilities.php',
82
+        'OCA\\DAV\\CardDAV\\AddressBook' => __DIR__.'/..'.'/../lib/CardDAV/AddressBook.php',
83
+        'OCA\\DAV\\CardDAV\\AddressBookImpl' => __DIR__.'/..'.'/../lib/CardDAV/AddressBookImpl.php',
84
+        'OCA\\DAV\\CardDAV\\AddressBookRoot' => __DIR__.'/..'.'/../lib/CardDAV/AddressBookRoot.php',
85
+        'OCA\\DAV\\CardDAV\\CardDavBackend' => __DIR__.'/..'.'/../lib/CardDAV/CardDavBackend.php',
86
+        'OCA\\DAV\\CardDAV\\ContactsManager' => __DIR__.'/..'.'/../lib/CardDAV/ContactsManager.php',
87
+        'OCA\\DAV\\CardDAV\\Converter' => __DIR__.'/..'.'/../lib/CardDAV/Converter.php',
88
+        'OCA\\DAV\\CardDAV\\HasPhotoPlugin' => __DIR__.'/..'.'/../lib/CardDAV/HasPhotoPlugin.php',
89
+        'OCA\\DAV\\CardDAV\\ImageExportPlugin' => __DIR__.'/..'.'/../lib/CardDAV/ImageExportPlugin.php',
90
+        'OCA\\DAV\\CardDAV\\MultiGetExportPlugin' => __DIR__.'/..'.'/../lib/CardDAV/MultiGetExportPlugin.php',
91
+        'OCA\\DAV\\CardDAV\\PhotoCache' => __DIR__.'/..'.'/../lib/CardDAV/PhotoCache.php',
92
+        'OCA\\DAV\\CardDAV\\Plugin' => __DIR__.'/..'.'/../lib/CardDAV/Plugin.php',
93
+        'OCA\\DAV\\CardDAV\\SyncService' => __DIR__.'/..'.'/../lib/CardDAV/SyncService.php',
94
+        'OCA\\DAV\\CardDAV\\SystemAddressbook' => __DIR__.'/..'.'/../lib/CardDAV/SystemAddressbook.php',
95
+        'OCA\\DAV\\CardDAV\\UserAddressBooks' => __DIR__.'/..'.'/../lib/CardDAV/UserAddressBooks.php',
96
+        'OCA\\DAV\\CardDAV\\Xml\\Groups' => __DIR__.'/..'.'/../lib/CardDAV/Xml/Groups.php',
97
+        'OCA\\DAV\\Command\\CreateAddressBook' => __DIR__.'/..'.'/../lib/Command/CreateAddressBook.php',
98
+        'OCA\\DAV\\Command\\CreateCalendar' => __DIR__.'/..'.'/../lib/Command/CreateCalendar.php',
99
+        'OCA\\DAV\\Command\\ListCalendars' => __DIR__.'/..'.'/../lib/Command/ListCalendars.php',
100
+        'OCA\\DAV\\Command\\MoveCalendar' => __DIR__.'/..'.'/../lib/Command/MoveCalendar.php',
101
+        'OCA\\DAV\\Command\\RemoveInvalidShares' => __DIR__.'/..'.'/../lib/Command/RemoveInvalidShares.php',
102
+        'OCA\\DAV\\Command\\SyncBirthdayCalendar' => __DIR__.'/..'.'/../lib/Command/SyncBirthdayCalendar.php',
103
+        'OCA\\DAV\\Command\\SyncSystemAddressBook' => __DIR__.'/..'.'/../lib/Command/SyncSystemAddressBook.php',
104
+        'OCA\\DAV\\Comments\\CommentNode' => __DIR__.'/..'.'/../lib/Comments/CommentNode.php',
105
+        'OCA\\DAV\\Comments\\CommentsPlugin' => __DIR__.'/..'.'/../lib/Comments/CommentsPlugin.php',
106
+        'OCA\\DAV\\Comments\\EntityCollection' => __DIR__.'/..'.'/../lib/Comments/EntityCollection.php',
107
+        'OCA\\DAV\\Comments\\EntityTypeCollection' => __DIR__.'/..'.'/../lib/Comments/EntityTypeCollection.php',
108
+        'OCA\\DAV\\Comments\\RootCollection' => __DIR__.'/..'.'/../lib/Comments/RootCollection.php',
109
+        'OCA\\DAV\\Connector\\LegacyDAVACL' => __DIR__.'/..'.'/../lib/Connector/LegacyDAVACL.php',
110
+        'OCA\\DAV\\Connector\\PublicAuth' => __DIR__.'/..'.'/../lib/Connector/PublicAuth.php',
111
+        'OCA\\DAV\\Connector\\Sabre\\AnonymousOptionsPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/AnonymousOptionsPlugin.php',
112
+        'OCA\\DAV\\Connector\\Sabre\\AppEnabledPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/AppEnabledPlugin.php',
113
+        'OCA\\DAV\\Connector\\Sabre\\Auth' => __DIR__.'/..'.'/../lib/Connector/Sabre/Auth.php',
114
+        'OCA\\DAV\\Connector\\Sabre\\BearerAuth' => __DIR__.'/..'.'/../lib/Connector/Sabre/BearerAuth.php',
115
+        'OCA\\DAV\\Connector\\Sabre\\BlockLegacyClientPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/BlockLegacyClientPlugin.php',
116
+        'OCA\\DAV\\Connector\\Sabre\\CachingTree' => __DIR__.'/..'.'/../lib/Connector/Sabre/CachingTree.php',
117
+        'OCA\\DAV\\Connector\\Sabre\\ChecksumList' => __DIR__.'/..'.'/../lib/Connector/Sabre/ChecksumList.php',
118
+        'OCA\\DAV\\Connector\\Sabre\\CommentPropertiesPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/CommentPropertiesPlugin.php',
119
+        'OCA\\DAV\\Connector\\Sabre\\CopyEtagHeaderPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/CopyEtagHeaderPlugin.php',
120
+        'OCA\\DAV\\Connector\\Sabre\\CustomPropertiesBackend' => __DIR__.'/..'.'/../lib/Connector/Sabre/CustomPropertiesBackend.php',
121
+        'OCA\\DAV\\Connector\\Sabre\\DavAclPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/DavAclPlugin.php',
122
+        'OCA\\DAV\\Connector\\Sabre\\Directory' => __DIR__.'/..'.'/../lib/Connector/Sabre/Directory.php',
123
+        'OCA\\DAV\\Connector\\Sabre\\DummyGetResponsePlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/DummyGetResponsePlugin.php',
124
+        'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/ExceptionLoggerPlugin.php',
125
+        'OCA\\DAV\\Connector\\Sabre\\Exception\\EntityTooLarge' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/EntityTooLarge.php',
126
+        'OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/FileLocked.php',
127
+        'OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/Forbidden.php',
128
+        'OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/InvalidPath.php',
129
+        'OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/PasswordLoginForbidden.php',
130
+        'OCA\\DAV\\Connector\\Sabre\\Exception\\UnsupportedMediaType' => __DIR__.'/..'.'/../lib/Connector/Sabre/Exception/UnsupportedMediaType.php',
131
+        'OCA\\DAV\\Connector\\Sabre\\FakeLockerPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/FakeLockerPlugin.php',
132
+        'OCA\\DAV\\Connector\\Sabre\\File' => __DIR__.'/..'.'/../lib/Connector/Sabre/File.php',
133
+        'OCA\\DAV\\Connector\\Sabre\\FilesPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/FilesPlugin.php',
134
+        'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/FilesReportPlugin.php',
135
+        'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/LockPlugin.php',
136
+        'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/MaintenancePlugin.php',
137
+        'OCA\\DAV\\Connector\\Sabre\\Node' => __DIR__.'/..'.'/../lib/Connector/Sabre/Node.php',
138
+        'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => __DIR__.'/..'.'/../lib/Connector/Sabre/ObjectTree.php',
139
+        'OCA\\DAV\\Connector\\Sabre\\Principal' => __DIR__.'/..'.'/../lib/Connector/Sabre/Principal.php',
140
+        'OCA\\DAV\\Connector\\Sabre\\QuotaPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/QuotaPlugin.php',
141
+        'OCA\\DAV\\Connector\\Sabre\\Server' => __DIR__.'/..'.'/../lib/Connector/Sabre/Server.php',
142
+        'OCA\\DAV\\Connector\\Sabre\\ServerFactory' => __DIR__.'/..'.'/../lib/Connector/Sabre/ServerFactory.php',
143
+        'OCA\\DAV\\Connector\\Sabre\\ShareTypeList' => __DIR__.'/..'.'/../lib/Connector/Sabre/ShareTypeList.php',
144
+        'OCA\\DAV\\Connector\\Sabre\\SharesPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/SharesPlugin.php',
145
+        'OCA\\DAV\\Connector\\Sabre\\TagList' => __DIR__.'/..'.'/../lib/Connector/Sabre/TagList.php',
146
+        'OCA\\DAV\\Connector\\Sabre\\TagsPlugin' => __DIR__.'/..'.'/../lib/Connector/Sabre/TagsPlugin.php',
147
+        'OCA\\DAV\\Controller\\BirthdayCalendarController' => __DIR__.'/..'.'/../lib/Controller/BirthdayCalendarController.php',
148
+        'OCA\\DAV\\Controller\\DirectController' => __DIR__.'/..'.'/../lib/Controller/DirectController.php',
149
+        'OCA\\DAV\\Controller\\InvitationResponseController' => __DIR__.'/..'.'/../lib/Controller/InvitationResponseController.php',
150
+        'OCA\\DAV\\DAV\\CustomPropertiesBackend' => __DIR__.'/..'.'/../lib/DAV/CustomPropertiesBackend.php',
151
+        'OCA\\DAV\\DAV\\GroupPrincipalBackend' => __DIR__.'/..'.'/../lib/DAV/GroupPrincipalBackend.php',
152
+        'OCA\\DAV\\DAV\\PublicAuth' => __DIR__.'/..'.'/../lib/DAV/PublicAuth.php',
153
+        'OCA\\DAV\\DAV\\Sharing\\Backend' => __DIR__.'/..'.'/../lib/DAV/Sharing/Backend.php',
154
+        'OCA\\DAV\\DAV\\Sharing\\IShareable' => __DIR__.'/..'.'/../lib/DAV/Sharing/IShareable.php',
155
+        'OCA\\DAV\\DAV\\Sharing\\Plugin' => __DIR__.'/..'.'/../lib/DAV/Sharing/Plugin.php',
156
+        'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite' => __DIR__.'/..'.'/../lib/DAV/Sharing/Xml/Invite.php',
157
+        'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest' => __DIR__.'/..'.'/../lib/DAV/Sharing/Xml/ShareRequest.php',
158
+        'OCA\\DAV\\DAV\\SystemPrincipalBackend' => __DIR__.'/..'.'/../lib/DAV/SystemPrincipalBackend.php',
159
+        'OCA\\DAV\\Db\\Direct' => __DIR__.'/..'.'/../lib/Db/Direct.php',
160
+        'OCA\\DAV\\Db\\DirectMapper' => __DIR__.'/..'.'/../lib/Db/DirectMapper.php',
161
+        'OCA\\DAV\\Direct\\DirectFile' => __DIR__.'/..'.'/../lib/Direct/DirectFile.php',
162
+        'OCA\\DAV\\Direct\\DirectHome' => __DIR__.'/..'.'/../lib/Direct/DirectHome.php',
163
+        'OCA\\DAV\\Direct\\Server' => __DIR__.'/..'.'/../lib/Direct/Server.php',
164
+        'OCA\\DAV\\Direct\\ServerFactory' => __DIR__.'/..'.'/../lib/Direct/ServerFactory.php',
165
+        'OCA\\DAV\\Exception\\UnsupportedLimitOnInitialSyncException' => __DIR__.'/..'.'/../lib/Exception/UnsupportedLimitOnInitialSyncException.php',
166
+        'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => __DIR__.'/..'.'/../lib/Files/BrowserErrorPagePlugin.php',
167
+        'OCA\\DAV\\Files\\FileSearchBackend' => __DIR__.'/..'.'/../lib/Files/FileSearchBackend.php',
168
+        'OCA\\DAV\\Files\\FilesHome' => __DIR__.'/..'.'/../lib/Files/FilesHome.php',
169
+        'OCA\\DAV\\Files\\LazySearchBackend' => __DIR__.'/..'.'/../lib/Files/LazySearchBackend.php',
170
+        'OCA\\DAV\\Files\\RootCollection' => __DIR__.'/..'.'/../lib/Files/RootCollection.php',
171
+        'OCA\\DAV\\Files\\Sharing\\FilesDropPlugin' => __DIR__.'/..'.'/../lib/Files/Sharing/FilesDropPlugin.php',
172
+        'OCA\\DAV\\Files\\Sharing\\PublicLinkCheckPlugin' => __DIR__.'/..'.'/../lib/Files/Sharing/PublicLinkCheckPlugin.php',
173
+        'OCA\\DAV\\HookManager' => __DIR__.'/..'.'/../lib/HookManager.php',
174
+        'OCA\\DAV\\Migration\\BuildCalendarSearchIndex' => __DIR__.'/..'.'/../lib/Migration/BuildCalendarSearchIndex.php',
175
+        'OCA\\DAV\\Migration\\BuildCalendarSearchIndexBackgroundJob' => __DIR__.'/..'.'/../lib/Migration/BuildCalendarSearchIndexBackgroundJob.php',
176
+        'OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue' => __DIR__.'/..'.'/../lib/Migration/CalDAVRemoveEmptyValue.php',
177
+        'OCA\\DAV\\Migration\\ChunkCleanup' => __DIR__.'/..'.'/../lib/Migration/ChunkCleanup.php',
178
+        'OCA\\DAV\\Migration\\FixBirthdayCalendarComponent' => __DIR__.'/..'.'/../lib/Migration/FixBirthdayCalendarComponent.php',
179
+        'OCA\\DAV\\Migration\\RefreshWebcalJobRegistrar' => __DIR__.'/..'.'/../lib/Migration/RefreshWebcalJobRegistrar.php',
180
+        'OCA\\DAV\\Migration\\RegenerateBirthdayCalendars' => __DIR__.'/..'.'/../lib/Migration/RegenerateBirthdayCalendars.php',
181
+        'OCA\\DAV\\Migration\\RemoveClassifiedEventActivity' => __DIR__.'/..'.'/../lib/Migration/RemoveClassifiedEventActivity.php',
182
+        'OCA\\DAV\\Migration\\RemoveOrphanEventsAndContacts' => __DIR__.'/..'.'/../lib/Migration/RemoveOrphanEventsAndContacts.php',
183
+        'OCA\\DAV\\Migration\\Version1004Date20170825134824' => __DIR__.'/..'.'/../lib/Migration/Version1004Date20170825134824.php',
184
+        'OCA\\DAV\\Migration\\Version1004Date20170919104507' => __DIR__.'/..'.'/../lib/Migration/Version1004Date20170919104507.php',
185
+        'OCA\\DAV\\Migration\\Version1004Date20170924124212' => __DIR__.'/..'.'/../lib/Migration/Version1004Date20170924124212.php',
186
+        'OCA\\DAV\\Migration\\Version1004Date20170926103422' => __DIR__.'/..'.'/../lib/Migration/Version1004Date20170926103422.php',
187
+        'OCA\\DAV\\Migration\\Version1005Date20180413093149' => __DIR__.'/..'.'/../lib/Migration/Version1005Date20180413093149.php',
188
+        'OCA\\DAV\\Migration\\Version1005Date20180530124431' => __DIR__.'/..'.'/../lib/Migration/Version1005Date20180530124431.php',
189
+        'OCA\\DAV\\Migration\\Version1006Date20180619154313' => __DIR__.'/..'.'/../lib/Migration/Version1006Date20180619154313.php',
190
+        'OCA\\DAV\\Migration\\Version1006Date20180628111625' => __DIR__.'/..'.'/../lib/Migration/Version1006Date20180628111625.php',
191
+        'OCA\\DAV\\Migration\\Version1008Date20181030113700' => __DIR__.'/..'.'/../lib/Migration/Version1008Date20181030113700.php',
192
+        'OCA\\DAV\\Migration\\Version1008Date20181105104826' => __DIR__.'/..'.'/../lib/Migration/Version1008Date20181105104826.php',
193
+        'OCA\\DAV\\Migration\\Version1008Date20181105104833' => __DIR__.'/..'.'/../lib/Migration/Version1008Date20181105104833.php',
194
+        'OCA\\DAV\\Migration\\Version1008Date20181105110300' => __DIR__.'/..'.'/../lib/Migration/Version1008Date20181105110300.php',
195
+        'OCA\\DAV\\Migration\\Version1008Date20181105112049' => __DIR__.'/..'.'/../lib/Migration/Version1008Date20181105112049.php',
196
+        'OCA\\DAV\\Migration\\Version1008Date20181114084440' => __DIR__.'/..'.'/../lib/Migration/Version1008Date20181114084440.php',
197
+        'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningNode' => __DIR__.'/..'.'/../lib/Provisioning/Apple/AppleProvisioningNode.php',
198
+        'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningPlugin' => __DIR__.'/..'.'/../lib/Provisioning/Apple/AppleProvisioningPlugin.php',
199
+        'OCA\\DAV\\RootCollection' => __DIR__.'/..'.'/../lib/RootCollection.php',
200
+        'OCA\\DAV\\Server' => __DIR__.'/..'.'/../lib/Server.php',
201
+        'OCA\\DAV\\Settings\\CalDAVSettings' => __DIR__.'/..'.'/../lib/Settings/CalDAVSettings.php',
202
+        'OCA\\DAV\\SystemTag\\SystemTagMappingNode' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagMappingNode.php',
203
+        'OCA\\DAV\\SystemTag\\SystemTagNode' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagNode.php',
204
+        'OCA\\DAV\\SystemTag\\SystemTagPlugin' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagPlugin.php',
205
+        'OCA\\DAV\\SystemTag\\SystemTagsByIdCollection' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagsByIdCollection.php',
206
+        'OCA\\DAV\\SystemTag\\SystemTagsObjectMappingCollection' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagsObjectMappingCollection.php',
207
+        'OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagsObjectTypeCollection.php',
208
+        'OCA\\DAV\\SystemTag\\SystemTagsRelationsCollection' => __DIR__.'/..'.'/../lib/SystemTag/SystemTagsRelationsCollection.php',
209
+        'OCA\\DAV\\Upload\\AssemblyStream' => __DIR__.'/..'.'/../lib/Upload/AssemblyStream.php',
210
+        'OCA\\DAV\\Upload\\ChunkingPlugin' => __DIR__.'/..'.'/../lib/Upload/ChunkingPlugin.php',
211
+        'OCA\\DAV\\Upload\\CleanupService' => __DIR__.'/..'.'/../lib/Upload/CleanupService.php',
212
+        'OCA\\DAV\\Upload\\FutureFile' => __DIR__.'/..'.'/../lib/Upload/FutureFile.php',
213
+        'OCA\\DAV\\Upload\\RootCollection' => __DIR__.'/..'.'/../lib/Upload/RootCollection.php',
214
+        'OCA\\DAV\\Upload\\UploadFolder' => __DIR__.'/..'.'/../lib/Upload/UploadFolder.php',
215
+        'OCA\\DAV\\Upload\\UploadHome' => __DIR__.'/..'.'/../lib/Upload/UploadHome.php',
216 216
     );
217 217
 
218 218
     public static function getInitializer(ClassLoader $loader)
219 219
     {
220
-        return \Closure::bind(function () use ($loader) {
220
+        return \Closure::bind(function() use ($loader) {
221 221
             $loader->prefixLengthsPsr4 = ComposerStaticInitDAV::$prefixLengthsPsr4;
222 222
             $loader->prefixDirsPsr4 = ComposerStaticInitDAV::$prefixDirsPsr4;
223 223
             $loader->classMap = ComposerStaticInitDAV::$classMap;
Please login to merge, or discard this patch.
apps/dav/composer/composer/autoload_classmap.php 1 patch
Spacing   +192 added lines, -192 removed lines patch added patch discarded remove patch
@@ -6,196 +6,196 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'OCA\\DAV\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
10
-    'OCA\\DAV\\AppInfo\\PluginManager' => $baseDir . '/../lib/AppInfo/PluginManager.php',
11
-    'OCA\\DAV\\Avatars\\AvatarHome' => $baseDir . '/../lib/Avatars/AvatarHome.php',
12
-    'OCA\\DAV\\Avatars\\AvatarNode' => $baseDir . '/../lib/Avatars/AvatarNode.php',
13
-    'OCA\\DAV\\Avatars\\RootCollection' => $baseDir . '/../lib/Avatars/RootCollection.php',
14
-    'OCA\\DAV\\BackgroundJob\\CleanupDirectLinksJob' => $baseDir . '/../lib/BackgroundJob/CleanupDirectLinksJob.php',
15
-    'OCA\\DAV\\BackgroundJob\\CleanupInvitationTokenJob' => $baseDir . '/../lib/BackgroundJob/CleanupInvitationTokenJob.php',
16
-    'OCA\\DAV\\BackgroundJob\\GenerateBirthdayCalendarBackgroundJob' => $baseDir . '/../lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php',
17
-    'OCA\\DAV\\BackgroundJob\\RefreshWebcalJob' => $baseDir . '/../lib/BackgroundJob/RefreshWebcalJob.php',
18
-    'OCA\\DAV\\BackgroundJob\\RegisterRegenerateBirthdayCalendars' => $baseDir . '/../lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php',
19
-    'OCA\\DAV\\BackgroundJob\\UpdateCalendarResourcesRoomsBackgroundJob' => $baseDir . '/../lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php',
20
-    'OCA\\DAV\\BackgroundJob\\UploadCleanup' => $baseDir . '/../lib/BackgroundJob/UploadCleanup.php',
21
-    'OCA\\DAV\\CalDAV\\Activity\\Backend' => $baseDir . '/../lib/CalDAV/Activity/Backend.php',
22
-    'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Filter/Calendar.php',
23
-    'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Filter/Todo.php',
24
-    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => $baseDir . '/../lib/CalDAV/Activity/Provider/Base.php',
25
-    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Provider/Calendar.php',
26
-    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => $baseDir . '/../lib/CalDAV/Activity/Provider/Event.php',
27
-    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Provider/Todo.php',
28
-    'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => $baseDir . '/../lib/CalDAV/Activity/Setting/Calendar.php',
29
-    'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => $baseDir . '/../lib/CalDAV/Activity/Setting/Event.php',
30
-    'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => $baseDir . '/../lib/CalDAV/Activity/Setting/Todo.php',
31
-    'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => $baseDir . '/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php',
32
-    'OCA\\DAV\\CalDAV\\BirthdayService' => $baseDir . '/../lib/CalDAV/BirthdayService.php',
33
-    'OCA\\DAV\\CalDAV\\CachedSubscription' => $baseDir . '/../lib/CalDAV/CachedSubscription.php',
34
-    'OCA\\DAV\\CalDAV\\CachedSubscriptionObject' => $baseDir . '/../lib/CalDAV/CachedSubscriptionObject.php',
35
-    'OCA\\DAV\\CalDAV\\CalDavBackend' => $baseDir . '/../lib/CalDAV/CalDavBackend.php',
36
-    'OCA\\DAV\\CalDAV\\Calendar' => $baseDir . '/../lib/CalDAV/Calendar.php',
37
-    'OCA\\DAV\\CalDAV\\CalendarHome' => $baseDir . '/../lib/CalDAV/CalendarHome.php',
38
-    'OCA\\DAV\\CalDAV\\CalendarImpl' => $baseDir . '/../lib/CalDAV/CalendarImpl.php',
39
-    'OCA\\DAV\\CalDAV\\CalendarManager' => $baseDir . '/../lib/CalDAV/CalendarManager.php',
40
-    'OCA\\DAV\\CalDAV\\CalendarObject' => $baseDir . '/../lib/CalDAV/CalendarObject.php',
41
-    'OCA\\DAV\\CalDAV\\CalendarRoot' => $baseDir . '/../lib/CalDAV/CalendarRoot.php',
42
-    'OCA\\DAV\\CalDAV\\InvitationResponse\\InvitationResponseServer' => $baseDir . '/../lib/CalDAV/InvitationResponse/InvitationResponseServer.php',
43
-    'OCA\\DAV\\CalDAV\\Outbox' => $baseDir . '/../lib/CalDAV/Outbox.php',
44
-    'OCA\\DAV\\CalDAV\\Plugin' => $baseDir . '/../lib/CalDAV/Plugin.php',
45
-    'OCA\\DAV\\CalDAV\\Principal\\Collection' => $baseDir . '/../lib/CalDAV/Principal/Collection.php',
46
-    'OCA\\DAV\\CalDAV\\Principal\\User' => $baseDir . '/../lib/CalDAV/Principal/User.php',
47
-    'OCA\\DAV\\CalDAV\\PublicCalendar' => $baseDir . '/../lib/CalDAV/PublicCalendar.php',
48
-    'OCA\\DAV\\CalDAV\\PublicCalendarObject' => $baseDir . '/../lib/CalDAV/PublicCalendarObject.php',
49
-    'OCA\\DAV\\CalDAV\\PublicCalendarRoot' => $baseDir . '/../lib/CalDAV/PublicCalendarRoot.php',
50
-    'OCA\\DAV\\CalDAV\\Publishing\\PublishPlugin' => $baseDir . '/../lib/CalDAV/Publishing/PublishPlugin.php',
51
-    'OCA\\DAV\\CalDAV\\Publishing\\Xml\\Publisher' => $baseDir . '/../lib/CalDAV/Publishing/Xml/Publisher.php',
52
-    'OCA\\DAV\\CalDAV\\ResourceBooking\\AbstractPrincipalBackend' => $baseDir . '/../lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php',
53
-    'OCA\\DAV\\CalDAV\\ResourceBooking\\ResourcePrincipalBackend' => $baseDir . '/../lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php',
54
-    'OCA\\DAV\\CalDAV\\ResourceBooking\\RoomPrincipalBackend' => $baseDir . '/../lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php',
55
-    'OCA\\DAV\\CalDAV\\Schedule\\IMipPlugin' => $baseDir . '/../lib/CalDAV/Schedule/IMipPlugin.php',
56
-    'OCA\\DAV\\CalDAV\\Schedule\\Plugin' => $baseDir . '/../lib/CalDAV/Schedule/Plugin.php',
57
-    'OCA\\DAV\\CalDAV\\Search\\SearchPlugin' => $baseDir . '/../lib/CalDAV/Search/SearchPlugin.php',
58
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\CompFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/CompFilter.php',
59
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\LimitFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/LimitFilter.php',
60
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\OffsetFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/OffsetFilter.php',
61
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\ParamFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/ParamFilter.php',
62
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\PropFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/PropFilter.php',
63
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\SearchTermFilter' => $baseDir . '/../lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php',
64
-    'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport' => $baseDir . '/../lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php',
65
-    'OCA\\DAV\\CalDAV\\WebcalCaching\\Plugin' => $baseDir . '/../lib/CalDAV/WebcalCaching/Plugin.php',
66
-    'OCA\\DAV\\Capabilities' => $baseDir . '/../lib/Capabilities.php',
67
-    'OCA\\DAV\\CardDAV\\AddressBook' => $baseDir . '/../lib/CardDAV/AddressBook.php',
68
-    'OCA\\DAV\\CardDAV\\AddressBookImpl' => $baseDir . '/../lib/CardDAV/AddressBookImpl.php',
69
-    'OCA\\DAV\\CardDAV\\AddressBookRoot' => $baseDir . '/../lib/CardDAV/AddressBookRoot.php',
70
-    'OCA\\DAV\\CardDAV\\CardDavBackend' => $baseDir . '/../lib/CardDAV/CardDavBackend.php',
71
-    'OCA\\DAV\\CardDAV\\ContactsManager' => $baseDir . '/../lib/CardDAV/ContactsManager.php',
72
-    'OCA\\DAV\\CardDAV\\Converter' => $baseDir . '/../lib/CardDAV/Converter.php',
73
-    'OCA\\DAV\\CardDAV\\HasPhotoPlugin' => $baseDir . '/../lib/CardDAV/HasPhotoPlugin.php',
74
-    'OCA\\DAV\\CardDAV\\ImageExportPlugin' => $baseDir . '/../lib/CardDAV/ImageExportPlugin.php',
75
-    'OCA\\DAV\\CardDAV\\MultiGetExportPlugin' => $baseDir . '/../lib/CardDAV/MultiGetExportPlugin.php',
76
-    'OCA\\DAV\\CardDAV\\PhotoCache' => $baseDir . '/../lib/CardDAV/PhotoCache.php',
77
-    'OCA\\DAV\\CardDAV\\Plugin' => $baseDir . '/../lib/CardDAV/Plugin.php',
78
-    'OCA\\DAV\\CardDAV\\SyncService' => $baseDir . '/../lib/CardDAV/SyncService.php',
79
-    'OCA\\DAV\\CardDAV\\SystemAddressbook' => $baseDir . '/../lib/CardDAV/SystemAddressbook.php',
80
-    'OCA\\DAV\\CardDAV\\UserAddressBooks' => $baseDir . '/../lib/CardDAV/UserAddressBooks.php',
81
-    'OCA\\DAV\\CardDAV\\Xml\\Groups' => $baseDir . '/../lib/CardDAV/Xml/Groups.php',
82
-    'OCA\\DAV\\Command\\CreateAddressBook' => $baseDir . '/../lib/Command/CreateAddressBook.php',
83
-    'OCA\\DAV\\Command\\CreateCalendar' => $baseDir . '/../lib/Command/CreateCalendar.php',
84
-    'OCA\\DAV\\Command\\ListCalendars' => $baseDir . '/../lib/Command/ListCalendars.php',
85
-    'OCA\\DAV\\Command\\MoveCalendar' => $baseDir . '/../lib/Command/MoveCalendar.php',
86
-    'OCA\\DAV\\Command\\RemoveInvalidShares' => $baseDir . '/../lib/Command/RemoveInvalidShares.php',
87
-    'OCA\\DAV\\Command\\SyncBirthdayCalendar' => $baseDir . '/../lib/Command/SyncBirthdayCalendar.php',
88
-    'OCA\\DAV\\Command\\SyncSystemAddressBook' => $baseDir . '/../lib/Command/SyncSystemAddressBook.php',
89
-    'OCA\\DAV\\Comments\\CommentNode' => $baseDir . '/../lib/Comments/CommentNode.php',
90
-    'OCA\\DAV\\Comments\\CommentsPlugin' => $baseDir . '/../lib/Comments/CommentsPlugin.php',
91
-    'OCA\\DAV\\Comments\\EntityCollection' => $baseDir . '/../lib/Comments/EntityCollection.php',
92
-    'OCA\\DAV\\Comments\\EntityTypeCollection' => $baseDir . '/../lib/Comments/EntityTypeCollection.php',
93
-    'OCA\\DAV\\Comments\\RootCollection' => $baseDir . '/../lib/Comments/RootCollection.php',
94
-    'OCA\\DAV\\Connector\\LegacyDAVACL' => $baseDir . '/../lib/Connector/LegacyDAVACL.php',
95
-    'OCA\\DAV\\Connector\\PublicAuth' => $baseDir . '/../lib/Connector/PublicAuth.php',
96
-    'OCA\\DAV\\Connector\\Sabre\\AnonymousOptionsPlugin' => $baseDir . '/../lib/Connector/Sabre/AnonymousOptionsPlugin.php',
97
-    'OCA\\DAV\\Connector\\Sabre\\AppEnabledPlugin' => $baseDir . '/../lib/Connector/Sabre/AppEnabledPlugin.php',
98
-    'OCA\\DAV\\Connector\\Sabre\\Auth' => $baseDir . '/../lib/Connector/Sabre/Auth.php',
99
-    'OCA\\DAV\\Connector\\Sabre\\BearerAuth' => $baseDir . '/../lib/Connector/Sabre/BearerAuth.php',
100
-    'OCA\\DAV\\Connector\\Sabre\\BlockLegacyClientPlugin' => $baseDir . '/../lib/Connector/Sabre/BlockLegacyClientPlugin.php',
101
-    'OCA\\DAV\\Connector\\Sabre\\CachingTree' => $baseDir . '/../lib/Connector/Sabre/CachingTree.php',
102
-    'OCA\\DAV\\Connector\\Sabre\\ChecksumList' => $baseDir . '/../lib/Connector/Sabre/ChecksumList.php',
103
-    'OCA\\DAV\\Connector\\Sabre\\CommentPropertiesPlugin' => $baseDir . '/../lib/Connector/Sabre/CommentPropertiesPlugin.php',
104
-    'OCA\\DAV\\Connector\\Sabre\\CopyEtagHeaderPlugin' => $baseDir . '/../lib/Connector/Sabre/CopyEtagHeaderPlugin.php',
105
-    'OCA\\DAV\\Connector\\Sabre\\CustomPropertiesBackend' => $baseDir . '/../lib/Connector/Sabre/CustomPropertiesBackend.php',
106
-    'OCA\\DAV\\Connector\\Sabre\\DavAclPlugin' => $baseDir . '/../lib/Connector/Sabre/DavAclPlugin.php',
107
-    'OCA\\DAV\\Connector\\Sabre\\Directory' => $baseDir . '/../lib/Connector/Sabre/Directory.php',
108
-    'OCA\\DAV\\Connector\\Sabre\\DummyGetResponsePlugin' => $baseDir . '/../lib/Connector/Sabre/DummyGetResponsePlugin.php',
109
-    'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' => $baseDir . '/../lib/Connector/Sabre/ExceptionLoggerPlugin.php',
110
-    'OCA\\DAV\\Connector\\Sabre\\Exception\\EntityTooLarge' => $baseDir . '/../lib/Connector/Sabre/Exception/EntityTooLarge.php',
111
-    'OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked' => $baseDir . '/../lib/Connector/Sabre/Exception/FileLocked.php',
112
-    'OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden' => $baseDir . '/../lib/Connector/Sabre/Exception/Forbidden.php',
113
-    'OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath' => $baseDir . '/../lib/Connector/Sabre/Exception/InvalidPath.php',
114
-    'OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden' => $baseDir . '/../lib/Connector/Sabre/Exception/PasswordLoginForbidden.php',
115
-    'OCA\\DAV\\Connector\\Sabre\\Exception\\UnsupportedMediaType' => $baseDir . '/../lib/Connector/Sabre/Exception/UnsupportedMediaType.php',
116
-    'OCA\\DAV\\Connector\\Sabre\\FakeLockerPlugin' => $baseDir . '/../lib/Connector/Sabre/FakeLockerPlugin.php',
117
-    'OCA\\DAV\\Connector\\Sabre\\File' => $baseDir . '/../lib/Connector/Sabre/File.php',
118
-    'OCA\\DAV\\Connector\\Sabre\\FilesPlugin' => $baseDir . '/../lib/Connector/Sabre/FilesPlugin.php',
119
-    'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => $baseDir . '/../lib/Connector/Sabre/FilesReportPlugin.php',
120
-    'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => $baseDir . '/../lib/Connector/Sabre/LockPlugin.php',
121
-    'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => $baseDir . '/../lib/Connector/Sabre/MaintenancePlugin.php',
122
-    'OCA\\DAV\\Connector\\Sabre\\Node' => $baseDir . '/../lib/Connector/Sabre/Node.php',
123
-    'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => $baseDir . '/../lib/Connector/Sabre/ObjectTree.php',
124
-    'OCA\\DAV\\Connector\\Sabre\\Principal' => $baseDir . '/../lib/Connector/Sabre/Principal.php',
125
-    'OCA\\DAV\\Connector\\Sabre\\QuotaPlugin' => $baseDir . '/../lib/Connector/Sabre/QuotaPlugin.php',
126
-    'OCA\\DAV\\Connector\\Sabre\\Server' => $baseDir . '/../lib/Connector/Sabre/Server.php',
127
-    'OCA\\DAV\\Connector\\Sabre\\ServerFactory' => $baseDir . '/../lib/Connector/Sabre/ServerFactory.php',
128
-    'OCA\\DAV\\Connector\\Sabre\\ShareTypeList' => $baseDir . '/../lib/Connector/Sabre/ShareTypeList.php',
129
-    'OCA\\DAV\\Connector\\Sabre\\SharesPlugin' => $baseDir . '/../lib/Connector/Sabre/SharesPlugin.php',
130
-    'OCA\\DAV\\Connector\\Sabre\\TagList' => $baseDir . '/../lib/Connector/Sabre/TagList.php',
131
-    'OCA\\DAV\\Connector\\Sabre\\TagsPlugin' => $baseDir . '/../lib/Connector/Sabre/TagsPlugin.php',
132
-    'OCA\\DAV\\Controller\\BirthdayCalendarController' => $baseDir . '/../lib/Controller/BirthdayCalendarController.php',
133
-    'OCA\\DAV\\Controller\\DirectController' => $baseDir . '/../lib/Controller/DirectController.php',
134
-    'OCA\\DAV\\Controller\\InvitationResponseController' => $baseDir . '/../lib/Controller/InvitationResponseController.php',
135
-    'OCA\\DAV\\DAV\\CustomPropertiesBackend' => $baseDir . '/../lib/DAV/CustomPropertiesBackend.php',
136
-    'OCA\\DAV\\DAV\\GroupPrincipalBackend' => $baseDir . '/../lib/DAV/GroupPrincipalBackend.php',
137
-    'OCA\\DAV\\DAV\\PublicAuth' => $baseDir . '/../lib/DAV/PublicAuth.php',
138
-    'OCA\\DAV\\DAV\\Sharing\\Backend' => $baseDir . '/../lib/DAV/Sharing/Backend.php',
139
-    'OCA\\DAV\\DAV\\Sharing\\IShareable' => $baseDir . '/../lib/DAV/Sharing/IShareable.php',
140
-    'OCA\\DAV\\DAV\\Sharing\\Plugin' => $baseDir . '/../lib/DAV/Sharing/Plugin.php',
141
-    'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite' => $baseDir . '/../lib/DAV/Sharing/Xml/Invite.php',
142
-    'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest' => $baseDir . '/../lib/DAV/Sharing/Xml/ShareRequest.php',
143
-    'OCA\\DAV\\DAV\\SystemPrincipalBackend' => $baseDir . '/../lib/DAV/SystemPrincipalBackend.php',
144
-    'OCA\\DAV\\Db\\Direct' => $baseDir . '/../lib/Db/Direct.php',
145
-    'OCA\\DAV\\Db\\DirectMapper' => $baseDir . '/../lib/Db/DirectMapper.php',
146
-    'OCA\\DAV\\Direct\\DirectFile' => $baseDir . '/../lib/Direct/DirectFile.php',
147
-    'OCA\\DAV\\Direct\\DirectHome' => $baseDir . '/../lib/Direct/DirectHome.php',
148
-    'OCA\\DAV\\Direct\\Server' => $baseDir . '/../lib/Direct/Server.php',
149
-    'OCA\\DAV\\Direct\\ServerFactory' => $baseDir . '/../lib/Direct/ServerFactory.php',
150
-    'OCA\\DAV\\Exception\\UnsupportedLimitOnInitialSyncException' => $baseDir . '/../lib/Exception/UnsupportedLimitOnInitialSyncException.php',
151
-    'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => $baseDir . '/../lib/Files/BrowserErrorPagePlugin.php',
152
-    'OCA\\DAV\\Files\\FileSearchBackend' => $baseDir . '/../lib/Files/FileSearchBackend.php',
153
-    'OCA\\DAV\\Files\\FilesHome' => $baseDir . '/../lib/Files/FilesHome.php',
154
-    'OCA\\DAV\\Files\\LazySearchBackend' => $baseDir . '/../lib/Files/LazySearchBackend.php',
155
-    'OCA\\DAV\\Files\\RootCollection' => $baseDir . '/../lib/Files/RootCollection.php',
156
-    'OCA\\DAV\\Files\\Sharing\\FilesDropPlugin' => $baseDir . '/../lib/Files/Sharing/FilesDropPlugin.php',
157
-    'OCA\\DAV\\Files\\Sharing\\PublicLinkCheckPlugin' => $baseDir . '/../lib/Files/Sharing/PublicLinkCheckPlugin.php',
158
-    'OCA\\DAV\\HookManager' => $baseDir . '/../lib/HookManager.php',
159
-    'OCA\\DAV\\Migration\\BuildCalendarSearchIndex' => $baseDir . '/../lib/Migration/BuildCalendarSearchIndex.php',
160
-    'OCA\\DAV\\Migration\\BuildCalendarSearchIndexBackgroundJob' => $baseDir . '/../lib/Migration/BuildCalendarSearchIndexBackgroundJob.php',
161
-    'OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue' => $baseDir . '/../lib/Migration/CalDAVRemoveEmptyValue.php',
162
-    'OCA\\DAV\\Migration\\ChunkCleanup' => $baseDir . '/../lib/Migration/ChunkCleanup.php',
163
-    'OCA\\DAV\\Migration\\FixBirthdayCalendarComponent' => $baseDir . '/../lib/Migration/FixBirthdayCalendarComponent.php',
164
-    'OCA\\DAV\\Migration\\RefreshWebcalJobRegistrar' => $baseDir . '/../lib/Migration/RefreshWebcalJobRegistrar.php',
165
-    'OCA\\DAV\\Migration\\RegenerateBirthdayCalendars' => $baseDir . '/../lib/Migration/RegenerateBirthdayCalendars.php',
166
-    'OCA\\DAV\\Migration\\RemoveClassifiedEventActivity' => $baseDir . '/../lib/Migration/RemoveClassifiedEventActivity.php',
167
-    'OCA\\DAV\\Migration\\RemoveOrphanEventsAndContacts' => $baseDir . '/../lib/Migration/RemoveOrphanEventsAndContacts.php',
168
-    'OCA\\DAV\\Migration\\Version1004Date20170825134824' => $baseDir . '/../lib/Migration/Version1004Date20170825134824.php',
169
-    'OCA\\DAV\\Migration\\Version1004Date20170919104507' => $baseDir . '/../lib/Migration/Version1004Date20170919104507.php',
170
-    'OCA\\DAV\\Migration\\Version1004Date20170924124212' => $baseDir . '/../lib/Migration/Version1004Date20170924124212.php',
171
-    'OCA\\DAV\\Migration\\Version1004Date20170926103422' => $baseDir . '/../lib/Migration/Version1004Date20170926103422.php',
172
-    'OCA\\DAV\\Migration\\Version1005Date20180413093149' => $baseDir . '/../lib/Migration/Version1005Date20180413093149.php',
173
-    'OCA\\DAV\\Migration\\Version1005Date20180530124431' => $baseDir . '/../lib/Migration/Version1005Date20180530124431.php',
174
-    'OCA\\DAV\\Migration\\Version1006Date20180619154313' => $baseDir . '/../lib/Migration/Version1006Date20180619154313.php',
175
-    'OCA\\DAV\\Migration\\Version1006Date20180628111625' => $baseDir . '/../lib/Migration/Version1006Date20180628111625.php',
176
-    'OCA\\DAV\\Migration\\Version1008Date20181030113700' => $baseDir . '/../lib/Migration/Version1008Date20181030113700.php',
177
-    'OCA\\DAV\\Migration\\Version1008Date20181105104826' => $baseDir . '/../lib/Migration/Version1008Date20181105104826.php',
178
-    'OCA\\DAV\\Migration\\Version1008Date20181105104833' => $baseDir . '/../lib/Migration/Version1008Date20181105104833.php',
179
-    'OCA\\DAV\\Migration\\Version1008Date20181105110300' => $baseDir . '/../lib/Migration/Version1008Date20181105110300.php',
180
-    'OCA\\DAV\\Migration\\Version1008Date20181105112049' => $baseDir . '/../lib/Migration/Version1008Date20181105112049.php',
181
-    'OCA\\DAV\\Migration\\Version1008Date20181114084440' => $baseDir . '/../lib/Migration/Version1008Date20181114084440.php',
182
-    'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningNode' => $baseDir . '/../lib/Provisioning/Apple/AppleProvisioningNode.php',
183
-    'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningPlugin' => $baseDir . '/../lib/Provisioning/Apple/AppleProvisioningPlugin.php',
184
-    'OCA\\DAV\\RootCollection' => $baseDir . '/../lib/RootCollection.php',
185
-    'OCA\\DAV\\Server' => $baseDir . '/../lib/Server.php',
186
-    'OCA\\DAV\\Settings\\CalDAVSettings' => $baseDir . '/../lib/Settings/CalDAVSettings.php',
187
-    'OCA\\DAV\\SystemTag\\SystemTagMappingNode' => $baseDir . '/../lib/SystemTag/SystemTagMappingNode.php',
188
-    'OCA\\DAV\\SystemTag\\SystemTagNode' => $baseDir . '/../lib/SystemTag/SystemTagNode.php',
189
-    'OCA\\DAV\\SystemTag\\SystemTagPlugin' => $baseDir . '/../lib/SystemTag/SystemTagPlugin.php',
190
-    'OCA\\DAV\\SystemTag\\SystemTagsByIdCollection' => $baseDir . '/../lib/SystemTag/SystemTagsByIdCollection.php',
191
-    'OCA\\DAV\\SystemTag\\SystemTagsObjectMappingCollection' => $baseDir . '/../lib/SystemTag/SystemTagsObjectMappingCollection.php',
192
-    'OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection' => $baseDir . '/../lib/SystemTag/SystemTagsObjectTypeCollection.php',
193
-    'OCA\\DAV\\SystemTag\\SystemTagsRelationsCollection' => $baseDir . '/../lib/SystemTag/SystemTagsRelationsCollection.php',
194
-    'OCA\\DAV\\Upload\\AssemblyStream' => $baseDir . '/../lib/Upload/AssemblyStream.php',
195
-    'OCA\\DAV\\Upload\\ChunkingPlugin' => $baseDir . '/../lib/Upload/ChunkingPlugin.php',
196
-    'OCA\\DAV\\Upload\\CleanupService' => $baseDir . '/../lib/Upload/CleanupService.php',
197
-    'OCA\\DAV\\Upload\\FutureFile' => $baseDir . '/../lib/Upload/FutureFile.php',
198
-    'OCA\\DAV\\Upload\\RootCollection' => $baseDir . '/../lib/Upload/RootCollection.php',
199
-    'OCA\\DAV\\Upload\\UploadFolder' => $baseDir . '/../lib/Upload/UploadFolder.php',
200
-    'OCA\\DAV\\Upload\\UploadHome' => $baseDir . '/../lib/Upload/UploadHome.php',
9
+    'OCA\\DAV\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php',
10
+    'OCA\\DAV\\AppInfo\\PluginManager' => $baseDir.'/../lib/AppInfo/PluginManager.php',
11
+    'OCA\\DAV\\Avatars\\AvatarHome' => $baseDir.'/../lib/Avatars/AvatarHome.php',
12
+    'OCA\\DAV\\Avatars\\AvatarNode' => $baseDir.'/../lib/Avatars/AvatarNode.php',
13
+    'OCA\\DAV\\Avatars\\RootCollection' => $baseDir.'/../lib/Avatars/RootCollection.php',
14
+    'OCA\\DAV\\BackgroundJob\\CleanupDirectLinksJob' => $baseDir.'/../lib/BackgroundJob/CleanupDirectLinksJob.php',
15
+    'OCA\\DAV\\BackgroundJob\\CleanupInvitationTokenJob' => $baseDir.'/../lib/BackgroundJob/CleanupInvitationTokenJob.php',
16
+    'OCA\\DAV\\BackgroundJob\\GenerateBirthdayCalendarBackgroundJob' => $baseDir.'/../lib/BackgroundJob/GenerateBirthdayCalendarBackgroundJob.php',
17
+    'OCA\\DAV\\BackgroundJob\\RefreshWebcalJob' => $baseDir.'/../lib/BackgroundJob/RefreshWebcalJob.php',
18
+    'OCA\\DAV\\BackgroundJob\\RegisterRegenerateBirthdayCalendars' => $baseDir.'/../lib/BackgroundJob/RegisterRegenerateBirthdayCalendars.php',
19
+    'OCA\\DAV\\BackgroundJob\\UpdateCalendarResourcesRoomsBackgroundJob' => $baseDir.'/../lib/BackgroundJob/UpdateCalendarResourcesRoomsBackgroundJob.php',
20
+    'OCA\\DAV\\BackgroundJob\\UploadCleanup' => $baseDir.'/../lib/BackgroundJob/UploadCleanup.php',
21
+    'OCA\\DAV\\CalDAV\\Activity\\Backend' => $baseDir.'/../lib/CalDAV/Activity/Backend.php',
22
+    'OCA\\DAV\\CalDAV\\Activity\\Filter\\Calendar' => $baseDir.'/../lib/CalDAV/Activity/Filter/Calendar.php',
23
+    'OCA\\DAV\\CalDAV\\Activity\\Filter\\Todo' => $baseDir.'/../lib/CalDAV/Activity/Filter/Todo.php',
24
+    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Base' => $baseDir.'/../lib/CalDAV/Activity/Provider/Base.php',
25
+    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Calendar' => $baseDir.'/../lib/CalDAV/Activity/Provider/Calendar.php',
26
+    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Event' => $baseDir.'/../lib/CalDAV/Activity/Provider/Event.php',
27
+    'OCA\\DAV\\CalDAV\\Activity\\Provider\\Todo' => $baseDir.'/../lib/CalDAV/Activity/Provider/Todo.php',
28
+    'OCA\\DAV\\CalDAV\\Activity\\Setting\\Calendar' => $baseDir.'/../lib/CalDAV/Activity/Setting/Calendar.php',
29
+    'OCA\\DAV\\CalDAV\\Activity\\Setting\\Event' => $baseDir.'/../lib/CalDAV/Activity/Setting/Event.php',
30
+    'OCA\\DAV\\CalDAV\\Activity\\Setting\\Todo' => $baseDir.'/../lib/CalDAV/Activity/Setting/Todo.php',
31
+    'OCA\\DAV\\CalDAV\\BirthdayCalendar\\EnablePlugin' => $baseDir.'/../lib/CalDAV/BirthdayCalendar/EnablePlugin.php',
32
+    'OCA\\DAV\\CalDAV\\BirthdayService' => $baseDir.'/../lib/CalDAV/BirthdayService.php',
33
+    'OCA\\DAV\\CalDAV\\CachedSubscription' => $baseDir.'/../lib/CalDAV/CachedSubscription.php',
34
+    'OCA\\DAV\\CalDAV\\CachedSubscriptionObject' => $baseDir.'/../lib/CalDAV/CachedSubscriptionObject.php',
35
+    'OCA\\DAV\\CalDAV\\CalDavBackend' => $baseDir.'/../lib/CalDAV/CalDavBackend.php',
36
+    'OCA\\DAV\\CalDAV\\Calendar' => $baseDir.'/../lib/CalDAV/Calendar.php',
37
+    'OCA\\DAV\\CalDAV\\CalendarHome' => $baseDir.'/../lib/CalDAV/CalendarHome.php',
38
+    'OCA\\DAV\\CalDAV\\CalendarImpl' => $baseDir.'/../lib/CalDAV/CalendarImpl.php',
39
+    'OCA\\DAV\\CalDAV\\CalendarManager' => $baseDir.'/../lib/CalDAV/CalendarManager.php',
40
+    'OCA\\DAV\\CalDAV\\CalendarObject' => $baseDir.'/../lib/CalDAV/CalendarObject.php',
41
+    'OCA\\DAV\\CalDAV\\CalendarRoot' => $baseDir.'/../lib/CalDAV/CalendarRoot.php',
42
+    'OCA\\DAV\\CalDAV\\InvitationResponse\\InvitationResponseServer' => $baseDir.'/../lib/CalDAV/InvitationResponse/InvitationResponseServer.php',
43
+    'OCA\\DAV\\CalDAV\\Outbox' => $baseDir.'/../lib/CalDAV/Outbox.php',
44
+    'OCA\\DAV\\CalDAV\\Plugin' => $baseDir.'/../lib/CalDAV/Plugin.php',
45
+    'OCA\\DAV\\CalDAV\\Principal\\Collection' => $baseDir.'/../lib/CalDAV/Principal/Collection.php',
46
+    'OCA\\DAV\\CalDAV\\Principal\\User' => $baseDir.'/../lib/CalDAV/Principal/User.php',
47
+    'OCA\\DAV\\CalDAV\\PublicCalendar' => $baseDir.'/../lib/CalDAV/PublicCalendar.php',
48
+    'OCA\\DAV\\CalDAV\\PublicCalendarObject' => $baseDir.'/../lib/CalDAV/PublicCalendarObject.php',
49
+    'OCA\\DAV\\CalDAV\\PublicCalendarRoot' => $baseDir.'/../lib/CalDAV/PublicCalendarRoot.php',
50
+    'OCA\\DAV\\CalDAV\\Publishing\\PublishPlugin' => $baseDir.'/../lib/CalDAV/Publishing/PublishPlugin.php',
51
+    'OCA\\DAV\\CalDAV\\Publishing\\Xml\\Publisher' => $baseDir.'/../lib/CalDAV/Publishing/Xml/Publisher.php',
52
+    'OCA\\DAV\\CalDAV\\ResourceBooking\\AbstractPrincipalBackend' => $baseDir.'/../lib/CalDAV/ResourceBooking/AbstractPrincipalBackend.php',
53
+    'OCA\\DAV\\CalDAV\\ResourceBooking\\ResourcePrincipalBackend' => $baseDir.'/../lib/CalDAV/ResourceBooking/ResourcePrincipalBackend.php',
54
+    'OCA\\DAV\\CalDAV\\ResourceBooking\\RoomPrincipalBackend' => $baseDir.'/../lib/CalDAV/ResourceBooking/RoomPrincipalBackend.php',
55
+    'OCA\\DAV\\CalDAV\\Schedule\\IMipPlugin' => $baseDir.'/../lib/CalDAV/Schedule/IMipPlugin.php',
56
+    'OCA\\DAV\\CalDAV\\Schedule\\Plugin' => $baseDir.'/../lib/CalDAV/Schedule/Plugin.php',
57
+    'OCA\\DAV\\CalDAV\\Search\\SearchPlugin' => $baseDir.'/../lib/CalDAV/Search/SearchPlugin.php',
58
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\CompFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/CompFilter.php',
59
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\LimitFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/LimitFilter.php',
60
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\OffsetFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/OffsetFilter.php',
61
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\ParamFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/ParamFilter.php',
62
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\PropFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/PropFilter.php',
63
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Filter\\SearchTermFilter' => $baseDir.'/../lib/CalDAV/Search/Xml/Filter/SearchTermFilter.php',
64
+    'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport' => $baseDir.'/../lib/CalDAV/Search/Xml/Request/CalendarSearchReport.php',
65
+    'OCA\\DAV\\CalDAV\\WebcalCaching\\Plugin' => $baseDir.'/../lib/CalDAV/WebcalCaching/Plugin.php',
66
+    'OCA\\DAV\\Capabilities' => $baseDir.'/../lib/Capabilities.php',
67
+    'OCA\\DAV\\CardDAV\\AddressBook' => $baseDir.'/../lib/CardDAV/AddressBook.php',
68
+    'OCA\\DAV\\CardDAV\\AddressBookImpl' => $baseDir.'/../lib/CardDAV/AddressBookImpl.php',
69
+    'OCA\\DAV\\CardDAV\\AddressBookRoot' => $baseDir.'/../lib/CardDAV/AddressBookRoot.php',
70
+    'OCA\\DAV\\CardDAV\\CardDavBackend' => $baseDir.'/../lib/CardDAV/CardDavBackend.php',
71
+    'OCA\\DAV\\CardDAV\\ContactsManager' => $baseDir.'/../lib/CardDAV/ContactsManager.php',
72
+    'OCA\\DAV\\CardDAV\\Converter' => $baseDir.'/../lib/CardDAV/Converter.php',
73
+    'OCA\\DAV\\CardDAV\\HasPhotoPlugin' => $baseDir.'/../lib/CardDAV/HasPhotoPlugin.php',
74
+    'OCA\\DAV\\CardDAV\\ImageExportPlugin' => $baseDir.'/../lib/CardDAV/ImageExportPlugin.php',
75
+    'OCA\\DAV\\CardDAV\\MultiGetExportPlugin' => $baseDir.'/../lib/CardDAV/MultiGetExportPlugin.php',
76
+    'OCA\\DAV\\CardDAV\\PhotoCache' => $baseDir.'/../lib/CardDAV/PhotoCache.php',
77
+    'OCA\\DAV\\CardDAV\\Plugin' => $baseDir.'/../lib/CardDAV/Plugin.php',
78
+    'OCA\\DAV\\CardDAV\\SyncService' => $baseDir.'/../lib/CardDAV/SyncService.php',
79
+    'OCA\\DAV\\CardDAV\\SystemAddressbook' => $baseDir.'/../lib/CardDAV/SystemAddressbook.php',
80
+    'OCA\\DAV\\CardDAV\\UserAddressBooks' => $baseDir.'/../lib/CardDAV/UserAddressBooks.php',
81
+    'OCA\\DAV\\CardDAV\\Xml\\Groups' => $baseDir.'/../lib/CardDAV/Xml/Groups.php',
82
+    'OCA\\DAV\\Command\\CreateAddressBook' => $baseDir.'/../lib/Command/CreateAddressBook.php',
83
+    'OCA\\DAV\\Command\\CreateCalendar' => $baseDir.'/../lib/Command/CreateCalendar.php',
84
+    'OCA\\DAV\\Command\\ListCalendars' => $baseDir.'/../lib/Command/ListCalendars.php',
85
+    'OCA\\DAV\\Command\\MoveCalendar' => $baseDir.'/../lib/Command/MoveCalendar.php',
86
+    'OCA\\DAV\\Command\\RemoveInvalidShares' => $baseDir.'/../lib/Command/RemoveInvalidShares.php',
87
+    'OCA\\DAV\\Command\\SyncBirthdayCalendar' => $baseDir.'/../lib/Command/SyncBirthdayCalendar.php',
88
+    'OCA\\DAV\\Command\\SyncSystemAddressBook' => $baseDir.'/../lib/Command/SyncSystemAddressBook.php',
89
+    'OCA\\DAV\\Comments\\CommentNode' => $baseDir.'/../lib/Comments/CommentNode.php',
90
+    'OCA\\DAV\\Comments\\CommentsPlugin' => $baseDir.'/../lib/Comments/CommentsPlugin.php',
91
+    'OCA\\DAV\\Comments\\EntityCollection' => $baseDir.'/../lib/Comments/EntityCollection.php',
92
+    'OCA\\DAV\\Comments\\EntityTypeCollection' => $baseDir.'/../lib/Comments/EntityTypeCollection.php',
93
+    'OCA\\DAV\\Comments\\RootCollection' => $baseDir.'/../lib/Comments/RootCollection.php',
94
+    'OCA\\DAV\\Connector\\LegacyDAVACL' => $baseDir.'/../lib/Connector/LegacyDAVACL.php',
95
+    'OCA\\DAV\\Connector\\PublicAuth' => $baseDir.'/../lib/Connector/PublicAuth.php',
96
+    'OCA\\DAV\\Connector\\Sabre\\AnonymousOptionsPlugin' => $baseDir.'/../lib/Connector/Sabre/AnonymousOptionsPlugin.php',
97
+    'OCA\\DAV\\Connector\\Sabre\\AppEnabledPlugin' => $baseDir.'/../lib/Connector/Sabre/AppEnabledPlugin.php',
98
+    'OCA\\DAV\\Connector\\Sabre\\Auth' => $baseDir.'/../lib/Connector/Sabre/Auth.php',
99
+    'OCA\\DAV\\Connector\\Sabre\\BearerAuth' => $baseDir.'/../lib/Connector/Sabre/BearerAuth.php',
100
+    'OCA\\DAV\\Connector\\Sabre\\BlockLegacyClientPlugin' => $baseDir.'/../lib/Connector/Sabre/BlockLegacyClientPlugin.php',
101
+    'OCA\\DAV\\Connector\\Sabre\\CachingTree' => $baseDir.'/../lib/Connector/Sabre/CachingTree.php',
102
+    'OCA\\DAV\\Connector\\Sabre\\ChecksumList' => $baseDir.'/../lib/Connector/Sabre/ChecksumList.php',
103
+    'OCA\\DAV\\Connector\\Sabre\\CommentPropertiesPlugin' => $baseDir.'/../lib/Connector/Sabre/CommentPropertiesPlugin.php',
104
+    'OCA\\DAV\\Connector\\Sabre\\CopyEtagHeaderPlugin' => $baseDir.'/../lib/Connector/Sabre/CopyEtagHeaderPlugin.php',
105
+    'OCA\\DAV\\Connector\\Sabre\\CustomPropertiesBackend' => $baseDir.'/../lib/Connector/Sabre/CustomPropertiesBackend.php',
106
+    'OCA\\DAV\\Connector\\Sabre\\DavAclPlugin' => $baseDir.'/../lib/Connector/Sabre/DavAclPlugin.php',
107
+    'OCA\\DAV\\Connector\\Sabre\\Directory' => $baseDir.'/../lib/Connector/Sabre/Directory.php',
108
+    'OCA\\DAV\\Connector\\Sabre\\DummyGetResponsePlugin' => $baseDir.'/../lib/Connector/Sabre/DummyGetResponsePlugin.php',
109
+    'OCA\\DAV\\Connector\\Sabre\\ExceptionLoggerPlugin' => $baseDir.'/../lib/Connector/Sabre/ExceptionLoggerPlugin.php',
110
+    'OCA\\DAV\\Connector\\Sabre\\Exception\\EntityTooLarge' => $baseDir.'/../lib/Connector/Sabre/Exception/EntityTooLarge.php',
111
+    'OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked' => $baseDir.'/../lib/Connector/Sabre/Exception/FileLocked.php',
112
+    'OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden' => $baseDir.'/../lib/Connector/Sabre/Exception/Forbidden.php',
113
+    'OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath' => $baseDir.'/../lib/Connector/Sabre/Exception/InvalidPath.php',
114
+    'OCA\\DAV\\Connector\\Sabre\\Exception\\PasswordLoginForbidden' => $baseDir.'/../lib/Connector/Sabre/Exception/PasswordLoginForbidden.php',
115
+    'OCA\\DAV\\Connector\\Sabre\\Exception\\UnsupportedMediaType' => $baseDir.'/../lib/Connector/Sabre/Exception/UnsupportedMediaType.php',
116
+    'OCA\\DAV\\Connector\\Sabre\\FakeLockerPlugin' => $baseDir.'/../lib/Connector/Sabre/FakeLockerPlugin.php',
117
+    'OCA\\DAV\\Connector\\Sabre\\File' => $baseDir.'/../lib/Connector/Sabre/File.php',
118
+    'OCA\\DAV\\Connector\\Sabre\\FilesPlugin' => $baseDir.'/../lib/Connector/Sabre/FilesPlugin.php',
119
+    'OCA\\DAV\\Connector\\Sabre\\FilesReportPlugin' => $baseDir.'/../lib/Connector/Sabre/FilesReportPlugin.php',
120
+    'OCA\\DAV\\Connector\\Sabre\\LockPlugin' => $baseDir.'/../lib/Connector/Sabre/LockPlugin.php',
121
+    'OCA\\DAV\\Connector\\Sabre\\MaintenancePlugin' => $baseDir.'/../lib/Connector/Sabre/MaintenancePlugin.php',
122
+    'OCA\\DAV\\Connector\\Sabre\\Node' => $baseDir.'/../lib/Connector/Sabre/Node.php',
123
+    'OCA\\DAV\\Connector\\Sabre\\ObjectTree' => $baseDir.'/../lib/Connector/Sabre/ObjectTree.php',
124
+    'OCA\\DAV\\Connector\\Sabre\\Principal' => $baseDir.'/../lib/Connector/Sabre/Principal.php',
125
+    'OCA\\DAV\\Connector\\Sabre\\QuotaPlugin' => $baseDir.'/../lib/Connector/Sabre/QuotaPlugin.php',
126
+    'OCA\\DAV\\Connector\\Sabre\\Server' => $baseDir.'/../lib/Connector/Sabre/Server.php',
127
+    'OCA\\DAV\\Connector\\Sabre\\ServerFactory' => $baseDir.'/../lib/Connector/Sabre/ServerFactory.php',
128
+    'OCA\\DAV\\Connector\\Sabre\\ShareTypeList' => $baseDir.'/../lib/Connector/Sabre/ShareTypeList.php',
129
+    'OCA\\DAV\\Connector\\Sabre\\SharesPlugin' => $baseDir.'/../lib/Connector/Sabre/SharesPlugin.php',
130
+    'OCA\\DAV\\Connector\\Sabre\\TagList' => $baseDir.'/../lib/Connector/Sabre/TagList.php',
131
+    'OCA\\DAV\\Connector\\Sabre\\TagsPlugin' => $baseDir.'/../lib/Connector/Sabre/TagsPlugin.php',
132
+    'OCA\\DAV\\Controller\\BirthdayCalendarController' => $baseDir.'/../lib/Controller/BirthdayCalendarController.php',
133
+    'OCA\\DAV\\Controller\\DirectController' => $baseDir.'/../lib/Controller/DirectController.php',
134
+    'OCA\\DAV\\Controller\\InvitationResponseController' => $baseDir.'/../lib/Controller/InvitationResponseController.php',
135
+    'OCA\\DAV\\DAV\\CustomPropertiesBackend' => $baseDir.'/../lib/DAV/CustomPropertiesBackend.php',
136
+    'OCA\\DAV\\DAV\\GroupPrincipalBackend' => $baseDir.'/../lib/DAV/GroupPrincipalBackend.php',
137
+    'OCA\\DAV\\DAV\\PublicAuth' => $baseDir.'/../lib/DAV/PublicAuth.php',
138
+    'OCA\\DAV\\DAV\\Sharing\\Backend' => $baseDir.'/../lib/DAV/Sharing/Backend.php',
139
+    'OCA\\DAV\\DAV\\Sharing\\IShareable' => $baseDir.'/../lib/DAV/Sharing/IShareable.php',
140
+    'OCA\\DAV\\DAV\\Sharing\\Plugin' => $baseDir.'/../lib/DAV/Sharing/Plugin.php',
141
+    'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite' => $baseDir.'/../lib/DAV/Sharing/Xml/Invite.php',
142
+    'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest' => $baseDir.'/../lib/DAV/Sharing/Xml/ShareRequest.php',
143
+    'OCA\\DAV\\DAV\\SystemPrincipalBackend' => $baseDir.'/../lib/DAV/SystemPrincipalBackend.php',
144
+    'OCA\\DAV\\Db\\Direct' => $baseDir.'/../lib/Db/Direct.php',
145
+    'OCA\\DAV\\Db\\DirectMapper' => $baseDir.'/../lib/Db/DirectMapper.php',
146
+    'OCA\\DAV\\Direct\\DirectFile' => $baseDir.'/../lib/Direct/DirectFile.php',
147
+    'OCA\\DAV\\Direct\\DirectHome' => $baseDir.'/../lib/Direct/DirectHome.php',
148
+    'OCA\\DAV\\Direct\\Server' => $baseDir.'/../lib/Direct/Server.php',
149
+    'OCA\\DAV\\Direct\\ServerFactory' => $baseDir.'/../lib/Direct/ServerFactory.php',
150
+    'OCA\\DAV\\Exception\\UnsupportedLimitOnInitialSyncException' => $baseDir.'/../lib/Exception/UnsupportedLimitOnInitialSyncException.php',
151
+    'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => $baseDir.'/../lib/Files/BrowserErrorPagePlugin.php',
152
+    'OCA\\DAV\\Files\\FileSearchBackend' => $baseDir.'/../lib/Files/FileSearchBackend.php',
153
+    'OCA\\DAV\\Files\\FilesHome' => $baseDir.'/../lib/Files/FilesHome.php',
154
+    'OCA\\DAV\\Files\\LazySearchBackend' => $baseDir.'/../lib/Files/LazySearchBackend.php',
155
+    'OCA\\DAV\\Files\\RootCollection' => $baseDir.'/../lib/Files/RootCollection.php',
156
+    'OCA\\DAV\\Files\\Sharing\\FilesDropPlugin' => $baseDir.'/../lib/Files/Sharing/FilesDropPlugin.php',
157
+    'OCA\\DAV\\Files\\Sharing\\PublicLinkCheckPlugin' => $baseDir.'/../lib/Files/Sharing/PublicLinkCheckPlugin.php',
158
+    'OCA\\DAV\\HookManager' => $baseDir.'/../lib/HookManager.php',
159
+    'OCA\\DAV\\Migration\\BuildCalendarSearchIndex' => $baseDir.'/../lib/Migration/BuildCalendarSearchIndex.php',
160
+    'OCA\\DAV\\Migration\\BuildCalendarSearchIndexBackgroundJob' => $baseDir.'/../lib/Migration/BuildCalendarSearchIndexBackgroundJob.php',
161
+    'OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue' => $baseDir.'/../lib/Migration/CalDAVRemoveEmptyValue.php',
162
+    'OCA\\DAV\\Migration\\ChunkCleanup' => $baseDir.'/../lib/Migration/ChunkCleanup.php',
163
+    'OCA\\DAV\\Migration\\FixBirthdayCalendarComponent' => $baseDir.'/../lib/Migration/FixBirthdayCalendarComponent.php',
164
+    'OCA\\DAV\\Migration\\RefreshWebcalJobRegistrar' => $baseDir.'/../lib/Migration/RefreshWebcalJobRegistrar.php',
165
+    'OCA\\DAV\\Migration\\RegenerateBirthdayCalendars' => $baseDir.'/../lib/Migration/RegenerateBirthdayCalendars.php',
166
+    'OCA\\DAV\\Migration\\RemoveClassifiedEventActivity' => $baseDir.'/../lib/Migration/RemoveClassifiedEventActivity.php',
167
+    'OCA\\DAV\\Migration\\RemoveOrphanEventsAndContacts' => $baseDir.'/../lib/Migration/RemoveOrphanEventsAndContacts.php',
168
+    'OCA\\DAV\\Migration\\Version1004Date20170825134824' => $baseDir.'/../lib/Migration/Version1004Date20170825134824.php',
169
+    'OCA\\DAV\\Migration\\Version1004Date20170919104507' => $baseDir.'/../lib/Migration/Version1004Date20170919104507.php',
170
+    'OCA\\DAV\\Migration\\Version1004Date20170924124212' => $baseDir.'/../lib/Migration/Version1004Date20170924124212.php',
171
+    'OCA\\DAV\\Migration\\Version1004Date20170926103422' => $baseDir.'/../lib/Migration/Version1004Date20170926103422.php',
172
+    'OCA\\DAV\\Migration\\Version1005Date20180413093149' => $baseDir.'/../lib/Migration/Version1005Date20180413093149.php',
173
+    'OCA\\DAV\\Migration\\Version1005Date20180530124431' => $baseDir.'/../lib/Migration/Version1005Date20180530124431.php',
174
+    'OCA\\DAV\\Migration\\Version1006Date20180619154313' => $baseDir.'/../lib/Migration/Version1006Date20180619154313.php',
175
+    'OCA\\DAV\\Migration\\Version1006Date20180628111625' => $baseDir.'/../lib/Migration/Version1006Date20180628111625.php',
176
+    'OCA\\DAV\\Migration\\Version1008Date20181030113700' => $baseDir.'/../lib/Migration/Version1008Date20181030113700.php',
177
+    'OCA\\DAV\\Migration\\Version1008Date20181105104826' => $baseDir.'/../lib/Migration/Version1008Date20181105104826.php',
178
+    'OCA\\DAV\\Migration\\Version1008Date20181105104833' => $baseDir.'/../lib/Migration/Version1008Date20181105104833.php',
179
+    'OCA\\DAV\\Migration\\Version1008Date20181105110300' => $baseDir.'/../lib/Migration/Version1008Date20181105110300.php',
180
+    'OCA\\DAV\\Migration\\Version1008Date20181105112049' => $baseDir.'/../lib/Migration/Version1008Date20181105112049.php',
181
+    'OCA\\DAV\\Migration\\Version1008Date20181114084440' => $baseDir.'/../lib/Migration/Version1008Date20181114084440.php',
182
+    'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningNode' => $baseDir.'/../lib/Provisioning/Apple/AppleProvisioningNode.php',
183
+    'OCA\\DAV\\Provisioning\\Apple\\AppleProvisioningPlugin' => $baseDir.'/../lib/Provisioning/Apple/AppleProvisioningPlugin.php',
184
+    'OCA\\DAV\\RootCollection' => $baseDir.'/../lib/RootCollection.php',
185
+    'OCA\\DAV\\Server' => $baseDir.'/../lib/Server.php',
186
+    'OCA\\DAV\\Settings\\CalDAVSettings' => $baseDir.'/../lib/Settings/CalDAVSettings.php',
187
+    'OCA\\DAV\\SystemTag\\SystemTagMappingNode' => $baseDir.'/../lib/SystemTag/SystemTagMappingNode.php',
188
+    'OCA\\DAV\\SystemTag\\SystemTagNode' => $baseDir.'/../lib/SystemTag/SystemTagNode.php',
189
+    'OCA\\DAV\\SystemTag\\SystemTagPlugin' => $baseDir.'/../lib/SystemTag/SystemTagPlugin.php',
190
+    'OCA\\DAV\\SystemTag\\SystemTagsByIdCollection' => $baseDir.'/../lib/SystemTag/SystemTagsByIdCollection.php',
191
+    'OCA\\DAV\\SystemTag\\SystemTagsObjectMappingCollection' => $baseDir.'/../lib/SystemTag/SystemTagsObjectMappingCollection.php',
192
+    'OCA\\DAV\\SystemTag\\SystemTagsObjectTypeCollection' => $baseDir.'/../lib/SystemTag/SystemTagsObjectTypeCollection.php',
193
+    'OCA\\DAV\\SystemTag\\SystemTagsRelationsCollection' => $baseDir.'/../lib/SystemTag/SystemTagsRelationsCollection.php',
194
+    'OCA\\DAV\\Upload\\AssemblyStream' => $baseDir.'/../lib/Upload/AssemblyStream.php',
195
+    'OCA\\DAV\\Upload\\ChunkingPlugin' => $baseDir.'/../lib/Upload/ChunkingPlugin.php',
196
+    'OCA\\DAV\\Upload\\CleanupService' => $baseDir.'/../lib/Upload/CleanupService.php',
197
+    'OCA\\DAV\\Upload\\FutureFile' => $baseDir.'/../lib/Upload/FutureFile.php',
198
+    'OCA\\DAV\\Upload\\RootCollection' => $baseDir.'/../lib/Upload/RootCollection.php',
199
+    'OCA\\DAV\\Upload\\UploadFolder' => $baseDir.'/../lib/Upload/UploadFolder.php',
200
+    'OCA\\DAV\\Upload\\UploadHome' => $baseDir.'/../lib/Upload/UploadHome.php',
201 201
 );
Please login to merge, or discard this patch.