[1764] in Moira

home help back first fref pref prev next nref lref last post

Re: curses client changes

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Wed Apr 4 16:43:33 2001

Message-Id: <200104042043.QAA09664@sweet-transvestite.mit.edu>
To: Jonathon Weiss <jweiss@MIT.EDU>
cc: Garry Zacheiss <zacheiss@MIT.EDU>, moiradev@MIT.EDU
In-Reply-To: Your message of "Wed, 04 Apr 2001 03:25:03 EDT."
             <200104040725.DAA15305@Bearing-An-Hourglass.mit.edu> 
Date: Wed, 04 Apr 2001 16:43:21 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>

	Ok, here's a different control structure.

Garry

Index: lists.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/moira/lists.c,v
retrieving revision 1.45
diff -u -r1.45 lists.c
--- lists.c	2001/03/02 04:44:57	1.45
+++ lists.c	2001/04/04 18:54:54
@@ -232,17 +232,26 @@
 	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 @@
   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]);

home help back first fref pref prev next nref lref last post