Code Duplication    Length = 8-9 lines in 2 locations

lib/private/legacy/util.php 1 location

@@ 333-340 (lines=8) @@
330
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
331
			}
332
			$usersGroups = $groupManager->getUserGroupIds($user);
333
			if (!empty($usersGroups)) {
334
				$remainingGroups = \array_diff($usersGroups, $excludedGroups);
335
				// if the user is only in groups which are disabled for sharing then
336
				// sharing is also disabled for the user
337
				if (empty($remainingGroups)) {
338
					return true;
339
				}
340
			}
341
		}
342
		return false;
343
	}

lib/private/Share20/Manager.php 1 location

@@ 1419-1427 (lines=9) @@
1416
			}
1417
			$user = $this->userManager->get($userId);
1418
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1419
			if (!empty($usersGroups)) {
1420
				$remainingGroups = \array_diff($usersGroups, $excludedGroups);
1421
				// if the user is only in groups which are disabled for sharing then
1422
				// sharing is also disabled for the user
1423
				if (empty($remainingGroups)) {
1424
					$this->sharingDisabledForUsersCache[$userId] = true;
1425
					return true;
1426
				}
1427
			}
1428
		}
1429
1430
		$this->sharingDisabledForUsersCache[$userId] = false;