]> andersk Git - moira.git/commitdiff
Some code for the initial rollout:
authorzacheiss <zacheiss>
Thu, 2 Jan 2003 01:03:36 +0000 (01:03 +0000)
committerzacheiss <zacheiss>
Thu, 2 Jan 2003 01:03:36 +0000 (01:03 +0000)
- make LIST:mailman the default owner of mailman lists

- whine at people if they try to make a mailman list without a memacl.

- prompt to add string listname@mailman_server to list.

clients/moira/lists.c

index 01a47952bf2a07a2280e0b0d08946af6e75d28a8..7ad0bab39b378a5e5efdd6f070a2ff33a4a780be 100644 (file)
@@ -253,6 +253,10 @@ char **AskListInfo(char **info, Bool name)
          SUB_ERROR)
        return NULL;
       info[L_MAILMAN_SERVER] = canonicalize_hostname(info[L_MAILMAN_SERVER]);
+      
+      /* Change default owner */
+      strcpy(info[L_ACE_TYPE], "LIST");
+      strcpy(info[L_ACE_NAME], "mailman");
     }
 
   do {
@@ -287,16 +291,28 @@ char **AskListInfo(char **info, Bool name)
       free(info[L_ACE_NAME]);
       info[L_ACE_NAME] = canon;
     }
-  if (GetTypeFromUser("What Type of Membership Administrator", "ace_type",
-                     &info[L_MEMACE_TYPE]) == SUB_ERROR)
-    return NULL;
-  if (strcasecmp(info[L_MEMACE_TYPE], "none"))
-    {
-      sprintf(temp_buf, "Which %s will be the membership administrator of this list: ",
-             info[L_MEMACE_TYPE]);
-      if (GetValueFromUser(temp_buf, &info[L_MEMACE_NAME]) == SUB_ERROR)
-       return NULL;
-    }
+
+  do {
+    if (GetTypeFromUser("What Type of Membership Administrator", "ace_type",
+                       &info[L_MEMACE_TYPE]) == SUB_ERROR)
+      return NULL;
+    if (strcasecmp(info[L_MEMACE_TYPE], "none"))
+      {
+       sprintf(temp_buf, "Which %s will be the membership administrator of this list: ",
+               info[L_MEMACE_TYPE]);
+       if (GetValueFromUser(temp_buf, &info[L_MEMACE_NAME]) == SUB_ERROR)
+         return NULL;
+      }
+    else
+      {
+       Put_message("Setting the Membership Administrator of a Mailman list to 'NONE'");
+       Put_message("means no one will receive the list administrator password.");
+       if (YesNoQuestion("Do you really want to do this?", FALSE) == TRUE)
+         break;
+      }
+  } while ((!strcasecmp(info[L_MEMACE_TYPE], "none")) && 
+          atoi(info[L_MAILMAN]));
+
   if (!strcasecmp(info[L_MEMACE_TYPE], "kerberos"))
     {
       char *canon;
@@ -508,6 +524,35 @@ int AddList(int argc, char **argv)
       ret_code = SUB_ERROR;
     }
 
+  if (atoi(add_args[L_MAILMAN]))
+    {
+      char mailman_address[256], buf[1024];
+
+      status = do_mr_query("get_list_info", 1, add_args, StoreInfo, &elem);
+      if (status)
+         com_err(program_name, status, "while retrieving list information.");
+      else
+       {
+         strcpy(mailman_address, add_args[0]);
+         strcat(mailman_address, "@");
+         strcat(mailman_address, ((char **)elem->q_data)[L_MAILMAN_SERVER]);
+         sprintf(buf, "Add STRING %s to LIST %s", mailman_address,
+                 add_args[0]);
+         if (YesNoQuestion(buf, TRUE) == TRUE)
+           {
+             char *args[3];
+             args[0] = add_args[0];
+             args[1] = "STRING";
+             args[2] = mailman_address;
+             
+             status = do_mr_query("add_member_to_list", CountArgs(args), args,
+                                  NULL, NULL);
+             if (status)
+               com_err(program_name, status, "while adding member to list.");
+           }
+       }
+    }
+
   FreeInfo(info);
   return ret_code;
 }
This page took 0.097262 seconds and 5 git commands to generate.