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

@@ 1405-1413 (lines=9) @@
1402
			}
1403
			$user = $this->userManager->get($userId);
1404
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1405
			if (!empty($usersGroups)) {
1406
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
1407
				// if the user is only in groups which are disabled for sharing then
1408
				// sharing is also disabled for the user
1409
				if (empty($remainingGroups)) {
1410
					$this->sharingDisabledForUsersCache[$userId] = true;
1411
					return true;
1412
				}
1413
			}
1414
		}
1415
1416
		$this->sharingDisabledForUsersCache[$userId] = false;