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

@@ 1165-1172 (lines=8) @@
1162
			}
1163
			$user = $this->userManager->get($userId);
1164
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1165
			if (!empty($usersGroups)) {
1166
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
1167
				// if the user is only in groups which are disabled for sharing then
1168
				// sharing is also disabled for the user
1169
				if (empty($remainingGroups)) {
1170
					return true;
1171
				}
1172
			}
1173
		}
1174
		return false;
1175
	}