Code Duplication    Length = 8-9 lines in 2 locations

lib/private/Share20/Manager.php 1 location

@@ 1533-1541 (lines=9) @@
1530
			}
1531
			$user = $this->userManager->get($userId);
1532
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1533
			if (!empty($usersGroups)) {
1534
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
1535
				// if the user is only in groups which are disabled for sharing then
1536
				// sharing is also disabled for the user
1537
				if (empty($remainingGroups)) {
1538
					$this->sharingDisabledForUsersCache[$userId] = true;
1539
					return true;
1540
				}
1541
			}
1542
		}
1543
1544
		$this->sharingDisabledForUsersCache[$userId] = false;

lib/private/legacy/util.php 1 location

@@ 324-331 (lines=8) @@
321
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
322
			}
323
			$usersGroups = $groupManager->getUserGroupIds($user);
324
			if (!empty($usersGroups)) {
325
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
326
				// if the user is only in groups which are disabled for sharing then
327
				// sharing is also disabled for the user
328
				if (empty($remainingGroups)) {
329
					return true;
330
				}
331
			}
332
		}
333
		return false;
334
	}