Refactor of import_users in LDAP plugin to use a separate function