]> andersk Git - moira.git/commitdiff
This is another incrementatal revision that is pretty stable, and most
authorkit <kit>
Wed, 27 Jul 1988 19:19:07 +0000 (19:19 +0000)
committerkit <kit>
Wed, 27 Jul 1988 19:19:07 +0000 (19:19 +0000)
references to allmaint have been removed, to facilitate this the old
files allmaint.h and allmaint_func.h have been renamed to defs.h and f_defs.h

14 files changed:
clients/moira/attach.c
clients/moira/cluster.c
clients/moira/delete.c
clients/moira/globals.c
clients/moira/globals.h
clients/moira/lists.c
clients/moira/main.c
clients/moira/menus.c
clients/moira/nfs.c
clients/moira/pobox.c
clients/moira/quota.c
clients/moira/user.c
clients/moira/utils.c
include/moira_site.h

index 90ab70aa6426dd0e231461b4b2d3b5daf8529068..506a3dd18d3258ac928a06178d61f53cf810df56 100644 (file)
@@ -2,21 +2,20 @@
   static char rcsid_module_c[] = "$Header$";
 #endif
 
-/*     This is the file attach.c for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
+/*     This is the file attach.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
  *     It Contains: Functions for maintaining data used by Hesiod 
  *                   to map courses/projects/users to their file systems, 
  *                   and maintain filesys info. 
  *     
  *     Created:        5/4/88
  *     By:             Chris D. Peterson
- *      Based Upon:     attach.c 87/07/24 marcus
  *
  *      $Source$
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
@@ -28,8 +27,8 @@
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 #include "infodefs.h"
 
@@ -249,14 +248,10 @@ GetFS(argc, argv)
 int argc;
 char **argv;
 {
-    struct qelem *top, *elem;
+    struct qelem *top;
 
-    top = elem = GetFSInfo(LABEL, argv[1]); /* get info. */
-    while(elem != NULL) {
-       char ** info = (char **) elem->q_data;
-       (void) PrintFSInfo(info);
-       elem = elem->q_forw;
-    }
+    top = GetFSInfo(LABEL, argv[1]); /* get info. */
+    Loop(top, (void *) PrintFSInfo);
     FreeQueue(top);            /* clean the queue. */
     return (DM_NORMAL);
 }
@@ -409,17 +404,11 @@ GetFSAlias(argc, argv)
 int argc;
 char **argv;
 {
-    struct qelem *top, *elem;
-
-    top = elem = GetFSInfo(ALIAS, argv[1]);
+    struct qelem *top;
 
+    top = GetFSInfo(ALIAS, argv[1]);
     Put_message(" ");          /* blank line. */
-    while (elem != NULL) {
-       char **info = (char **) elem->q_data;
-       PrintFSAlias(info);
-       elem = elem->q_forw;
-    }
-
+    Loop(top, (void *) PrintFSAlias);
     FreeQueue(top);
     return(DM_NORMAL);
 }
index 1db7298615f1777f875d1740b357c9f98e0648ba..5b3183bc0e19c57cdc2d61ef99539fcf2eecf696 100644 (file)
@@ -2,19 +2,18 @@
   static char rcsid_module_c[] = "$Header$";
 #endif lint
 
