]> andersk Git - moira.git/blobdiff - clients/moira/menus.c
Enlarge magic constant. Fix this a better way at some point.
[moira.git] / clients / moira / menus.c
index 336b8c490e974413a565b97a2aa2dc5bbdce5c31..22fc7e074ebcfe12cee869894b130db15818c31f 100644 (file)
@@ -1,32 +1,28 @@
-#if (!defined(lint) && !defined(SABER))
-  static char rcsid_module_c[] = "$Header$";
-#endif
-
-/*     This is the file menus.c for the MOIRA Client, which allows a nieve
- *      user to quickly and easily maintain most parts of the MOIRA database.
+/* $Id$
+ *
+ *     This is the file menus.c for the Moira Client, which allows users
+ *      to quickly and easily maintain most parts of the Moira database.
  *     It Contains: All menu definitions.
  *
  *     Created:        4/11/88
  *     By:             Chris D. Peterson
  *
- *      $Source$
- *      $Author$
- *      $Header$
- *
- *     Copyright 1988 by the Massachusetts Institute of Technology.
- *
- *     For further information on copyright and distribution
- *     see the file mit-copyright.h
+ * Copyright (C) 1988-1998 by the Massachusetts Institute of Technology.
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
  */
 
 #include <stdio.h>
-#include <menu.h>
 
 #include "mit-copyright.h"
+#include <moira.h>
 #include "defs.h"
 #include "f_defs.h"
 #include "globals.h"
 
+#include <stdio.h>
+
+RCSID("$Header$");
 
 /* ------------------------- Second Tier Menus ------------------------- */
 
@@ -81,6 +77,21 @@ Menu list_info_menu = {
   }
 };
 
+/*
+ * List Member Tags Menu
+ */
+
+Menu list_tags_menu = {
+  NULL,
+  NULL,
+  "List Member Tags Menu",
+  2,
+  {
+    SIMPLEFUNC("change", "Change the tag on a list member", TagMember),
+    SIMPLEFUNC("show", "Show all list members with tags", ListMembersWithTags),
+  }
+};
+
 /*
  * List Member Menu
  */
@@ -89,7 +100,7 @@ Menu list_member_menu = {
   ListmaintMemberMenuEntry,
   ListmaintMemberMenuExit,
   NULL,
-  7,
+  8,
   {
     SIMPLEFUNC("add", "Add a member to this list", AddMember),
     SIMPLEFUNC("remove", "Remove a member from this list", DeleteMember),
@@ -98,6 +109,7 @@ Menu list_member_menu = {
     SIMPLEFUNC("list", "Show the members of type LIST", ListListMembers),
     SIMPLEFUNC("string", "Show the members of type STRING",
               ListStringMembers),
+    SUBMENU("tags", "List Member Tags Menu", &list_tags_menu),
     SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
   }
 };
@@ -131,6 +143,38 @@ Menu mappings_menu = {
   }
 };
 
+/*
+ * Machine to Container Mappings Menu
+ */
+
+Menu cmappings_menu = {
+  NULLFUNC,
+  NULLFUNC,
+  "Machine to Container Mappings Menu",
+  5,
+  {
+    { MachineToContainerMap, NULLMENU, 2, {
+      {"map", "Show Machine to container mapping"},
+      {"name", "Machine's Name: "}
+    } },
+    { AddMachineToContainer, NULLMENU, 3, {
+      {"addcontainer", "Add machine to a container"},
+      {"name", "Machine's Name: "},
+      {"container", "Container's Name: "},
+    } },
+    { RemoveMachineFromContainer, NULLMENU, 3, {
+      {"remcontainer", "Remove machine from a container"},
+      {"name", "Machine's Name: "},
+      {"container", "Container's Name: "},
+    } },
+    { GetMachinesOfContainer, NULLMENU, 2, {
+      {"machofcont", "Show all machines in a container"},
+      {"name", "Container's Name: "},
+    } },
+    SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
+  }
+};
+
 /*
  * Post Office Box Menu
  */
