Code Duplication    Length = 8-9 lines in 2 locations

lib/private/legacy/util.php 1 location

@@ 342-349 (lines=8) @@
339
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
340
			}
341
			$usersGroups = $groupManager->getUserGroupIds($user);
342
			if (!empty($usersGroups)) {
343
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
344
				// if the user is only in groups which are disabled for sharing then
345
				// sharing is also disabled for the user
346
				if (empty($remainingGroups)) {
347
					return true;
348
				}
349
			}
350
		}
351
		return false;
352
	}

lib/private/Share20/Manager.php 1 location

@@ 1564-1572 (lines=9) @@
1561
			}
1562
			$user = $this->userManager->get($userId);
1563
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1564
			if (!empty($usersGroups)) {
1565
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
1566
				// if the user is only in groups which are disabled for sharing then
1567
				// sharing is also disabled for the user
1568
				if (empty($remainingGroups)) {
1569
					$this->sharingDisabledForUsersCache[$userId] = true;
1570
					return true;
1571
				}
1572
			}
1573
		}
1574
1575
		$this->sharingDisabledForUsersCache[$userId] = false;