Code Duplication    Length = 8-9 lines in 2 locations

lib/private/Share20/Manager.php 1 location

@@ 1410-1418 (lines=9) @@
1407
			}
1408
			$user = $this->userManager->get($userId);
1409
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1410
			if (!empty($usersGroups)) {
1411
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
1412
				// if the user is only in groups which are disabled for sharing then
1413
				// sharing is also disabled for the user
1414
				if (empty($remainingGroups)) {
1415
					$this->sharingDisabledForUsersCache[$userId] = true;
1416
					return true;
1417
				}
1418
			}
1419
		}
1420
1421
		$this->sharingDisabledForUsersCache[$userId] = false;

lib/private/legacy/util.php 1 location

@@ 316-323 (lines=8) @@
313
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
314
			}
315
			$usersGroups = $groupManager->getUserGroupIds($user);
316
			if (!empty($usersGroups)) {
317
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
318
				// if the user is only in groups which are disabled for sharing then
319
				// sharing is also disabled for the user
320
				if (empty($remainingGroups)) {
321
					return true;
322
				}
323
			}
324
		}
325
		return false;
326
	}