Code Duplication    Length = 8-9 lines in 2 locations

lib/private/legacy/util.php 1 location

@@ 271-278 (lines=8) @@
268
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
269
			}
270
			$usersGroups = $groupManager->getUserGroupIds($user);
271
			if (!empty($usersGroups)) {
272
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
273
				// if the user is only in groups which are disabled for sharing then
274
				// sharing is also disabled for the user
275
				if (empty($remainingGroups)) {
276
					return true;
277
				}
278
			}
279
		}
280
		return false;
281
	}

lib/private/Share20/Manager.php 1 location

@@ 1319-1327 (lines=9) @@
1316
			}
1317
			$user = $this->userManager->get($userId);
1318
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1319
			if (!empty($usersGroups)) {
1320
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
1321
				// if the user is only in groups which are disabled for sharing then
1322
				// sharing is also disabled for the user
1323
				if (empty($remainingGroups)) {
1324
					$this->sharingDisabledForUsersCache[$userId] = true;
1325
					return true;
1326
				}
1327
			}
1328
		}
1329
1330
		$this->sharingDisabledForUsersCache[$userId] = false;