[ticket/11626] Remove LDAP dependency on template

Returns template vars rather than requiring the template.

PHPBB3-11626