[TECHNICAL SUPPORT] LPS-30715 Fix User selection problem on non default shard

Hi Laci,

I resend this PR to you based on your comments from https://github.com/laszlocsontos/liferay-portal/pull/17

I made the requested modifications, and retested the fix again.

If you have any concerns please let me know.

Cheers,
Vili