Code Duplication    Length = 8-9 lines in 2 locations

lib/private/Share20/Manager.php 1 location

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

lib/private/legacy/util.php 1 location

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