Refactor without changing logic
Pull variable up as method parameter for reuse
Throw the exception UnexpectedWebsiteFoundException instead of default exception
Make exception more specific and throw only when site was invalid
New method getAllUsersPreferences and test
Fixes #6672 Pre-process custom date ranges when any user has this selected in preferences, and pre-process for ALL websites this user has access to, in case he selects "All websites" dashboard
Merge pull request #6856 from piwik/6672_preprocess_ranges

during core:archive console command, preprocess any custom date ranges that were selected in any User's Preferences