]> andersk Git - moira.git/commitdiff
Change meaning of "secure" flag to refer to whether or not the user
authordanw <danw>
Wed, 29 Jul 1998 18:45:25 +0000 (18:45 +0000)
committerdanw <danw>
Wed, 29 Jul 1998 18:45:25 +0000 (18:45 +0000)
needs a "6-words" account coupon rather than whether or not they've
gotten a .extra instance, since we don't use that information any more
anyway.

Also fix an unrelated bug in RealDeactivateUser, noticed by carla.

clients/moira/user.c

index 2347cc8dc4712303e3d1556f1216350f415b69bc..374a2cd2385e2da9c070e45644e6994c800b410a 100644 (file)
@@ -130,11 +130,12 @@ static void PrintUserInfo(char **info)
          UserState(atoi(info[U_STATE])), info[U_MITID],
          *info[U_SIGNATURE] ? (status ? "Bad" : "Yes") : "No");
   Put_message(buf);
-  if (atoi(info[U_SECURE]))
-    sprintf(buf, "Secure password set on %s.", atot(info[U_SECURE]));
-  else
-    sprintf(buf, "No secure password set.");
-  Put_message(buf);
+  if (!atoi(info[U_STATE]))
+    {
+      sprintf(buf, "User %s secure Account Coupon to register",
+             atoi(info[U_SECURE]) ? "needs" : "does not need");
+      Put_message(buf);
+    }
   sprintf(buf, "Comments: %s", info[U_COMMENT]);
   Put_message(buf);
   sprintf(buf, MOD_FORMAT, info[U_MODBY], info[U_MODTIME], info[U_MODWITH]);
@@ -290,21 +291,19 @@ char **AskUserInfo(char **info, Bool name)
   if (GetValueFromUser("Comments", &info[U_COMMENT]) == SUB_ERROR)
     return NULL;
 
-  if (YesNoQuestion("Secure password set",
-                   atoi(info[U_SECURE]) ? TRUE : FALSE) == FALSE)
-    {
-      free(info[U_SECURE]);
-      info[U_SECURE] = strdup("0");
-    }
-  else if (!strcmp(info[U_SECURE], "0"))
+  if (!name)
     {
-      char buf[16];
-      struct timeval tv;
-
-      gettimeofday(&tv, NULL);
-      sprintf(buf, "%ld", (long) tv.tv_sec);
-      free(info[U_SECURE]);
-      info[U_SECURE] = strdup(buf);
+      if (YesNoQuestion("User needs secure Account Coupon to register",
+                       atoi(info[U_SECURE]) ? TRUE : FALSE) == FALSE)
+       {
+         free(info[U_SECURE]);
+         info[U_SECURE] = strdup("0");
+       }
+      else
+       {
+         free(info[U_SECURE]);
+         info[U_SECURE] = strdup("1");
+       }
     }
 
   /* Sign record */
@@ -757,8 +756,6 @@ static void RealDeactivateUser(char **info, Bool one_item)
        {
          com_err(program_name, status, " getting filsys info, "
                  "not deactivating filesystem");
-         FreeInfo(args);
-         FreeQueue(elem);
          return;
        }
       args = QueueTop(elem)->q_data;
This page took 0.156887 seconds and 5 git commands to generate.