]> andersk Git - moira.git/commitdiff
If creating a list which has the same name as a username, prompt and ask
authortytso <tytso>
Wed, 3 Aug 1994 19:42:26 +0000 (19:42 +0000)
committertytso <tytso>
Wed, 3 Aug 1994 19:42:26 +0000 (19:42 +0000)
the user if that's what she really wants to be doing.
..

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.0971649999999999 seconds and 5 git commands to generate.