diff options
author | Rob Crittenden <rcritten@redhat.com> | 2008-10-07 04:31:22 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2008-10-07 04:31:22 -0400 |
commit | e012e860b472bcb5a00a089e73113fb6989fde20 (patch) | |
tree | 4714d0954367b5dff94597307c582b71ce90ce89 /ipalib/plugins/f_user.py | |
parent | 69bc5ad77adecaf7d8fde4a6578c3d2f3ef355df (diff) | |
download | freeipa.git-e012e860b472bcb5a00a089e73113fb6989fde20.tar.gz freeipa.git-e012e860b472bcb5a00a089e73113fb6989fde20.tar.xz freeipa.git-e012e860b472bcb5a00a089e73113fb6989fde20.zip |
Implement user-mod
Diffstat (limited to 'ipalib/plugins/f_user.py')
-rw-r--r-- | ipalib/plugins/f_user.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/ipalib/plugins/f_user.py b/ipalib/plugins/f_user.py index 49b6a370..0b424d35 100644 --- a/ipalib/plugins/f_user.py +++ b/ipalib/plugins/f_user.py @@ -170,7 +170,7 @@ class user_add(crud.Add): def forward(self, *args, **kw): result = super(crud.Add, self).forward(*args, **kw) if result != False: - print result + print "User %s added" % args[0] api.register(user_add) @@ -182,6 +182,25 @@ api.register(user_del) class user_mod(crud.Mod): 'Edit an existing user.' + def execute(self, *args, **kw): + uid=args[0] + result = servercore.get_sub_entry(servercore.basedn, "uid=%s" % uid, ["*"]) + + user = kw + dn = result.get('dn') + del result['dn'] + entry = ipaldap.Entry((dn, servercore.convert_scalar_values(result))) + + for u in user: + entry.setValues(u, user[u]) + + result = servercore.update_entry(entry.toDict()) + + return result + def forward(self, *args, **kw): + result = super(crud.Mod, self).forward(*args, **kw) + if result != False: + print "User %s modified" % args[0] api.register(user_mod) |