From e012e860b472bcb5a00a089e73113fb6989fde20 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Tue, 7 Oct 2008 04:31:22 -0400 Subject: Implement user-mod --- ipalib/plugins/f_user.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'ipalib/plugins/f_user.py') 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) -- cgit