Code Duplication    Length = 8-8 lines in 2 locations

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

@@ 217-224 (lines=8) @@
214
		// If sharing is restricted to group members only,
215
		// return only members that have groups in common
216
		$restrictGroups = false;
217
		if ($this->shareManager->shareWithGroupMembersOnly()) {
218
			$user = $this->userSession->getUser();
219
			if (!$user) {
220
				return [];
221
			}
222
223
			$restrictGroups = $this->groupManager->getUserGroupIds($user);
224
		}
225
226
		foreach ($searchProperties as $prop => $value) {
227
			switch ($prop) {
@@ 301-308 (lines=8) @@
298
		// If sharing is restricted to group members only,
299
		// return only members that have groups in common
300
		$restrictGroups = false;
301
		if ($this->shareManager->shareWithGroupMembersOnly()) {
302
			$user = $this->userSession->getUser();
303
			if (!$user) {
304
				return null;
305
			}
306
307
			$restrictGroups = $this->groupManager->getUserGroupIds($user);
308
		}
309
310
		if (strpos($uri, 'mailto:') === 0) {
311
			if ($principalPrefix === 'principals/users') {