]> andersk Git - moira.git/blobdiff - clients/moira/lists.c
fix bogus "List is empty" message on permission denied.
[moira.git] / clients / moira / lists.c
index 36ca216585dd16f31962200d8940f517ccfc0192..05f25a39650c7329905dc4679c6d6a85dd69f2f1 100644 (file)
@@ -198,12 +198,11 @@ Bool name;
     GetYesNoValueFromUser("Is this a public list", &info[L_PUBLIC]);
     GetYesNoValueFromUser("Is this a hidden list", &info[L_HIDDEN]);
     GetYesNoValueFromUser("Is this a maillist", &info[L_MAILLIST]);
-    GetYesNoValueFromUser("is this a group", &info[L_GROUP]);
+    GetYesNoValueFromUser("Is this a group", &info[L_GROUP]);
     if (atoi(info[L_GROUP]))
        GetValueFromUser("What is the GID for this group.", &info[L_GID]);
 
-    GetValueFromUser("What Type of Administrator (none, user, list): ",
-                    &info[L_ACE_TYPE]);
+    GetTypeFromUser("What Type of Administrator", "ace_type",&info[L_ACE_TYPE]);
     if ( (strcmp(info[L_ACE_TYPE], "USER") == 0) || 
        (strcmp(info[L_ACE_TYPE], "user") == 0) )
        GetValueFromUser("Who will be the administrator of this list: ",
@@ -431,9 +430,9 @@ char **argv;
        case SMS_LIST:
            Put_message("This list does not exist.");
            return(DM_QUIT);
-       case SMS_ACCESS:
+       case SMS_PERM:
            Put_message("You are not allowed to view this list.");
-           return(DM_QUIT);
+           break;
        default:
            com_err(program_name, stat, " in get_list_info");
            return(DM_QUIT);
@@ -482,8 +481,10 @@ char * type;
 
     found_some = FALSE;
     if ( (status = sms_query("get_members_of_list", CountArgs(args), args, 
-                            PrintByType, type)) != 0)
+                            PrintByType, type)) != 0) {
        com_err(program_name, status, " in ListMembersByType");
+       return(DM_NORMAL);
+    }
     if (!found_some) {
        if (type == NULL)
            Put_message("List is empty (no members).");
@@ -561,18 +562,12 @@ char *action, **ret_argv;
 
     ret_argv[LM_LIST] = Strsave(current_list);
 
-    PromptWithDefault("Type of member (user, list, or string)",
-                       ret_buf, BUFSIZ, "user");
-    ret_argv[LM_TYPE]= Strsave(ret_buf);
-
-/*
- * A type check needs to be added here, to see if we match the
- * allowable types, currently (user, list, and string). 
- */
+    ret_argv[LM_TYPE] = Strsave("user");
+    GetTypeFromUser("Type of member", "member", &ret_argv[LM_TYPE]);
 
     sprintf(temp_buf,"Name of %s to %s", ret_argv[LM_TYPE], action);
-    PromptWithDefault(temp_buf, ret_buf, BUFSIZ, user);
-    ret_argv[LM_MEMBER] = Strsave(ret_buf);
+    ret_argv[LM_MEMBER] = Strsave(user);
+    GetValueFromUser(temp_buf, &ret_argv[LM_MEMBER]);
     ret_argv[LM_END] = NULL;           /* NULL terminate this list. */
 
     if (!ValidName( ret_argv[LM_MEMBER] ) ) {
@@ -764,7 +759,7 @@ ListByAdministrator()
                            BUFSIZ, "user")) )
        return(DM_NORMAL);
 
-    if ( YesNoQuestion("Do you want a recursive search (y/n)", TRUE) == 1 ) {
+    if ( YesNoQuestion("Do you want a recursive search (y/n)", FALSE) == 1 ) {
        sprintf(temp_buf, "R%s", buf);  /* "USER" to "RUSER" etc. */
        type = Strsave(temp_buf);
     }
This page took 0.154383 seconds and 4 git commands to generate.