@@ -139,7 +183,7 @@ Menu pobox_menu = {
   NULLFUNC,
   NULLFUNC,
   "Post Office Box Menu",
-  4,
+  5,
   {
     {GetUserPOBox, NULLMENU, 2, {
       {"show", "Show a user's post office box"},
@@ -149,6 +193,10 @@ Menu pobox_menu = {
       {"set", "Set (Add or Change) a user's post office box"},
       {"login name", "login name: "}
     } },
+    {SplitUserPOBox, NULLMENU, 2, {
+      {"split", "Split 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: "}
@@ -292,6 +340,34 @@ Menu host_menu = {
   }
 };
 
+/* User Reservations Menu */
+Menu reservations_menu = {
+  NULLFUNC,
+  NULLFUNC,
+  "User Reservations Menu",
+  4,
+  {
+    { GetUserReservations, NULLMENU, 2, {
+      { "get", "Get User Reservations" },
+      { "login name", "User login name: " },
+    } },
+    { AddUserReservation, NULLMENU, 3, {
+      { "add", "Add User Reservation" },
+      { "login name", "User login name: " },
+      { "reservation", "Reservation: " },
+    } },
+    { DelUserReservation, NULLMENU, 3, {
+      { "delete", "Delete User Reservation" },
+      { "login name", "User login name: " },
+      { "reservation", "Reservation: " },
+    } },
+    { GetUserByReservation, NULLMENU, 2, {
+      { "getres", "Get Users by Reservation" },
+      { "reservation", "Reservation: " },
+    } },
+  }
+};
+
 /* ------------------------- First Tier Menus ------------------------- */
 
 /*
@@ -359,15 +435,15 @@ Menu filesys_menu = {
     SUBMENU("fsgroups", "File System Groups Menu", &fsgroup_menu),
     { GetFSAlias, NULLMENU, 2, {
       {"check", "Check An Association"},
-      {"name", "alias name : "}
+      {"name", "Alias name: "}
     } },
     { CreateFSAlias, NULLMENU, 2, {
       {"alias", "Associate with a Filesystem"},
-      {"name", "alias name : "},
+      {"name", "Alias name: "},
     } },
     { DeleteFSAlias, NULLMENU, 2, {
       {"unalias", "Disassociate from a Filesystem"},
-      {"name", "alias name : "},
+      {"name", "Alias name: "},
     } },
     SUBMENU("quotas", "Quota Menu", &quota_menu),
 /*    SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode), */
@@ -434,7 +510,7 @@ Menu machine_menu = {
   NULLFUNC,
   NULLFUNC,
   "Machine Menu",
-  7,
+  9,
   {
     { ShowMachineInfo, NULLMENU, 2, {
       {"show", "Get machine information"},
@@ -447,6 +523,9 @@ Menu machine_menu = {
       {"location", "Location (or leave empty to match any): "},
       {"network", "Network (or leave empty to match any): "}
     } },
+    SIMPLEFUNC("owner", "Lookup machines by owner", MachineByOwner),
+    SIMPLEFUNC("acctnumber", "Lookup machines by account number",
+              MachineByAcctNumber),
     { AddMachine, NULLMENU, 2, {
       {"add", "Add a new machine"},
       {"network", "Network assignment: "},
@@ -561,23 +640,6 @@ Menu krbmap_menu = {
   }
 };
 
-Menu mitdir_menu = {
-  NULLFUNC,
-  NULLFUNC,
-  "MIT On-line Directory Preferences Menu",
-  2,
-  {
-    { GetDirFlags, NULLMENU, 2, {
-      { "show", "Show Directory Preferences" },
-      { "login", "Login name: " },
-    } },
-    { SetDirFlags, NULLMENU, 2, {
-      { "change", "Change Directory Preference" },
-      { "login", "Login name: " },
-    } },
-  }
-};
-
 /*
  * User Menu
  */
@@ -605,6 +667,7 @@ Menu user_menu = {
       {"id", "Show user information by ID number"},
       {"ID number", "ID number: "}
     } },
+    SIMPLEFUNC("sponsor", "Lookup users by sponsor", UserBySponsor),
     {UpdateUser, NULLMENU, 2, {
       {"modify", "Change all user fields"},
       {"login", "Login name: "}
@@ -622,7 +685,7 @@ Menu user_menu = {
     } },
     SUBMENU("pobox", "Post Office Box Menu", &pobox_menu),
     SUBMENU("krbmap", "User Kerberos Mappings", &krbmap_menu),
-    SUBMENU("mitdir", "MIT On-line Directory Preferences", &mitdir_menu),
+    SUBMENU("reservations", "User Reservations Menu", &reservations_menu),
   }
 };
 
@@ -642,82 +705,85 @@ Menu dcm_menu = {
     }
 };
 
-/*
- * Printcap Printer Menu
- */
-
-Menu printer_menu = {
+Menu printserver_menu = {
   NULLFUNC,
   NULLFUNC,
-  "Printer Menu",
+  "Print Server Menu",
   4,
   {
-    { GetPcap, NULLMENU, 2, {
-      {"get", "Get Printcap Entry Information"},
-      {"name", "Name of Printer: "}
+    { GetPrintSrv, NULLMENU, 2, {
+      {"get", "Get Print Server Information"},
+      {"name", "Name of server: "}
     } },
-    { AddPcap, NULLMENU, 2, {
-      {"add", "Add New Printcap Entry to Database"},
-      {"name", "name: "},
+    { AddPrintSrv, NULLMENU, 2, {
+      {"add", "Add a New Print Server"},
+      {"name", "Name of server: "}
     } },
-    { ChngPcap, NULLMENU, 2, {
-      {"change", "Update Printer Information"},
-      {"name", "name: "},
+    { ChangePrintSrv, NULLMENU, 2, {
+      {"change", "Modify a Print Server"},
+      {"name", "Name of server: "}
     } },
-    { DeletePcap, NULLMENU, 2, {
-      {"delete", "Delete Printcap Entry"},
-      {"name", "Printer Name: "}
+    { DelPrintSrv, NULLMENU, 2, {
+      {"delete", "Delete a Print Server"},
+      {"name", "Name of server: "}
     } }
   }
 };
 
-
 /*
- * Palladium Printer Menu
+ * Printer Menu
  */
 
-Menu palladium_menu = {
+Menu printer_menu = {
   NULLFUNC,
   NULLFUNC,
   "Printer Menu",
-  7,
+  11,
   {
-    { GetPalladium, NULLMENU, 2, {
-      {"get", "Get Palladium Server/Supervisor Information"},
+    { GetPrn, NULLMENU, 2, {
+      {"get", "Get Printer Information"},
       {"name", "Name of Printer: "}
     } },
-    { AddPalladium, NULLMENU, 2, {
-      {"add", "Add New Palladium Server/Supervisor to Database"},
-      {"name", "Supervisor/server name: "},
+    { GetPrnByHostname, NULLMENU, 2, {
+      {"hostname", "Look up Printer Information by Printer Hostname"},
+      {"name", "Hostname of Printer: "}
     } },
-    { ChngPalladium, NULLMENU, 2, {
-      {"change", "Update Palladium Server/Supervisor Information"},
-      {"name", "name: "},
+    { GetPrnByEthernet, NULLMENU, 2, {
+      {"ether", "Look up Printer Information by Ethernet address"},
+      {"hwaddr", "Ethernet address of Printer: "}
     } },
-    { DeletePalladium, NULLMENU, 2, {
-      {"delete", "Delete Palladium Server/Supervisor Entry"},
-      {"name", "Printer Name: "}
+    { GetPrnByRM, NULLMENU, 2, {
+      {"rm", "Look up Printer Information by Print Spooler"},
+      {"name", "Hostname of spooler: "}
+    } },
+    { GetPrnByLocation, NULLMENU, 2, {
+      {"loc", "Look up Printer Information by Location"},
+      {"location", "Location: "}
+    } },
+    { GetPrnByContact, NULLMENU, 2, {
+      {"contact", "Look up Printer Information by Contact Info"},
+      {"contact", "Contact: "}
     } },
-    { ShowPalladiumAlias, NULLMENU, 3, {
-      {"getprinter", "Show Logical Printers"},
-      {"newname", "Printer name: "},
-      {"server", "Supervisor or Server name: "},
+    { AddPrn, NULLMENU, 2, {
+      {"add", "Add New Printer to Database"},
+      {"name", "name: "},
     } },
-    { AddPalladiumAlias, NULLMENU, 3, {
-      {"addprinter", "Add Logical Printer"},
-      {"newname", "New printer: "},
-      {"server", "Supervisor or Server name: "},
+    { ChngPrn, NULLMENU, 2, {
+      {"change", "Update Printer Information"},
+      {"name", "name: "},
     } },
-    { DeletePalladiumAlias, NULLMENU, 3, {
-      {"delprinter", "Remove Logical Printer"},
-      {"newname", "Printer name: "},
-      {"server", "Supervisor or Server name: "},
+    { DeletePrn, NULLMENU, 2, {
+      {"delete", "Delete Printer"},
+      {"name", "Printer Name: "}
     } },
+    { UpdateHWAddr, NULLMENU, 2, {
+      {"hwaddr", "Update Printer Hardware Address"},
+      {"name", "Printer hostname: "}
+    } },
+    SUBMENU("server", "Print Servers Menu", &printserver_menu),
   }
 };
 
-
-
 /*
  * Zephyr Menu
  */
@@ -751,6 +817,69 @@ Menu zephyr_menu = {
   }
 };
 
+/*
+ * ACL Menu
+ */
+
+Menu acl_menu = {
+  NULLFUNC,
+  NULLFUNC,
+  "Generic ACL Menu",
+  3,
+  {
+    { GetACL, NULLMENU, 3, {
+      {"get", "Get ACL Information"},
+      {"host", "Machine: "},
+      {"target", "Target file: "}
+    } },
+    { AddACL, NULLMENU, 3, {
+      {"add", "Add New ACL"},
+      {"host", "Machine: "},
+      {"target", "Target file: "}
+    } },
+    { DeleteACL, NULLMENU, 3, {
+      {"delete", "Delete ACL"},
+      {"host", "Machine: "},
+      {"target", "Target file: "}
+    } },
+  }
+};
+
+/*
+ * Container Menu
+ */
+
+Menu container_menu = {
+  NULLFUNC,
+  NULLFUNC,
+  "Container Menu",
+  8,
+  {
+    { ShowContainerInfo, NULLMENU, 2, {
+      {"show", "Get container information"},
+      {"name", "Container's Name: "}
+    } },
+    { AddContainer, NULLMENU, 2, {
+      {"add", "Add a new container"},
+      {"name", "Container's Name: "}
+    } },
+    { UpdateContainer, NULLMENU, 2, {
+      {"update", "Update container information"},
+      {"name", "Container's Name: "}
+    } },
+    { DeleteContainer, NULLMENU, 2, {
+      {"delete", "Delete this container"},
+      {"name", "Container's Name: "}
+    } },
+    { GetSubContainers, NULLMENU, 2, {
+      {"subcont", "Get subcontainers of container"},
+      {"name", "Container's Name: "}
+    } },
+    SIMPLEFUNC("toplevel", "Get all top level containers", GetTopLevelCont),
+    SUBMENU("mappings", "Machine to Container Mappings Menu", &cmappings_menu),
+    SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
+  }
+};
 
 /*
  * Miscellaneous Menu
@@ -787,7 +916,7 @@ Menu moira_top_menu = {
   NULLFUNC,
   NULLFUNC,
   "Moira Database Manipulation",
-  12,
+  13,
   {
     SUBMENU("cluster", "Cluster Menu", &cluster_menu),
     SUBMENU("filesys", "Filesystem Menu", &filesys_menu),
@@ -795,11 +924,12 @@ Menu moira_top_menu = {
     SUBMENU("machine", "Machine Menu", &machine_menu),
     SUBMENU("network", "Network Menu", &subnet_menu),
     SUBMENU("nfs", "NFS Physical Menu", &nfsphys_menu),
-    SUBMENU("palladium", "Palladium Printer Menu", &palladium_menu),
-    SUBMENU("printcap", "Printcap Printer Menu", &printer_menu),
+    SUBMENU("printer", "Printer Menu", &printer_menu),
     SUBMENU("user", "User Menu", &user_menu),
     SUBMENU("zephyr", "Zephyr ACLS Menu", &zephyr_menu),
     SUBMENU("dcm", "DCM Menu", &dcm_menu),
+    SUBMENU("acl", "Generic ACL Menu", &acl_menu),
+    SUBMENU("container", "Container Menu", &container_menu),
     SUBMENU("misc", "Miscellaneous Menu", &misc_menu)
   }
 };
This page took 0.604654 seconds and 4 git commands to generate.