From 66e5e45066a5f494f71d70ce17db7123d0ca76f1 Mon Sep 17 00:00:00 2001 From: zacheiss Date: Wed, 4 Apr 2001 23:19:49 +0000 Subject: [PATCH] Warn people if they're making a list owned by 'NONE'. --- clients/moira/lists.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/clients/moira/lists.c b/clients/moira/lists.c index e3295f8d..5b8db2db 100644 --- a/clients/moira/lists.c +++ b/clients/moira/lists.c @@ -232,17 +232,26 @@ char **AskListInfo(char **info, Bool name) return NULL; } - if (GetTypeFromUser("What Type of Administrator", "ace_type", - &info[L_ACE_TYPE]) == SUB_ERROR) - return NULL; - if (strcasecmp(info[L_ACE_TYPE], "NONE") && - strcasecmp(info[L_ACE_TYPE], "none")) - { - sprintf(temp_buf, "Which %s will be the administrator of this list: ", - info[L_ACE_TYPE]); - if (GetValueFromUser(temp_buf, &info[L_ACE_NAME]) == SUB_ERROR) - return NULL; - } + do { + if (GetTypeFromUser("What Type of Administrator", "ace_type", + &info[L_ACE_TYPE]) == SUB_ERROR) + return NULL; + if (strcasecmp(info[L_ACE_TYPE], "none")) + { + sprintf(temp_buf, "Which %s will be the administrator of this list: ", + info[L_ACE_TYPE]); + if (GetValueFromUser(temp_buf, &info[L_ACE_NAME]) == SUB_ERROR) + return NULL; + } + else + { + Put_message("Setting the administrator of this list to 'NONE'"); + Put_message("will make you unable to further modify the list."); + if (YesNoQuestion("Do you really want to do this?", FALSE) == TRUE) + break; + } + } while (!strcasecmp(info[L_ACE_TYPE], "none")); + if (!strcasecmp(info[L_ACE_TYPE], "kerberos")) { char *canon; @@ -256,8 +265,7 @@ char **AskListInfo(char **info, Bool name) if (GetTypeFromUser("What Type of Membership Administrator", "ace_type", &info[L_MEMACE_TYPE]) == SUB_ERROR) return NULL; - if (strcasecmp(info[L_MEMACE_TYPE], "NONE") && - strcasecmp(info[L_MEMACE_TYPE], "none")) + if (strcasecmp(info[L_MEMACE_TYPE], "none")) { sprintf(temp_buf, "Which %s will be the membership administrator of this list: ", info[L_MEMACE_TYPE]); -- 2.45.2