1 #if (!defined(lint) && !defined(SABER))
2 static char rcsid_module_c[] = "$Header$";
5 /* This is the file menus.c for the SMS Client, which allows a nieve
6 * user to quickly and easily maintain most parts of the SMS database.
7 * It Contains: All menu definitions.
10 * By: Chris D. Peterson
16 * Copyright 1988 by the Massachusetts Institute of Technology.
18 * For further information on copyright and distribution
19 * see the file mit-copyright.h
25 #include "mit-copyright.h"
30 /* ------------------------- Second Tier Menus ------------------------- */
36 Menu cluster_data_menu = {
42 { ShowClusterData, NULLMENU, 3, {
43 {"show", "Show Data on a given Cluster"},
44 {"clus", "Cluster's Name: "},
45 {"label", "Label Identifing the data: "},
47 { AddClusterData, NULLMENU, 4, {
48 {"add", "Add Data to a given Cluster"},
49 {"clus", "Cluster Name: "},
50 {"label", "Label Identifing the data: "},
51 {"data", "The data to be added: "},
53 { RemoveClusterData, NULLMENU, 4, {
54 {"delete", "Remove Data to a given Cluster"},
55 {"clus", "Cluster's Name: "},
56 {"label", "Label Identifing the data: "},
57 {"data", "The data to be removed: "},
59 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
64 * List Information Menu
67 Menu list_info_menu = {
70 "List Information Menu",
74 "Show all lists to which a given member belongs",
77 "Show all items which a given member can administer",
79 SIMPLEFUNC("groups", "Show all lists which are groups",
81 SIMPLEFUNC("public", "Show all public mailing lists",
82 ListAllPublicMailLists),
83 SIMPLEFUNC("maillists", "Show all mailing lists",
92 Menu list_member_menu = {
93 ListmaintMemberMenuEntry,
94 ListmaintMemberMenuExit,
98 SIMPLEFUNC("add", "Add a member to this list", AddMember),
99 SIMPLEFUNC("remove", "Remove a member from this list", DeleteMember),
100 SIMPLEFUNC("all", "Show the members of this list", ListAllMembers),
101 SIMPLEFUNC("user", "Show the members of type USER", ListUserMembers),
102 SIMPLEFUNC("list", "Show the members of type LIST", ListListMembers),
103 SIMPLEFUNC("string", "Show the members of type STRING",
105 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
110 * Machine To Cluster Mappings Menu
113 Menu mappings_menu = {
116 "Machine To Cluster Mappings Menu",
119 { MachineToClusterMap, NULLMENU, 3, {
120 {"map", "Show Machine to cluster mapping"},
121 {"name", "Machine's Name: "},
122 {"cluster", "Cluster's Name: "},
124 { AddMachineToCluster, NULLMENU, 3, {
125 {"addcluster","Add machines to a clusters"},
126 {"name","Machine's Name: "},
127 {"cluster", "Cluster's Name: "},
129 { RemoveMachineFromCluster, NULLMENU, 3, {
130 {"remcluster", "Remove machines from clusters"},
131 {"name","Machine's Name: "},
132 {"cluster", "Cluster's Name: "},
134 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
139 * Post Office Box Menu
145 "Post Office Box Menu",
148 {GetUserPOBox, NULLMENU, 2, {
149 {"show", "Show a user's post office box"},
150 {"login name", "login name: "}
152 {SetUserPOBox, NULLMENU, 2, {
153 {"set", "Set (Add or Change) a user's post office box"},
154 {"login name", "login name: "}
156 {RemoveUserPOBox, NULLMENU, 2, {
157 {"remove", "Remove a user's post office box"},
158 {"login name", "login name: "}
160 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
174 SIMPLEFUNC("shdef", "Show default user quota (in KB)", ShowDefaultQuota),
175 {ChangeDefaultQuota, NULLMENU, 2, {
176 {"chdef", "Change default user quota"},
177 {"quota", "New quota (in KB): "}
179 SIMPLEFUNC("shquota", "Show a user's disk quota on a filesytem",
181 SIMPLEFUNC("addquota", "Add a new disk quota for user on a filesytem",
183 SIMPLEFUNC("chquota", "Change a user's disk quota on a filesytem",
185 SIMPLEFUNC("rmquota", "Remove a user's disk quota on a filesytem",
187 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
191 /* ------------------------- First Tier Menus ------------------------- */
197 Menu cluster_menu = {
203 { ShowClusterInfo, NULLMENU, 2, {
204 {"show", "Get cluster information"},
205 {"name", "Cluster's Name: "}
207 { AddCluster, NULLMENU, 2, {
208 {"add", "Add a new cluster"},
209 {"name","Cluster's Name: "},
211 { UpdateCluster, NULLMENU, 2, {
212 {"update", "Update cluster information"},
213 {"name","Cluster's Name: "},
215 { DeleteCluster, NULLMENU, 2, {
216 {"delete", "Delete this cluster"},
217 {"name", "Cluster's Name: "}
219 SUBMENU("mappings","Machine To Cluster Mappings Menu", &mappings_menu),
220 SUBMENU("c_data","Cluster Data Menu", &cluster_data_menu),
221 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
229 Menu filesys_menu = {
235 { GetFS, NULLMENU, 2, {
236 {"get", "Get Filesystem Name Information"},
237 {"name", "Name of Filesystem: "}
239 { AddFS, NULLMENU, 2, {
240 {"add", "Add New Filesystem to Database"},
243 { ChangeFS, NULLMENU, 2, {
244 {"change", "Update Filesystem Information"},
247 { DeleteFS, NULLMENU, 2, {
248 {"delete", "Delete Filesystem"},
249 {"name", "Filesystem Name: "}
251 { GetFSAlias, NULLMENU, 2, {
252 {"check", "Check An Association"},
253 {"name", "alias name : "}
255 { CreateFSAlias, NULLMENU, 2, {
256 {"alias", "Associate with a Filesystem"},
257 {"name", "alias name : "},
259 { DeleteFSAlias, NULLMENU, 2, {
260 {"unalias", "Disassociate from a Filesystem"},
261 {"name", "alias name : "},
263 SUBMENU("quotas","Quota Menu", "a_menu),
264 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
265 SIMPLEFUNC("help", "Help ..", AttachHelp)
273 Menu machine_menu = {
279 { ShowMachineInfo, NULLMENU, 2, {
280 {"show","Get machine information"},
281 {"name","Machine's Name: "}
283 { AddMachine, NULLMENU, 2, {
284 {"add","Add a new machine"},
285 {"name","Machine's Name: "},
287 { UpdateMachine, NULLMENU, 2, {
288 {"update","Update machine information"},
289 {"name","Machine's Name: "},
291 { DeleteMachine, NULLMENU, 2, {
292 {"delete","Delete this machine"},
293 {"name","Machine's Name: "}
295 SUBMENU("mappings","Machine To Cluster Mappings Menu", &mappings_menu),
296 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
310 { ShowListInfo, NULLMENU, 2, {
311 {"show", "Display information about a list"},
312 {"list name", "Name of list: "}
314 { NULLFUNC, &list_member_menu, 2, {
315 {"add", "Create new List"},
316 {"list name", "Name of list: "}
318 { UpdateList, NULLMENU, 2, {
319 {"update", "Update characteristics of a list"},
320 {"list name", "Name of list: "}
322 { DeleteList, NULLMENU, 2, {
323 {"delete", "Delete a List"},
324 {"list name", "Name of list: "}
326 SIMPLEFUNC("query_remove",
327 "Interactively remove an item from all lists",
328 InterRemoveItemFromLists),
329 { NULLFUNC, &list_member_menu, 2, {
330 {"members", "Member Menu - Change/Show Members of a List."},
331 {"list name", "Name of list: "}
333 SUBMENU("list_info", "List Info Menu",
335 SUBMENU("quotas","Quota Menu", "a_menu),
336 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
337 SIMPLEFUNC("help", "Print Help", ListHelp)
345 Menu nfsphys_menu = {
351 { ShowNFSService, NULLMENU, 2, {
352 { "show", "Show an NFS server" },
353 { "machine", "Machine Name: "},
355 { AddNFSService, NULLMENU, 2, {
356 { "add", "Add NFS server" },
357 { "machine", "Machine Name: "},
359 { UpdateNFSService, NULLMENU, 2, {
360 { "update", "Update NFS server"},
361 { "machine", "Machine Name: "},
363 { DeleteNFSService, NULLMENU, 2, {
364 { "delete", "Delete NFS server"},
365 {"machine", "Machine Name: "},
367 SUBMENU("quotas","Quota Menu", "a_menu),
368 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
369 /* SIMPLEFUNC("help", "Help", NFSHelp), */
383 {ShowUserByLogin, NULLMENU, 2, {
384 {"login", "Show user information by login name"},
385 {"login name", "Desired login name: "}
387 {ShowUserByName, NULLMENU, 3, {
388 {"name", "Show user information by name"},
389 {"first", "First name: "},
390 {"last", "Last name: "}
392 {ShowUserByClass, NULLMENU, 2, {
393 {"class", "Show names of users in a given class"},
394 {"login name", "Desired class: "}
396 {UpdateUser, NULLMENU, 2, {
397 {"modify", "Change all user fields"},
398 {"login", "Login name: "}
400 /* SIMPLEFUNC("chpw", "Change a user's password", change_user_password), */
401 SIMPLEFUNC("adduser", "Add a new user to the database",
403 SIMPLEFUNC("register", "Register a user", RegisterUser),
404 {DeactivateUser, NULLMENU, 2, {
405 {"deactivate", "Deactivate user"},
406 {"login", "Login name: "},
408 {DeleteUser, NULLMENU, 2, {
409 {"expunge", "Expunge user"},
410 {"login", "Login name: "}
412 /* {DeleteUserByUid, NULLMENU, 2, {
413 {"udelete", "Delete user by uid"},
414 {"uid", "User ID (not MIT ID!): "}
416 SUBMENU("pobox", "Post Office Box Menu", &pobox_menu),
417 SUBMENU("quota", "Quota Menu", "a_menu),
418 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
422 /* ------------------------- Root Menu ------------------------- */
428 Menu sms_top_menu = {
431 "Sms Database Manipulation",
434 SUBMENU("cluster","Cluster Menu",&cluster_menu),
435 SUBMENU("filesys","Filesystem Menu", &filesys_menu),
436 SUBMENU("list","Lists and Group Menu", &list_menu),
437 SUBMENU("machine","Machine Menu",&machine_menu),
438 SUBMENU("nfs","NFS Physical Menu", &nfsphys_menu),
439 SUBMENU("user","User Menu", &user_menu)