]> andersk Git - moira.git/blobdiff - clients/moira/lists.c
If creating a list which has the same name as a username, prompt and ask
[moira.git] / clients / moira / lists.c
index a46bc2d9723b8b8442ea62332c1104da666ae435..7bcc4f54664b0ea6eec8ebebb2a802caa5b6ac81 100644 (file)
@@ -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);
This page took 0.02606 seconds and 4 git commands to generate.