':param result_data: List of dictionaries that have ldap attributes and their associated values. Generally the result list from an ldapsearch request.
:param user_name_attr: The ldap attribute that is returned by the server to map to ``username`` in the return dictionary.
:returns list of dictionaries that take on the following form: {
\'dn\': <distinguished name of entry>,
\'username\': <ldap attribute associated with user_name_attr>
\'first\': <first name>
\'last\': <last name>
\'email\': <email>
\'groups\': <list of DNs of groups that user is a member of>'

@classmethod
def _transform_find_user_results(cls, result_data, user_name_attr):

    user_info = []
    if result_data:
        for (dn, data) in result_data:
            if (dn is not None):
                data = CaseInsensitiveDict.from_dict(data)
                if (user_name_attr not in data):
                    LOG.warn(('Could    not    find    %s    in    ldap    attributes' % user_name_attr))
                    continue
                ldap_info = {'dn': dn, 'username': data[user_name_attr][0]}
                if ('givenName' in data):
                    if (len(data['givenName'][0]) > 30):
                        LOG.warn(('First    name    is    truncated    to    30    characters    for    [<User:    %s>].' % ldap_info['username']))
                    ldap_info['first'] = data['givenName'][0][:30]
                if ('sn' in data):
                    if (len(data['sn'][0]) > 30):
                        LOG.warn(('Last    name    is    truncated    to    30    characters    for    [<User:    %s>].' % ldap_info['username']))
                    ldap_info['last'] = data['sn'][0][:30]
                if ('mail' in data):
                    ldap_info['email'] = data['mail'][0]
                if ('memberOf' in data):
                    ldap_info['groups'] = data['memberOf']
                if ('isMemberOf' in data):
                    ldap_info['groups'] = data['isMemberOf']
                user_info.append(ldap_info)
    return user_info
