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

@@ 1155-1162 (lines=8) @@
1152
			}
1153
			$user = $this->userManager->get($userId);
1154
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1155
			if (!empty($usersGroups)) {
1156
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
1157
				// if the user is only in groups which are disabled for sharing then
1158
				// sharing is also disabled for the user
1159
				if (empty($remainingGroups)) {
1160
					return true;
1161
				}
1162
			}
1163
		}
1164
		return false;
1165
	}