From 926ff99773475e273210195ca09897c2e0915362 Mon Sep 17 00:00:00 2001 From: Daouda Lo Date: Thu, 5 Jun 2003 17:18:59 +0000 Subject: - delete group when deleting user --- USER/USER.xs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'USER') diff --git a/USER/USER.xs b/USER/USER.xs index d1ef6c9..e7d9e60 100644 --- a/USER/USER.xs +++ b/USER/USER.xs @@ -250,7 +250,7 @@ lu_homedir_remove(const char *directory, struct lu_error ** error) return 0; } - return TRUE; + return 1; } /* Move a directory from one place to another. */ int @@ -528,18 +528,24 @@ Admin_UserAdd(self, ent, is_system, dont_create_home) } /* Create a mail spool for the user. */ - if (lu_mailspool_create_remove(self, ent, TRUE) != 1) { + if (lu_mailspool_create_remove(self, ent, 1) != 1) { warn(_("Error creating mail spool.\n")); - return 8; + RETVAL = 3; } } OUTPUT: RETVAL -void +int Admin_UserDel(self, ent) USER::ADMIN *self USER::ENT *ent + PPCODE: + USER__ERR *error; + if (lu_user_delete(self, ent, &error) == FALSE) { + croak("User Could Not be deleted: %s.\n", error ? error->string : "Unknown error"); + RETVAL = 0; + } else RETVAL = 1 ; void Admin_UserEdit(self, ent) @@ -641,7 +647,12 @@ void Admin_GroupDel(self, ent) USER::ADMIN *self USER::ENT *ent - + PPCODE: + USER__ERR *error; + if (lu_group_delete(self, ent, &error) == FALSE) { + croak("Group could not be deleted: %s.\n", error ? error->string : "Unknown error"); + RETVAL = 0; + } else RETVAL = 1 ; void Admin_GroupEdit(self, ent) USER::ADMIN *self -- cgit v1.2.1