Code Duplication    Length = 8-9 lines in 2 locations

lib/private/legacy/util.php 1 location

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

lib/private/Share20/Manager.php 1 location

@@ 1588-1596 (lines=9) @@
1585
			}
1586
			$user = $this->userManager->get($userId);
1587
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1588
			if (!empty($usersGroups)) {
1589
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
1590
				// if the user is only in groups which are disabled for sharing then
1591
				// sharing is also disabled for the user
1592
				if (empty($remainingGroups)) {
1593
					$this->sharingDisabledForUsersCache[$userId] = true;
1594
					return true;
1595
				}
1596
			}
1597
		}
1598
1599
		$this->sharingDisabledForUsersCache[$userId] = false;