Code Duplication    Length = 8-8 lines in 2 locations

apps/dav/lib/Connector/Sabre/Principal.php 2 locations

@@ 224-231 (lines=8) @@
221
		// If sharing is restricted to group members only,
222
		// return only members that have groups in common
223
		$restrictGroups = false;
224
		if ($this->shareManager->shareWithGroupMembersOnly()) {
225
			$user = $this->userSession->getUser();
226
			if (!$user) {
227
				return [];
228
			}
229
230
			$restrictGroups = $this->groupManager->getUserGroupIds($user);
231
		}
232
233
		foreach ($searchProperties as $prop => $value) {
234
			switch ($prop) {
@@ 309-316 (lines=8) @@
306
		// If sharing is restricted to group members only,
307
		// return only members that have groups in common
308
		$restrictGroups = false;
309
		if ($this->shareManager->shareWithGroupMembersOnly()) {
310
			$user = $this->userSession->getUser();
311
			if (!$user) {
312
				return null;
313
			}
314
315
			$restrictGroups = $this->groupManager->getUserGroupIds($user);
316
		}
317
318
		if (strpos($uri, 'mailto:') === 0) {
319
			if ($principalPrefix === 'principals/users') {