Code Duplication    Length = 8-8 lines in 2 locations

lib/private/util.php 1 location

@@ 254-261 (lines=8) @@
251
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
252
			}
253
			$usersGroups = $groupManager->getUserGroupIds($user);
254
			if (!empty($usersGroups)) {
255
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
256
				// if the user is only in groups which are disabled for sharing then
257
				// sharing is also disabled for the user
258
				if (empty($remainingGroups)) {
259
					return true;
260
				}
261
			}
262
		}
263
		return false;
264
	}

lib/private/share20/manager.php 1 location

@@ 1175-1182 (lines=8) @@
1172
			}
1173
			$user = $this->userManager->get($userId);
1174
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1175
			if (!empty($usersGroups)) {
1176
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
1177
				// if the user is only in groups which are disabled for sharing then
1178
				// sharing is also disabled for the user
1179
				if (empty($remainingGroups)) {
1180
					return true;
1181
				}
1182
			}
1183
		}
1184
		return false;
1185
	}