Provides a common way to determine current affiliate.
Merge pull request #3247 from sergii-tkachenko/determine-current-affiliate

Provides a common way to determine current affiliate.