Code Duplication    Length = 8-9 lines in 2 locations

lib/private/legacy/util.php 1 location

@@ 261-268 (lines=8) @@
258
				$config->setAppValue('core', 'shareapi_exclude_groups_list', $newValue);
259
			}
260
			$usersGroups = $groupManager->getUserGroupIds($user);
261
			if (!empty($usersGroups)) {
262
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
263
				// if the user is only in groups which are disabled for sharing then
264
				// sharing is also disabled for the user
265
				if (empty($remainingGroups)) {
266
					return true;
267
				}
268
			}
269
		}
270
		return false;
271
	}

lib/private/Share20/Manager.php 1 location

@@ 1236-1244 (lines=9) @@
1233
			}
1234
			$user = $this->userManager->get($userId);
1235
			$usersGroups = $this->groupManager->getUserGroupIds($user);
1236
			if (!empty($usersGroups)) {
1237
				$remainingGroups = array_diff($usersGroups, $excludedGroups);
1238
				// if the user is only in groups which are disabled for sharing then
1239
				// sharing is also disabled for the user
1240
				if (empty($remainingGroups)) {
1241
					$this->sharingDisabledForUsersCache[$userId] = true;
1242
					return true;
1243
				}
1244
			}
1245
		}
1246
1247
		$this->sharingDisabledForUsersCache[$userId] = false;