[Freeipa-users] How to add multivalued attribute to UI

John Duino jduino at oblong.com
Wed Sep 16 20:16:13 UTC 2015


Oh, okay. I didn't realize the ipalib plugin affected the UI. Sure, I can share it. So in /usr/lib/python2.7/site-packages/ipalib/plugins/altemail.py is the following. I have also (at one point) had a validation function and a precallback (both currently not used when trying to simplify/test). Validation just checked for a validly formatted email address (I left the 'from' statement below which imports that library). The precallback was to ensure that the objectClass 'mailrecipient' was added to the user before trying to add the mailAlternateAddress attribute (It was causing some other error when it was already there..need to sort that out later, as well). Anyway, the ipalib plugin:

from ipalib.plugins import user
from ipalib.parameters import Str
from ipalib import _
from validate_email_address import validate_email

user.user.takes_params = user.user.takes_params + (
   Str('mailalternateaddress*',
       cli_name='altemail',
       label=_('E-mail Alias'),
       doc=_('E-Mail Alias'),
       minlength=7,
       multivalue=True,
   ),
)


----- Original Message -----
From: "Rob Crittenden" <rcritten at redhat.com>

I don't know a lot about the UI javascript but there are two pieces to
code: the plugin to define the attribute and the UI to consume it.

It sounds like you've done both. What I'm interested in is how you
configured the plugin. Can you share the code?

The UI downloads all the available commands and options as metadata and
uses that to help drive some of the interactions.

rob

> 
> Thanks!
> ----- Original Message -----
> From: "Rob Crittenden" <rcritten at redhat.com>
> 
> Do you have this configured in the user plugin? Perhaps some other piece
> of the UI is confused because of either a missing or misconfigured value
> for the attribute in the metadata.
> 
> If you do, how is the param configured?
> 
> rob
>




More information about the Freeipa-users mailing list