-/*     This is the file cluseter.c for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
+/*     This is the file cluster.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
  *     It Contains: 
  *     
  *     Created:        4/22/88
  *     By:             Chris D. Peterson
- *      Based upon:  Clusermaint.c by marcus: 87/07/22
  *
  *      $Source$
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
@@ -28,8 +27,8 @@
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 #include "infodefs.h"
 
@@ -680,7 +679,7 @@ char ** argv;
        Put_message(buf);
        return(DM_NORMAL);
     }
-    if (stat)
+    if (stat != SMS_SUCCESS)
        com_err(program_name, stat, " in delete_machine_from_cluster");
 
     elem = QueueTop(elem);
@@ -1061,25 +1060,6 @@ char **argv;
     return(DM_NORMAL);
 }
 
-/*     Function Name: MachinesInCluster
- *     Description: Shows all machines in a give cluster.
- *     Arguments: argv, argc - name of cluster in argv[1].
- *     Returns: DM_NORMAL;
- */
-
-/* ARGSUSED */
-int
-MachinesInCluster(argc, argv)
-int argc;
-char **argv;
-{
-    char *info[10];
-    info[0] = argv[0];
-    info[2] = argv[1];
-    info[1] = "*";
-    return(MachineToClusterMap(3, info));
-}
-
 /* 
  * Local Variables:
  * mode: c
index affcf824a23e88eca337cacadd482901d9f85367..f3df389bf04a64619a2fce989b6880c7f05ff085 100644 (file)
@@ -2,8 +2,8 @@
   static char rcsid_module_c[] = "$Header$";
 #endif lint
 
-/*     This is the file delete.c for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
+/*     This is the file delete.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
  *     It Contains: functions for deleting users and lists.
  *     
  *     Created:        5/18/88
@@ -13,7 +13,7 @@
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
@@ -25,8 +25,8 @@
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 #include "infodefs.h"
 
@@ -54,7 +54,7 @@ Bool verbose;
        return;
     }
     info = (char **) elem->q_data;
-    if (info[0] == 0) {
+    if ( strcmp(info[NAME],"0") == 0) {
        if (verbose) {
            sprintf(buf, "Delete the empty list %s? ", name);
            if (YesNoQuestion(buf, FALSE) != TRUE) {
@@ -96,7 +96,8 @@ Bool verbose;
        return;                 /* If this query fails the ace will
                                   not be deleted even if it is empty. */
     if (verbose) {
-       sprintf(buf, "Delete the unused Access Control List (ACE) %s? ", name);
+       sprintf(buf, "Delete the unused Access Control Entity (ACE) %s? ",
+               name);
        if ( YesNoQuestion(buf, FALSE) != TRUE) {
            Put_message("Aborting Deletion!");
            return;
@@ -179,6 +180,7 @@ int verbose;
 {
     struct qelem *local;
     char *args[10], temp_buf[BUFSIZ];
+    int lists;
     register int status;
     
     args[0] = type;
@@ -206,15 +208,19 @@ int verbose;
  */
 
     local = *elem = QueueTop(*elem);
+    lists = QueueCount(*elem);
+    if (lists == 0)
+       return(SUB_NORMAL);
     if (verbose) {
-       sprintf(temp_buf, "%s %s is a member of %d other list(s).\n", type,
-               name, QueueCount(*elem) );
+       sprintf(temp_buf, "%s %s is a member of %d other list%s.\n", type,
+               name, lists, ((lists == 1) ? "" : "s") );
        Put_message(temp_buf);
        while (local != NULL) {
            char ** info = (char **) local->q_data;
            Print( 1, &info[GLOM_NAME], (char *) NULL);
            local = local->q_forw;
        }
+       Put_message(" ");       /* Blank Line. */
        sprintf(temp_buf,"Remove %s %s from these lists? ", type, name);
        if (YesNoQuestion(temp_buf, FALSE) != TRUE) {
            Put_message("Aborting...");
@@ -259,8 +265,7 @@ Bool verbose;
 {
     char buf[BUFSIZ], *args[10];
     struct qelem *local, *elem = NULL;
-    int status;
-    Bool one_member;
+    int status, members;
 /* 
  * Get the members of this list.
  */
@@ -277,18 +282,22 @@ Bool verbose;
  * If verbose mode, then ask the user if we should delete.
  */
     local = elem = QueueTop(elem);
+    if ( (members = QueueCount(elem)) == 0)
+       return(SUB_NORMAL);
     if (verbose) {
-       one_member = (QueueCount(elem) == 1);
        sprintf(buf, "List %s has %d member%s:", name, QueueCount(elem),
-               one_member ? "" : "s");
+               ((members == 1) ? "" : "s") );
        Put_message(buf);
+       Put_message(" ");       /* Blank Line. */
        while (local != NULL) {
            char ** info = (char **) local->q_data;
            Print( CountArgs(info), info, NULL);
            local = local->q_forw;
        }
+       Put_message(" ");       /* Blank Line. */
        sprintf(buf, "Remove th%s member%s from list %s? ", 
-               one_member ? "is" : "ese", one_member ? "" : "s", name);
+               ((members == 1) ? "is" : "ese"), 
+               ((members == 1) ? "" : "s", name) );
        if ( YesNoQuestion(buf, FALSE) != TRUE) {
            Put_message("Aborting...");
            FreeQueue(elem);
@@ -486,6 +495,7 @@ Bool ask_first;
                               Scream, (char *) NULL)) {
     case SMS_SUCCESS:
        Put_message("List Sucessfully Deleted.");
+       CheckAce(list_info[L_ACE_TYPE], list_info[L_ACE_NAME], ask_first);
        break;
     case SMS_IN_USE:
        /* 
@@ -502,7 +512,7 @@ Bool ask_first;
        {               /* if... */
            CheckAce(list_info[L_ACE_TYPE], list_info[L_ACE_NAME], ask_first);
            
-           local = member_of;
+           local = QueueTop(member_of);
            while (local != NULL) {
                char ** info = (char **) local->q_data;
                CheckListForDeletion(info[LM_LIST], ask_first);
index 21dc604efe8cfaa358fc9f02847daaa641729540..27621f78c7b603b98d7cb4aa7467eac5da039380 100644 (file)
@@ -2,25 +2,25 @@
   static char rcsid_module_c[] = "$Header$";
 #endif lint
 
-/*     This is the file globals.h for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
- *     It Contains: globals variable definitions
+/*     This is the file globals.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
+ *     It Contains:  globals variable definitions.
  *     
  *     Created:        4/12/88
- *     By:             4/12/88
+ *     By:             Chris D. Peterson
  *
  *      $Source$
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
  */
 
 #include "mit-copyright.h"
-#include "allmaint.h"
+#include "defs.h"
 
 Bool verbose;                  /* TRUE if verbose mode is active (default). */
 Bool found_some;               /* used by lists.c for determining if there 
index a9c4b05d4564a929be0e0d5ba9a21354f5810323..64eb77676aa184e7b138c84259d87df95879e2fb 100644 (file)
@@ -1,25 +1,25 @@
-/*     This is the file globals.h for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
- *     It Contains: globals variable definitions
+/*     This is the file globals.h for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
+ *     It Contains:  globals variable definitions.
  *     
  *     Created:        4/12/88
- *     By:             4/12/88
+ *     By:             Chris D. Peterson
  *
  *      $Source$
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
  */
 
 #include "mit-copyright.h"
-#include "allmaint.h"
+#include "defs.h"
 
-#ifndef _allmaint_globals_
-#define _allmaint_globals_
+#ifndef _sms_client_globals_
+#define _sms_client_globals_
 
 extern Bool verbose;           /* TRUE if verbose mode is active (default). */
 extern Bool found_some;                /* used by lists.c for determining if there 
@@ -27,4 +27,4 @@ extern Bool found_some;               /* used by lists.c for determining if there
 extern char *user;             /* The name of the user executing allmaint. */
 extern char *program_name;     /* The name of this instance of the program. */
 
-#endif _allmaint_globals_      /* Do Not Add Anything After This Line */
+#endif _sms_client_globals_    /* Do Not Add Anything After This Line */
index 4fe459608b08537a4bd38136d7475e347cff280e..bc227a0ea87b0a782a862cb4272c6eb778f286b1 100644 (file)
@@ -2,18 +2,18 @@
   static char rcsid_module_c[] = "$Header$";
 #endif lint
 
-/*     This is the file lists.c for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
- *     It Contains: 
+/*     This is the file lists.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
+ *     It Contains: All list manipulation functions, except delete.
  *     
- *     Borrowed from listmaint code:   4/12/88
- *     By:                             Chris D. Peterson
+ *     Created:        4/12/88
+ *     By:             Chris D. Peterson
  *
  *      $Source$
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
@@ -25,8 +25,8 @@
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 #include "infodefs.h"
 
@@ -561,23 +561,16 @@ char *action, **ret_argv;
     register int status;
 
     ret_argv[LM_LIST] = Strsave(current_list);
-    ret_argv[LM_MEMBER] = "nobody";
-    ret_argv[LM_TYPE]= "user";
 
-    switch (status = sms_access("add_member_to_list", 3, ret_argv)) {
-    case SMS_SUCCESS:
-       break;
-    case SMS_PERM:
-       Put_message("You are not allowed to add members to this list.");
-       return(SUB_ERROR);
-    default:
-       com_err(program_name, status, NULL);
-       return(SUB_ERROR);
-    }
     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). 
+ */
+
     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);
index e3dec844ea939e89295e5e1c5c9200eec40d6ee3..e01c5ce7dadcb4a41fc73b4bbaa8a70ac12d96e4 100644 (file)
@@ -2,9 +2,9 @@
   static char rcsid_module_c[] = "$Header$";
 #endif lint
 
-/*     This is the file main.c for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
- *     It Contains:  The main driver for this program.
+/*     This is the file main.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
+ *     It Contains: The main driver for the SMS Client.
  *     
  *     Created:        4/12/88
  *     By:             Chris D. Peterson
@@ -13,7 +13,7 @@
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
@@ -28,8 +28,8 @@
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 
 char * whoami;                 /* used by menu.c ugh!!! */
index 651b77ee4b64a8530d281ad0dbd20a59c773fb6c..27c60ce89547f0fc5346d5226e84c2f7ad6bcc27 100644 (file)
@@ -2,9 +2,9 @@
   static char rcsid_module_c[] = "$Header$";
 #endif lint
 
-/*     This is the file menu.c for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
- *     It Contains: all menu definitions for allmaint.
+/*     This is the file menus.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
+ *     It Contains: All menu definitions.
  *     
  *     Created:        4/11/88
  *     By:             Chris D. Peterson
@@ -13,7 +13,7 @@
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 
-/*
- * Attachmaint Menus
+/* ------------------------- Second Tier Menus ------------------------- */
+
+/* 
+ * Cluster Data Menu
  */
 
-Menu attachmaint_filemenu = {
-  NULLFUNC, 
-  NULLFUNC, 
-  "Filesystem Maintenance",
+Menu cluster_data_menu = {
+  NULLFUNC,
+  NULLFUNC,
+  "Cluster Data Menu",
   4,
   {
-    { GetFS, NULLMENU, 2, {
-      {"get", "Get Filesystem Name Information"},
-      {"name", "Name of Filesystem: "}
-    } },
-    { AddFS, NULLMENU, 2, {
-      {"add", "Add New Filesystem to Database"},
-      {"name", "name: "},
+    { ShowClusterData, NULLMENU, 3, {
+      {"show", "Show Data on a given Cluster"},
+      {"clus", "Cluster's Name: "},
+      {"label", "Label Identifing the data: "},
     } },
-    { ChangeFS, NULLMENU, 2, {
-      {"change", "Update Filesystem Information"},
-      {"name", "name: "},
+    { AddClusterData, NULLMENU, 4, {
+      {"add", "Add Data to a given Cluster"},
+      {"clus", "Cluster Name: "},
+      {"label", "Label Identifing the data: "},
+      {"data", "The data to be added: "},
     } },
-    { DeleteFS, NULLMENU, 2, {
-      {"delete", "Delete Filesystem"},
-      {"name", "Filesystem Name: "}
-    } } 
+    { RemoveClusterData, NULLMENU, 4, {
+      {"delete", "Remove Data to a given Cluster"},
+      {"clus", "Cluster's Name: "},
+      {"label", "Label Identifing the data: "},
+      {"data", "The data to be removed: "},
+    } }, 
+    SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
   }
 };
 
-Menu attachmaint_top_menu = {
-  NULLFUNC, 
-  NULLFUNC, 
-  "Attach/Filesystem Maintenance", 
-  6,
-  {
-    SUBMENU("filesystem", "Filesystem Work", &attachmaint_filemenu),
-    { GetFSAlias, NULLMENU, 2, {
-      {"check", "Check An Association"},
-      {"name", "alias name : "}
-    } },
-    { CreateFSAlias, NULLMENU, 2, {
-      {"alias", "Associate with a Filesystem"},
-      {"name", "alias name : "},
-    } },
-    { DeleteFSAlias, NULLMENU, 2, {
-      {"unalias", "Disassociate from a Filesystem"},
-      {"name", "alias name : "},
-    } },
-    SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
-    SIMPLEFUNC("help", "Help ..", AttachHelp)
-  }
+/*
+ * List Information Menu
+ */
+
+Menu list_info_menu = {
+    NULLFUNC,
+    NULLFUNC,
+    "List Information Menu",
+    5,
+    {
+        SIMPLEFUNC("member",
+                  "Show all lists to which a given member belongs",
+                  ListByMember),
+       SIMPLEFUNC("admin",
+                  "Show all items which a given member can administer",
+                  ListByAdministrator),
+       SIMPLEFUNC("groups", "Show all lists which are groups",
+                  ListAllGroups),
+       SIMPLEFUNC("public", "Show all public mailing lists",
+                  ListAllPublicMailLists),
+       SIMPLEFUNC("maillists", "Show all mailing lists",
+                  ListAllMailLists)
+    }
+};
+
+/*
+ * List Member Menu
+ */
+
+Menu list_member_menu = {
+    ListmaintMemberMenuEntry,
+    ListmaintMemberMenuExit,
+    NULL,
+    7,
+    {
+       SIMPLEFUNC("add", "Add a member to this list", AddMember),
+       SIMPLEFUNC("remove", "Remove a member from this list", DeleteMember),
+       SIMPLEFUNC("all", "Show the members of this list", ListAllMembers),
+       SIMPLEFUNC("user", "Show the members of type USER", ListUserMembers),
+       SIMPLEFUNC("list", "Show the members of type LIST", ListListMembers),
+       SIMPLEFUNC("string", "Show the members of type STRING", 
+                  ListStringMembers),
+       SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
+    } 
 };
 
 /*
- * Clustermaint Menus
+ *  Machine To Cluster Mappings Menu
  */
 
-Menu clustermaint_machine_menu = {
+Menu mappings_menu = {
   NULLFUNC,
   NULLFUNC,
-  "Machine Maintenence",
-  7,
+  "Machine To Cluster Mappings Menu",
+  4,
   {
-    { ShowMachineInfo, NULLMENU, 2, {
-      {"show","Get machine information"},
-      {"name","Machine's Name: "}
-    } },
-    { AddMachine, NULLMENU, 2, {
-      {"add","Add a new machine"},
-      {"name","Machine's Name: "},
-    } },
-    { UpdateMachine, NULLMENU, 2, {
-      {"update","Update machine information"},
-      {"name","Machine's Name: "},
-    } },
-    { DeleteMachine, NULLMENU, 2, {
-      {"delete","Delete this machine"},
-      {"name","Machine's Name: "}
-    } },
     { MachineToClusterMap, NULLMENU, 3, {
       {"map", "Show Machine to cluster mapping"},
       {"name", "Machine's Name: "},
@@ -121,23 +131,79 @@ Menu clustermaint_machine_menu = {
       {"name","Machine's Name: "},
       {"cluster", "Cluster's Name: "},
     } },
+    SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
   }
 };
 
-Menu clustermaint_cluster_menu = {
+/* 
+ * Post Office Box Menu
+ */
+
+Menu pobox_menu = {
   NULLFUNC,
   NULLFUNC,
-  "Cluster Information",
+  "Post Office Box Menu",
+  4,
+  {
+    {GetUserPOBox, NULLMENU, 2, {
+      {"show", "Show a user's post office box"},
+      {"login name", "login name: "}
+    } },
+    {SetUserPOBox, NULLMENU, 2, {
+      {"set", "Set (Add or Change) a user's post office box"},
+      {"login name", "login name: "}
+    } },
+    {RemoveUserPOBox, NULLMENU, 2, {
+      {"remove", "Remove a user's post office box"},
+      {"login name", "login name: "}
+    } },
+    SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
+  }
+};
+   
+/*
+ * Quota Menu
+ */
+Menu quota_menu = {
+  NULLFUNC,
+  NULLFUNC,
+  "Quota Menu",
+  7,
+  {
+    SIMPLEFUNC("shdef", "Show default user quota (in KB)", ShowDefaultQuota),
+    {ChangeDefaultQuota, NULLMENU, 2, {
+      {"chdef", "Change default user quota"},
+      {"quota", "New quota (in KB): "}
+    } },
+    SIMPLEFUNC("shquota", "Show a user's disk quota on a filesytem",
+              ShowUserQuota),
+    SIMPLEFUNC("addquota", "Add a new disk quota for user on a filesytem",
+              AddUserQuota),
+    SIMPLEFUNC("chquota", "Change a user's disk quota on a filesytem",
+              ChangeUserQuota),
+    SIMPLEFUNC("rmquota", "Remove a user's disk quota on a filesytem",
+              RemoveUserQuota),
+    SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
+  } 
+};
+
+/* ------------------------- First Tier Menus ------------------------- */
+
+/* 
+ * Cluster Menu
+ */
+
+Menu cluster_menu = {
+  NULLFUNC,
+  NULLFUNC,
+  "Cluster Menu",
   7,
   {
     { ShowClusterInfo, NULLMENU, 2, {
       {"show", "Get cluster information"},
       {"name", "Cluster's Name: "}
     } },
-    { MachinesInCluster, NULLMENU, 2, {
-      {"machines", "List all machines in a cluster"},
-      {"clus", "Cluster's Name: "}
-    } },
     { AddCluster, NULLMENU, 2, {
       {"add", "Add a new cluster"},
       {"name","Cluster's Name: "},
@@ -150,185 +216,102 @@ Menu clustermaint_cluster_menu = {
       {"delete", "Delete this cluster"},
       {"name", "Cluster's Name: "}
     } },
-    { AddMachineToCluster, NULLMENU, 3, {
-      {"addcluster","Add machines to a clusters"},
-      {"name","Machine's Name: "},
-      {"cluster", "Cluster's Name: "},
-    } },
-    { RemoveMachineFromCluster, NULLMENU, 3, {
-      {"remcluster", "Remove machines from clusters"},
-      {"name","Machine's Name: "},
-      {"cluster", "Cluster's Name: "},
-    } },
+    SUBMENU("mappings","Machine To Cluster Mappings Menu", &mappings_menu),
+    SUBMENU("c_data","Cluster Data Menu", &cluster_data_menu),
+    SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
   }
 };
 
-Menu clustermaint_data_menu = {
-  NULLFUNC,
-  NULLFUNC,
-  "Cluster Data Maintenence",
-  3,
+/* 
+ * Filesystem Menu
+ */
+
+Menu filesys_menu = {
+  NULLFUNC, 
+  NULLFUNC, 
+  "Filesystem Menu",
+  10,
   {
-    { ShowClusterData, NULLMENU, 3, {
-      {"show", "Show Data on a given Cluster"},
-      {"clus", "Cluster's Name: "},
-      {"label", "Label Identifing the data: "},
+    { GetFS, NULLMENU, 2, {
+      {"get", "Get Filesystem Name Information"},
+      {"name", "Name of Filesystem: "}
     } },
-    { AddClusterData, NULLMENU, 4, {
-      {"add", "Add Data to a given Cluster"},
-      {"clus", "Cluster Name: "},
-      {"label", "Label Identifing the data: "},
-      {"data", "The data to be added: "},
+    { AddFS, NULLMENU, 2, {
+      {"add", "Add New Filesystem to Database"},
+      {"name", "name: "},
     } },
-    { RemoveClusterData, NULLMENU, 4, {
-      {"delete", "Remove Data to a given Cluster"},
-      {"clus", "Cluster's Name: "},
-      {"label", "Label Identifing the data: "},
-      {"data", "The data to be removed: "},
-    } } 
-  }
-};
-
-Menu clustermaint_top_menu = {
-  NULLFUNC,
-  NULLFUNC,
-  "Cluster Maintenence",
-  5,
-  {
-    SUBMENU("machine", "Work on Machines", &clustermaint_machine_menu),
-    SUBMENU("cluster", "Work on Clusters", &clustermaint_cluster_menu),
-    SUBMENU("data", "Work with cluster data", &clustermaint_data_menu),
-    {MachineToClusterMap, NULLMENU, 3, {
-      {"map", "Machine to Cluster Mapping"},
-      {"machine", "Machine Name: "},
-      {"clus", "Cluster Name: "}
+    { ChangeFS, NULLMENU, 2, {
+      {"change", "Update Filesystem Information"},
+      {"name", "name: "},
+    } },
+    { DeleteFS, NULLMENU, 2, {
+      {"delete", "Delete Filesystem"},
+      {"name", "Filesystem Name: "}
+    } },
+    { GetFSAlias, NULLMENU, 2, {
+      {"check", "Check An Association"},
+      {"name", "alias name : "}
+    } },
+    { CreateFSAlias, NULLMENU, 2, {
+      {"alias", "Associate with a Filesystem"},
+      {"name", "alias name : "},
+    } },
+    { DeleteFSAlias, NULLMENU, 2, {
+      {"unalias", "Disassociate from a Filesystem"},
+      {"name", "alias name : "},
     } },
-    SIMPLEFUNC("verbose", "Toggle Delete Confirmation", ToggleVerboseMode),
+    SUBMENU("quotas","Quota Menu", &quota_menu),
+    SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
+    SIMPLEFUNC("help", "Help ..", AttachHelp)
   }
 };
 
 /*
- * Dcmmaint menus
+ * Machine Menu
  */
 
-/* Commenting out all DCM maint stuff. 
-
-Menu dcmmaint_service_menu = {
-  dcmmaint_service_menu_entry,
-  dcmmaint_service_menu_exit,
-  NULL,
-  5,
-  {
-    SIMPLEFUNC("show", "Show fields of service", show_service),
-    SIMPLEFUNC("interval", "Change the interval field", change_interval),
-    SIMPLEFUNC("target_path", "Change the target_path field",
-              change_target_path),
-    SIMPLEFUNC("script", "Change the script field", change_script),
-    SIMPLEFUNC("dfgen",
-              "Change the date of the latest generation of the db file", 
-              change_dfgen)
-  }
-};
-
-Menu dcmmaint_host_info_menu = {
-  dcmmaint_host_info_menu_entry,
-  dcmmaint_host_info_menu_exit,
-  NULL,
-  8,
-  {
-    SIMPLEFUNC("show", "Show values of entry", show_host_info),
-    SIMPLEFUNC("last_time", "Change the last_time field", change_last_time),
-    SIMPLEFUNC("success", "Change the success field", change_success),
-    SIMPLEFUNC("override", "Change the override field", change_override),
-    SIMPLEFUNC("enable", "Change the enable field", change_enable),
-    SIMPLEFUNC("value1", "Change the value1 field", change_value1),
-    SIMPLEFUNC("value2", "Change the value2 field", change_value2),
-    SIMPLEFUNC("rvdacls", "Change the RVD ACLs (for RVD servers only)",
-              update_rvd_server)
-  }
-};
-
-Menu dcmmaint_top_menu = {
+Menu machine_menu = {
   NULLFUNC,
   NULLFUNC,
-  "Data Control Manager Maintenance",
-  9,
+  "Machine Menu",
+  6,
   {
-    SUBMENU("hi_change", "Modify a service-host entry", 
-           &dcmmaint_host_info_menu),
-    SIMPLEFUNC("hi_add", "Create new service-host entry", do_host_info),
-    SIMPLEFUNC("hi_delete", "Remove a service-host entry", do_host_info),
-    SIMPLEFUNC("hi_list", "List service-host entries", do_host_info),
-    SUBMENU("s_change", "Modify info for an existing service",
-           &dcmmaint_service_menu),
-    SIMPLEFUNC("s_add", "Create new service", do_service),
-    SIMPLEFUNC("s_delete", "Remove a service", do_service),
-    SIMPLEFUNC("s_list", "List services", do_service),
-    SIMPLEFUNC("help", "How to use this program", instructions)
+    { ShowMachineInfo, NULLMENU, 2, {
+      {"show","Get machine information"},
+      {"name","Machine's Name: "}
+    } },
+    { AddMachine, NULLMENU, 2, {
+      {"add","Add a new machine"},
+      {"name","Machine's Name: "},
+    } },
+    { UpdateMachine, NULLMENU, 2, {
+      {"update","Update machine information"},
+      {"name","Machine's Name: "},
+    } },
+    { DeleteMachine, NULLMENU, 2, {
+      {"delete","Delete this machine"},
+      {"name","Machine's Name: "}
+    } },
+    SUBMENU("mappings","Machine To Cluster Mappings Menu", &mappings_menu),
+    SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
   }
 };
 
-Commenting out all DCM maint stuff. */
-
 /*
- * Listmaint Menus 
+ * List Menu
  */
 
-Menu listmaint_list_menu = {
+Menu list_menu = {
     NULLFUNC,
     NULLFUNC,
-    "Lists",
-    5,
-    {
-        SIMPLEFUNC("member",
-                  "List all lists to which a given member belongs",
-                  ListByMember),
-       SIMPLEFUNC("admin",
-                  "List all items which a given member can administer",
-                  ListByAdministrator),
-       SIMPLEFUNC("groups", "List all lists which are groups",
-                  ListAllGroups),
-       SIMPLEFUNC("public", "List all public mailing lists",
-                  ListAllPublicMailLists),
-       SIMPLEFUNC("maillists", "List all mailing lists",
-                  ListAllMailLists)
-    }
-};
-
-Menu listmaint_member_menu = {
-    ListmaintMemberMenuEntry,
-    ListmaintMemberMenuExit,
-    NULL,
-    7,
-    {
-       SIMPLEFUNC("add", "Add a member to this list",
-                  AddMember),
-       SIMPLEFUNC("remove", "Remove a member from this list",
-                  DeleteMember),
-       SIMPLEFUNC("all", "Show the members of this list",
-                  ListAllMembers),
-       SIMPLEFUNC("user", "Show the members of type USER",
-                  ListUserMembers),
-       SIMPLEFUNC("list", "Show the members of type LIST",
-                  ListListMembers),
-       SIMPLEFUNC("string", "Show the members of type STRING",
-                  ListStringMembers),
-       SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", 
-                  ToggleVerboseMode)
-    } 
-};
-    
-Menu listmaint_top_menu = {
-    NULLFUNC,
-    NULLFUNC,
-    "List Maintenance Menu",
-    8,
+    "List Menu",
+    10,
     {
        { ShowListInfo, NULLMENU, 2, {
            {"show", "Display information about a list"},
            {"list name", "Name of list: "}
        } },
-        { NULLFUNC, &listmaint_member_menu, 2, {
+        { NULLFUNC, &list_member_menu, 2, {
            {"add", "Create new List"},
            {"list name", "Name of list: "}
        } },
@@ -340,30 +323,30 @@ Menu listmaint_top_menu = {
            {"delete", "Delete a List"},
            {"list name", "Name of list: "}
        } },
-       { NULLFUNC, &listmaint_member_menu, 2, {
-           {"members", "Change/Display the membership of a list"},
-           {"list name", "Name of list: "}
-       } },
        SIMPLEFUNC("query_remove",
                   "Interactively remove an item from all lists",
                   InterRemoveItemFromLists),
-       SUBMENU("list_lists", "Display inventory of lists",
-               &listmaint_list_menu),
-       SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", 
-                  ToggleVerboseMode),
-       SIMPLEFUNC("help", "How to use this program", ListHelp)
+       { NULLFUNC, &list_member_menu, 2, {
+           {"members", "Member Menu - Change/Show Members of a List."},
+           {"list name", "Name of list: "}
+       } },
+       SUBMENU("list_info", "List Info Menu",
+               &list_info_menu),
+       SUBMENU("quotas","Quota Menu", &quota_menu),    
+       SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
+       SIMPLEFUNC("help", "Print Help", ListHelp)
     } 
 };
 
 /*
- * NFSmaint menus.
+ * NFS Physical Menu
  */
 
-Menu nfsmaint_top_menu = {
+Menu nfsphys_menu = {
   NULLFUNC,
   NULLFUNC,
-  "NFS Maintenence",
-  5,
+  "NFS Physical Menu",
+  6,
   {
     { ShowNFSService, NULLMENU, 2, {
       { "show", "Show an NFS server" },
@@ -381,119 +364,21 @@ Menu nfsmaint_top_menu = {
       { "delete", "Delete NFS server"},
       {"machine", "Machine Name: "},
     } },
+    SUBMENU("quotas","Quota Menu", &quota_menu),
     SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
 /*    SIMPLEFUNC("help", "Help", NFSHelp), */
   }
 };
 
 /*
- * Portmaint menus.
- */
-
-/* Queries have not been implemented yet :-( 
-
-Menu servmenu = {
-  NULLFUNC,
-  NULLFUNC,
-  "Server Maintenence",
-  8,
-  {
-    { getserv, NULLMENU, 2, {
-      {"get", "Services Info"},
-      {"serv", "Service Name: "}
-    } },
-    { addserv, NULLMENU, 4, {
-      {"add", "Add Service"},
-      {"srv", "Name: "},
-      {"proto", "Protocol: "},
-      {"port", "Port: "}
-    } },
-    { updserv, NULLMENU, 4, {
-      {"update", "Update Service"},
-      {"srv", "Name: "},
-      {"proto", "Protocol: "},
-      {"port", "Port: "}
-    } },
-    {delserv, NULLMENU, 3, {
-      {"delete", "Delete Service"},
-      {"serv", "Service Name: "},
-      {"proto", "Protocol: "}
-    } },
-    {  getassc, NULLMENU, 2, {
-      {"get_alias", "Get All Aliases for Service"},
-      {"srv", "Service Name: "}
-    } },
-    { alas, NULLMENU, 3, {
-      {"+", "Add Alias"},
-      {"srv", "Service Name: "},
-      {"als", "Alias: "}
-    } },
-    { alas, NULLMENU, 3, {
-      {"-", "Delete Alias"},
-      {"srv", "Service Name: "},
-      {"als", "Alias: "}
-    } },
-    SIMPLEFUNC("toggle", "Toggle Verbosity of Delete", toggle_verb)
-  }
-};
-
-*/
-/*
- * smsmaint - TBS
- */
-
-/* 
- * Usermaint menu.
+ * User Menu
  */
 
-Menu usermaint_pobox_menu = {
+Menu user_menu = {
   NULLFUNC,
   NULLFUNC,
-  "Edit User Post Office Boxes",
-  3,
-  {
-    {GetUserPOBox, NULLMENU, 2, {
-      {"show", "Show a user's post office box"},
-      {"login name", "login name: "}
-    } },
-    {SetUserPOBox, NULLMENU, 2, {
-      {"set", "Set (Add or Change) a user's post office box"},
-      {"login name", "login name: "}
-    } },
-    {RemoveUserPOBox, NULLMENU, 2, {
-      {"remove", "Remove a user's post office box"},
-      {"login name", "login name: "}
-    } },
-  }
-};
-    
-Menu usermaint_quota_menu = {
-  NULLFUNC,
-  NULLFUNC,
-  "Edit User and Default Quotas",
-  6,
-  {
-    SIMPLEFUNC("shdef", "Show default user quota (in KB)", ShowDefaultQuota),
-    {ChangeDefaultQuota, NULLMENU, 2, {
-      {"chdef", "Change default user quota"},
-      {"quota", "New quota (in KB): "}
-    } },
-    SIMPLEFUNC("shquota", "Show a user's disk quota on a filesytem",
-              ShowUserQuota),
-    SIMPLEFUNC("addquota", "Add a new disk quota for user on a filesytem",
-              AddUserQuota),
-    SIMPLEFUNC("chquota", "Change a user's disk quota on a filesytem",
-              ChangeUserQuota),
-    SIMPLEFUNC("rmquota", "Remove a user's disk quota on a filesytem",
-              RemoveUserQuota),
-  } 
-};
-
-Menu usermaint_top_menu = {
-  NULLFUNC,
-  NULLFUNC,
-  "SMS User Maintenance",
-  9,
+  "User Menu",
+  11,
   {
     {ShowUserByLogin, NULLMENU, 2, {
        {"login", "Show user information by login name"},
@@ -524,11 +409,14 @@ Menu usermaint_top_menu = {
       {"udelete", "Delete user by uid"},
       {"uid", "User ID (not MIT ID!): "}
     } },
-    SUBMENU("pobox", "User PO Boxes", &usermaint_pobox_menu),
-    SUBMENU("quota", "User Quotas", &usermaint_quota_menu),
+    SUBMENU("pobox", "Post Office Box Menu", &pobox_menu),
+    SUBMENU("quota", "Quota Menu", &quota_menu),
+    SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
   }
 };
 
+/* ------------------------- Root Menu ------------------------- */
+
 /* 
  * Sms top menu
  */
@@ -537,17 +425,14 @@ Menu sms_top_menu = {
   NULLFUNC,
   NULLFUNC,
   "Sms Database Manipulation",
-  5,
+  6,
   {
-    SUBMENU("attachmaint","open the attachmaint menu",&attachmaint_top_menu),
-    SUBMENU("clustermaint","open the clustermaint menu",
-           &clustermaint_top_menu),
-/*    SUBMENU("dcmmaint","open the dcmmaint menu",&dcmmaint_top_menu), */
-    SUBMENU("listmaint","open the listmaint menu",&listmaint_top_menu),
-    SUBMENU("nfsmaint","open the nfsmaint menu",&nfsmaint_top_menu),
-/*    SUBMENU("portmaint","open the portmaint menu",&portmaint_top_menu), */
-/*    SUBMENU("smsmaint","open the smsmaint menu",&smsmaint_top_menu), */
-    SUBMENU("usermaint","open the usermaint menu",&usermaint_top_menu)
+    SUBMENU("cluster","Cluster Menu",&cluster_menu),
+    SUBMENU("filesys","Filesystem Menu", &filesys_menu),
+    SUBMENU("list","Lists and Group Menu", &list_menu),
+    SUBMENU("machine","Machine Menu",&machine_menu),
+    SUBMENU("nfs","NFS Physical Menu", &nfsphys_menu),
+    SUBMENU("user","User Menu", &user_menu)
   }
 };  
        
index 52fe5c20127d39a7ff27db3cebd633cdecf8fb35..38e1ead94624ad0f0b5464b025887ab7433a9cdd 100644 (file)
@@ -2,9 +2,9 @@
   static char rcsid_module_c[] = "$Header$";
 #endif lint
 
-/*     This is the file nfs.c for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
- *     It Contains: The nfs maintanance code.
+/*     This is the file nfs.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
+ *     It Contains: All functions for manipulating NFS Physical directories.
  *     
  *     Created:        5/6/88
  *     By:             Chris D. Peterson
@@ -13,7 +13,7 @@
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
@@ -25,8 +25,8 @@
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 #include "infodefs.h"
 
index 1e219a5a94e177fdd1abab920574ad401f7ae4f9..fcc348ce9ef2400d7e3ade7488f975bfa315ed38 100644 (file)
@@ -2,24 +2,23 @@
   static char rcsid_module_c[] = "$Header$";
 #endif lint
 
-/*     This is the file ***FILE for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
- *     It Contains: 
+/*     This is the file pobox.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
+ *     It Contains: Functions for handling the poboxes.
  *     
- *     Created:        
- *     By:             
+ *     Created:        7/10/88
+ *     By:             Chris D. Peterson
  *
  *      $Source$
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
  */
 
-
 #include <stdio.h>
 #include <strings.h>
 #include <ctype.h>
@@ -27,8 +26,8 @@
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 #include "infodefs.h"
 
@@ -68,10 +67,10 @@ char ** info;
 /*     Function Name: PrintPOMachines
  *     Description: Prints all current post offices.
  *     Arguments: none.
- *     Returns: none.
+ *     Returns: SUB_ERROR if the machines could not be printed.
  */
 
-static void
+static int
 PrintPOMachines()
 {
     register int status;
@@ -79,12 +78,15 @@ PrintPOMachines()
     struct qelem * top = NULL;
     
     if ( (status = sms_query("get_server_locations", CountArgs(args), args,
-                            StoreInfo, &top)) != SMS_SUCCESS)
-       com_err(program_name, status, "in get_server_locations.");
+                            StoreInfo, &top)) != SMS_SUCCESS) {
+       com_err(program_name, status, " in get_server_locations.");
+       return(SUB_ERROR);
+    }
     
     top = QueueTop(top);
     Loop(top, RealPrintPOMachines);
     FreeQueue(top);
+    return(SUB_NORMAL);
 }
 
 /*     Function Name: GetUserPOBox
@@ -126,7 +128,7 @@ char ** argv;
 /*     Function Name: GetNewLocalPOBox
  *     Description: get the machine for a new local pop Box for the user.
  *     Arguments: local_user - name of the local user.
- *     Returns: machine - name of the machine for then new pop box.
+ *     Returns: machine - name of the machine for then new pop box, or NULL.
  */
 
 static char *
@@ -140,10 +142,14 @@ char * local_user;
     sprintf(temp_buf,"%s %s", "Pick one of the following",
            "machines for this user's Post Office.");
     Put_message(temp_buf);
-    PrintPOMachines();
     Put_message("");
-    Prompt_input("Which Machine? ", temp_buf, BUFSIZ);
-    return( Strsave(temp_buf) );
+    if (PrintPOMachines() == SUB_NORMAL) {
+       Put_message("");
+       Prompt_input("Which Machine? ", temp_buf, BUFSIZ);
+       return( Strsave(temp_buf) );
+    }
+    Put_message("Could not get machines to choose from, quitting.");
+    return(NULL);
 }
 
 /*     Function Name: SetUserPOBox
@@ -159,6 +165,7 @@ char **argv;
 {
     register int status;
     char *type, temp_buf[BUFSIZ], *local_user, *args[10], box[BUFSIZ];
+    char *temp_box;
     local_user = argv[1];
 
     if (!ValidName(local_user))
@@ -177,14 +184,24 @@ char **argv;
            case SMS_SUCCESS:
                return(DM_NORMAL);
            case SMS_MACHINE:
-               strcpy(box, GetNewLocalPOBox(local_user));
+               if ( (temp_box = GetNewLocalPOBox(local_user)) == SUB_NORMAL) {
+                   strcpy(box, temp_box);
+                   free(temp_box);
+               }
+               else
+                   return(DM_NORMAL);
                break;
            default:
                com_err(program_name, status, "in set_pobox_pop.");
                return(DM_NORMAL);
            }
        case FALSE:
-           strcpy(box, GetNewLocalPOBox(local_user));
+               if ( (temp_box = GetNewLocalPOBox(local_user)) == SUB_NORMAL) {
+                   strcpy(box, temp_box);
+                   free(temp_box);
+               }
+               else
+                   return(DM_NORMAL);
            break;
        default:
            return(DM_NORMAL);
index 78e4d8a8a54b8d0bcc7682a15208eea981be802e..450105bd79e2db5ca40dd0425bc9f817118754ea 100644 (file)
@@ -2,32 +2,31 @@
   static char rcsid_module_c[] = "$Header$";
 #endif lint
 
-/*     This is the file ***FILE for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
- *     It Contains: 
+/*     This is the file quota.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
+ *     It Contains: Functions for manipulating the quota information.
  *     
- *     Created:        
- *     By:             
+ *     Created:        7/10/88
+ *     By:             Chris D. Peterson
  *
  *      $Source$
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
  */
 
-
 #include <stdio.h>
 #include <strings.h>
 #include <sms.h>
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 #include "infodefs.h"
 
index 649a8553cb7cbdc8f14db63e6407da573825dd36..3a2f01c5bc4c13906ac646c9d8b4eeba22a3fd82 100644 (file)
@@ -2,9 +2,9 @@
   static char rcsid_module_c[] = "$Header$";
 #endif lint
 
-/*     This is the file user.c for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
- *     It Contains: the functions for usermaint.
+/*     This is the file user.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
+ *     It Contains: Functions for manipulating user information.
  *     
  *     Created:        5/9/88
  *     By:             Chris D. Peterson
@@ -13,7 +13,7 @@
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
@@ -25,8 +25,8 @@
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 #include "infodefs.h"
 
index e7cf161a1b9fb0981bbeec525f099f3602ac37e8..880d7689987c9f110bbe8f066074a47bbbb132c7 100644 (file)
@@ -2,9 +2,9 @@
   static char rcsid_module_c[] = "$Header$";
 #endif lint
 
-/*     This is the file utils.c for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
- *     It Contains: Many utilities used by allmaint.
+/*     This is the file utils.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
+ *     It Contains:  Many useful utility functions.
  *     
  *     Created:        4/25/88
  *     By:             Chris D. Peterson
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
  */
 
-
 #include <stdio.h>
 #include <strings.h>
 #include <sms.h>
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 #include "infodefs.h"
 
 #include <netdb.h>             /* for gethostbyname. */
 
+/*     Function Name: AddQueue
+ *     Description: Adds an element to a queue
+ *     Arguments: elem, pred - element and its predecessor.
+ *     Returns: none.
+ */
+
+static void
+AddQueue(elem, pred)
+struct qelem * elem, *pred;
+{
+    if (pred == NULL) {
+       elem->q_forw = NULL;
+       elem->q_back = NULL;
+       return;
+    }
+    elem->q_back = pred;
+    elem->q_forw = pred->q_forw;
+    pred->q_forw = elem;
+}
+
+/*     Function Name: RemoveQueue
+ *     Description: removes an element from a queue.
+ *     Arguments: elem.
+ *     Returns: none.
+ */
+
+static void
+RemoveQueue(elem)
+struct qelem *elem;
+{
+    if (elem->q_forw != NULL) 
+       (elem->q_forw)->q_back = elem->q_back;
+    if (elem->q_back != NULL)
+       (elem->q_back)->q_forw = elem->q_forw;
+}
+
 /*     Function Name: FreeInfo
  *     Description: Frees all elements of a NULL terminated arrary of char*'s
  *     Arguments: info - array who's elements we are to free.
@@ -90,7 +125,7 @@ struct qelem * elem;
  *     Returns: none
  */
 
-void
+static void
 FreeQueueElem(elem)
 struct qelem * elem;
 {
@@ -123,40 +158,6 @@ struct qelem * elem;
     }
 }
 
-/*     Function Name: AddQueue
- *     Description: Adds an element to a queue
- *     Arguments: elem, pred - element and its predecessor.
- *     Returns: none.
- */
-
-AddQueue(elem, pred)
-struct qelem * elem, *pred;
-{
-    if (pred == NULL) {
-       elem->q_forw = NULL;
-       elem->q_back = NULL;
-       return;
-    }
-    elem->q_back = pred;
-    elem->q_forw = pred->q_forw;
-    pred->q_forw = elem;
-}
-
-/*     Function Name: RemoveQueue
- *     Description: removes an element from a queue.
- *     Arguments: elem.
- *     Returns: none.
- */
-
-RemoveQueue(elem)
-struct qelem *elem;
-{
-    if (elem->q_forw != NULL) 
-       (elem->q_forw)->q_back = elem->q_back;
-    if (elem->q_back != NULL)
-       (elem->q_back)->q_forw = elem->q_forw;
-}
-
 /*     Function Name: QueueCount
  *     Description: Counts the number of elements in a queue
  *     Arguments: elem - any element in the queue.
@@ -176,6 +177,18 @@ struct qelem * elem;
     return(count);
 }
 
+/*     Function Name: StoreInfo
+ *     Description: Stores information from an sms query into a queue.
+ *     Arguments: argc, argv, - information returned from the query returned
+ *                               in argv.
+ *                 data - the previous element on the queue, this data will be
+ *                        stored in a qelem struct immediatly after this elem.
+ *                        If NULL then a new queue will be created.  This value
+ *                        is updated to the current element at the end off the
+ *                        call.
+ *     Returns: SMS_CONT, or SMS_ABORT if it has problems.
+ */
+
 int
 StoreInfo(argc, argv, data)
 int argc;
@@ -342,11 +355,11 @@ int bool_def;
  *     Returns:   TRUE/FALSE - wether or not the confirmation occured.
  */
 
-int
+Bool
 Confirm(prompt)
 char * prompt;
 {
-  return( !verbose || YesNoQuestion(prompt,FALSE) );
+  return( !verbose || (YesNoQuestion(prompt,FALSE) == TRUE) );
 }
 
 /*     Function Name: ValidName
@@ -357,7 +370,7 @@ char * prompt;
 
 Bool
 ValidName(s)
-    char *s;
+char *s;
 {
     if (IS_EMPTY(s))
        Put_message("Please use a non-empty name.");
@@ -412,6 +425,7 @@ NullFunc()
  *             big way.
  */
 
+void
 SlipInNewName(info, name)
 char ** info;
 char * name;
@@ -441,12 +455,20 @@ char * prompt, ** pointer;
     char buf[BUFSIZ];
 
     if (PromptWithDefault(prompt, buf, BUFSIZ, *pointer) == -1)
-       return(FALSE);
+       return(SUB_ERROR);
 
-    if (*pointer != NULL)
-       free(*pointer);
-    *pointer = Strsave(buf);
-    return(TRUE);
+/* 
+ * If these are the same then there is no need to allocate a new string.
+ *
+ * a difference that makes no difference, IS no difference.
+ */
+
+    if (strcmp(buf, *pointer) != 0) { 
+       if (*pointer != NULL)
+           free(*pointer);
+       *pointer = Strsave(buf);
+    }
+    return(SUB_NORMAL);
 }
 
 /*     Function Name: GetYesNoValueFromUser
@@ -476,18 +498,18 @@ char * prompt, ** pointer;
     case TRUE:
        if (*pointer != NULL)
            free(*pointer);
-       *pointer = Strsave("1");
+       *pointer = Strsave(DEFAULT_YES);
        break;
     case FALSE:
        if (*pointer != NULL)
            free(*pointer);
-       *pointer = Strsave("0");
+       *pointer = Strsave(DEFAULT_NO);
        break;
     case -1:
     default:
-       return(FALSE);
+       return(SUB_ERROR);
     }
-    return(TRUE);
+    return(SUB_NORMAL);
 }
 
 /*     Function Name: GetFSVal
@@ -671,7 +693,7 @@ char **argv, *callback;
     if (callback == NULL)
        return( Print(argc, argv, callback) );
     if (strcmp(argv[0], callback) == 0) 
-       return( Print(1, argv + 1, callback) );
+       return( Print(argc, argv, callback) );
     return(SMS_CONT);
 }
 
@@ -755,7 +777,7 @@ char * query_string;
            (*op_func) (info, one_item);
        else {
            name = (*print_func) (info); /* call print function. */
-           sprintf(temp_buf,"%s %s (y/n/q) ?", query_string, name);
+           sprintf(temp_buf,"%s %s (y/n/q)", query_string, name);
            switch(YesNoQuitQuestion(temp_buf, FALSE)) {
            case TRUE:
                (*op_func) (info, one_item);
index e28a673b0c4d16951ffc7d7951836357f9418f55..848ec1ced63debe0fdcc3478371f3a2536d18f5e 100644 (file)
@@ -1,6 +1,6 @@
-/*     This is the file infodefs.h for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
- *     It Contains: Definitions
+/*     This is the file infodefs.h for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
+ *     It Contains: useful typdefs.
  *     
  *     Created:        6/8/88
  *     By:             Chris D. Peterson
@@ -9,22 +9,22 @@
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
  */
 
 /*
- *     This file contains all the definitions that allow easy access to 
- * elements returned by most of the SMS queries that return information.
+ *     This file contains all definitions that allow easy access to 
+ * elements returned by most of the @i[SMS] queries.
  *
- *     If order of the arguments in the SMS queries change (again) then all
- * that need to be changed is the values of these items and all
- * should be well.
+ *     If the order of the arguments in the @i[SMS] queries change (again)
+ *  then all that needs to be changed are the values of these items 
+ * and all should be well, (hopefully :-).
  *
  *                                 Chris D. Peterson - kit@athena
- *                                   6/8/88
+ *                                   7/27/88
  */
 
 #ifndef _infodefs_
This page took 0.138263 seconds and 5 git commands to generate.