W dniu 27.08.2015 o 15:18, Rob Crittenden pisze:
Mateusz Małek wrote:
We're trying to adjust FreeIPA to our environment... quite a bit. Here
are some bullet points:
3. Passwords need to be generated automatically, so user administrator
won't be required to invent them for every single user. It should appear
on-screen after user account creation.
The ability is there on the CLI (don't know if it is exposed in UI):

$ ipa user-add --first=random --last=user ruser --random
Added user "ruser"
  User login: ruser
  First name: random
  Random password: Gu8VpULbb9xv

Yeah, I've already found it ;) It isn't exposed in Web UI, but it wasn't extremely difficult to change these bits of code to send random: true with user_add request and then display dialog box with randompassword value sent in response (code is a bit ugly at the moment, as this is fair bit of "copy-paste programming" - but it works).

I think the most problematic part of my struggles with adjusting IPA to my environment is point 4 of my list - it is easy to remove that single line responsible for creating default value of username, but I really want to avoid troubles with upgrades and that's why I'm trying to patch this in some "pluggable", update-friendly way. Is there any interface to access definition of particular field from ipalib plugin code? At the moment I'm monkey-patching user object like that:

from ipalib.plugins import user

def patch(params):
    for param in params:
        if param.name == 'uid': yield param.clone(default_from=None)
        else: yield param

user.user.takes_params = tuple(patch(user.user.takes_params))

It works, but is there any better (or more appropriate) way to replace one specific parameter definition?

Best regards
Mateusz Małek

Manage your subscription for the Freeipa-users mailing list:
Go to http://freeipa.org for more info on the project

Reply via email to