'GET /api/users/{id}/information
Return user details such as username, email, addresses etc.
:param id: the encoded id of the user
:type  id: str'

@expose_api
def get_information(self, trans, id, **kwd):

    user = self._get_user(trans, id)
    email = user.email
    username = user.username
    inputs = list()
    inputs.append({'id': 'email_input', 'name': 'email', 'type': 'text', 'label': 'Email    address', 'value': email, 'help': 'If    you    change    your    email    address    you    will    receive    an    activation    link    in    the    new    mailbox    and    you    have    to    activate    your    account    by    visiting    it.'})
    if (trans.webapp.name == 'galaxy'):
        inputs.append({'id': 'name_input', 'name': 'username', 'type': 'text', 'label': 'Public    name', 'value': username, 'help': 'Your    public    name    is    an    identifier    that    will    be    used    to    generate    addresses    for    information    you    share    publicly.    Public    names    must    be    at    least    three    characters    in    length    and    contain    only    lower-case    letters,    numbers,    and    the    "-"    character.'})
        info_form_models = self.get_all_forms(trans, filter=dict(deleted=False), form_type=trans.app.model.FormDefinition.types.USER_INFO)
        if info_form_models:
            info_form_id = (trans.security.encode_id(user.values.form_definition.id) if user.values else None)
            info_field = {'type': 'conditional', 'name': 'info', 'cases': [], 'test_param': {'name': 'form_id', 'label': 'User    type', 'type': 'select', 'value': info_form_id, 'help': '', 'data': []}}
            for f in info_form_models:
                values = None
                if ((info_form_id == trans.security.encode_id(f.id)) and user.values):
                    values = user.values.content
                info_form = f.to_dict(user=user, values=values, security=trans.security)
                info_field['test_param']['data'].append({'label': info_form['name'], 'value': info_form['id']})
                info_field['cases'].append({'value': info_form['id'], 'inputs': info_form['inputs']})
            inputs.append(info_field)
        address_inputs = [{'type': 'hidden', 'name': 'id', 'hidden': True}]
        for field in AddressField.fields():
            address_inputs.append({'type': 'text', 'name': field[0], 'label': field[1], 'help': field[2]})
        address_repeat = {'title': 'Address', 'name': 'address', 'type': 'repeat', 'inputs': address_inputs, 'cache': []}
        address_values = [address.to_dict(trans) for address in user.addresses]
        for address in address_values:
            address_cache = []
            for input in address_inputs:
                input_copy = input.copy()
                input_copy['value'] = address.get(input['name'])
                address_cache.append(input_copy)
            address_repeat['cache'].append(address_cache)
        inputs.append(address_repeat)
        extra_user_pref = self._build_extra_user_pref_inputs(self._get_extra_user_preferences(trans), user)
        for item in extra_user_pref:
            inputs.append(item)
    elif user.active_repositories:
        inputs.append(dict(id='name_input', name='username', label='Public    name:', type='hidden', value=username, help='You    cannot    change    your    public    name    after    you    have    created    a    repository    in    this    tool    shed.'))
    else:
        inputs.append(dict(id='name_input', name='username', label='Public    name:', type='text', value=username, help='Your    public    name    provides    a    means    of    identifying    you    publicly    within    this    tool    shed.    Public    names    must    be    at    least    three    characters    in    length    and    contain    only    lower-case    letters,    numbers,    and    the    "-"    character.    You    cannot    change    your    public    name    after    you    have    created    a    repository    in    this    tool    shed.'))
    return {'email': email, 'username': username, 'addresses': [address.to_dict(trans) for address in user.addresses], 'inputs': inputs}
