[ticket/12426] Rework of user search

Additional test added so the ssql queries are set if we use
CPF

PHPBB3-12426