Use ShareManager to determine shares of unlocatable LDAP users and fix an issue in a condition #23700
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
When LDAP users are found as deleted in occ ldap:show-remnants it is displayed whether a listed user was also a sharer. A Y(es) or N(o) is shown in that column. Example:
I was made aware that a condition failed to show it properly, if a user had more than one share 🙈 In the old code (mostly unchanged since 2014) also the relevant share tables were queried directly, as the share manager was not in place. This is updated in this PR as well.
Some refactorings are necessary, for instance moving logic from the OfflineUsers constructor. This allows for unit tests, but makes the instance also more lazy in gathering info on that user. Some further code cleanup was while some class signatures needed change. Leaving changed and added tests aside, about 20 LoC are saved.
The first three commits are essentially the base of the fix for NC 20 and below (PR coming in a bit).