[Freeipa-users] HOW to Add employeenumber to user easily? there is account object with emoployee number ttribute
Petr Viktorin
pviktori at redhat.com
Thu Feb 6 10:59:21 UTC 2014
On 02/06/2014 09:31 AM, barrykfl at gmail.com wrote:
> Hi:
>
> I can make it show on ldap browser or the ui but finding where to add it
> in command base.
>
> ipa user-mod ---employeenumber no such parameter.
You can use setattr where we don't provide specialized CLI arguments.
Also note that employeenumber won't show in the default output; you'll
want to use --all to retrieve all the attributes.
ipa user-mod somerandomuser --setattr=employeenumber=1234 --all
ipa user-show somerandomuser --all
To add this to the CLI, you would need to modify the user object in your
plugin. Something like:
from ipalib.plugins import user
from ipalib.parameters import Str
user.takes_params = user.takes_params + (
Str('employeenumber',
cli_name='first',
label=_('Employee number'),
),
)
> Moreover can i change the attribute just by name and make use of it.
>
> E.g. i found car license no really useful for staff so i want to change
> the label to staff id card number
You should ideally create a new LDAP attribute for this, but the label
is defined in ipalib.plugins.user.
--
Petr³
More information about the Freeipa-users
mailing list