From dcc803de2d0fb63082b6e6ea14bdfdd39ed4a632 Mon Sep 17 00:00:00 2001 From: tytso Date: Wed, 3 Aug 1994 19:42:26 +0000 Subject: [PATCH] If creating a list which has the same name as a username, prompt and ask the user if that's what she really wants to be doing. .. --- clients/moira/lists.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/clients/moira/lists.c b/clients/moira/lists.c index a46bc2d9..7bcc4f54 100644 --- a/clients/moira/lists.c +++ b/clients/moira/lists.c @@ -360,6 +360,7 @@ char **argv; { static char *info[MAX_ARGS_SIZE], **add_args; int status, ret_code = SUB_NORMAL; + struct qelem *elem = NULL; if (!ValidName(argv[1])) return(DM_NORMAL); @@ -373,6 +374,16 @@ char **argv; return(SUB_ERROR); } + if (do_mr_query("get_user_account_by_login", 1, argv + 1, + StoreInfo, (char *) &elem) == 0) { + Put_message("A user by that name already exists in the database."); + Loop(QueueTop(elem), FreeInfo); + FreeQueue(elem); + if (YesNoQuestion("Crate a list with the same name", + FALSE) != TRUE) + return(SUB_ERROR); + } + if ((add_args = AskListInfo(SetDefaults(info,argv[1]), FALSE)) == NULL) { Put_message("Aborted."); return(SUB_ERROR); -- 2.45.1