Code Duplication    Length = 8-9 lines in 2 locations

lib/private/Share20/Manager.php 1 location

@@ 1283-1291 (lines=9) @@
1280
			}
1281
			$user = $this->userManager->get($userId);
1282
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1283
			if (!empty($usersGroups)) {
1284
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
1285
				// if the user is only in groups which are disabled for sharing then
1286
				// sharing is also disabled for the user
1287
				if (empty($remainingGroups)) {
1288
					$this->sharingDisabledForUsersCache[$userId] = true;
1289
					return true;
1290
				}
1291
			}
1292
		}
1293
1294
		$this->sharingDisabledForUsersCache[$userId] = false;

lib/private/legacy/util.php 1 location

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