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

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