]> andersk Git - moira.git/blame - clients/moira/menus.c
This version seems to implement almost all correctly, more testing
[moira.git] / clients / moira / menus.c
CommitLineData
402461ad 1#if (!defined(lint) && !defined(SABER))
08345b74 2 static char rcsid_module_c[] = "$Header$";
3#endif lint
4
5/* This is the file menu.c for allmaint, the SMS client that allows
6 * a user to maintaint most important parts of the SMS database.
7 * It Contains: all menu definitions for allmaint.
8 *
9 * Created: 4/11/88
10 * By: Chris D. Peterson
11 *
12 * $Source$
13 * $Author$
14 * $Header$
15 *
16 * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
17 *
18 * For further information on copyright and distribution
19 * see the file mit-copyright.h
20 */
21
22#include <stdio.h>
23#include <menu.h>
461c03b6 24
08345b74 25#include "mit-copyright.h"
26#include "allmaint.h"
461c03b6 27#include "allmaint_funcs.h"
28#include "globals.h"
08345b74 29
30/*
31 * Attachmaint Menus
32 */
33
34Menu attachmaint_filemenu = {
35 NULLFUNC,
36 NULLFUNC,
37 "Filesystem Maintenance",
461c03b6 38 4,
08345b74 39 {
40 { GetFS, NULLMENU, 2, {
41 {"get", "Get Filesystem Name Information"},
42 {"name", "Name of Filesystem: "}
43 } },
44 { AddFS, NULLMENU, 2, {
45 {"add", "Add New Filesystem to Database"},
46 {"name", "name: "},
47 } },
48 { ChangeFS, NULLMENU, 2, {
49 {"change", "Update Filesystem Information"},
50 {"name", "name: "},
51 } },
08345b74 52 { DeleteFS, NULLMENU, 2, {
53 {"delete", "Delete Filesystem"},
54 {"name", "Filesystem Name: "}
55 } }
56 }
57};
58
59Menu attachmaint_top_menu = {
60 NULLFUNC,
61 NULLFUNC,
62 "Attach/Filesystem Maintenance",
85ca828a 63 6,
08345b74 64 {
461c03b6 65 SUBMENU("filesystem", "Filesystem Work", &attachmaint_filemenu),
08345b74 66 { GetFSAlias, NULLMENU, 2, {
85ca828a 67 {"check", "Check An Association"},
68 {"name", "alias name : "}
08345b74 69 } },
70 { CreateFSAlias, NULLMENU, 2, {
85ca828a 71 {"alias", "Associate with a Filesystem"},
72 {"name", "alias name : "},
08345b74 73 } },
74 { DeleteFSAlias, NULLMENU, 2, {
85ca828a 75 {"unalias", "Disassociate from a Filesystem"},
76 {"name", "alias name : "},
08345b74 77 } },
85ca828a 78 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
79 SIMPLEFUNC("help", "Help ..", AttachHelp)
08345b74 80 }
81};
82
83/*
84 * Clustermaint Menus
85 */
86
87Menu clustermaint_machine_menu = {
88 NULLFUNC,
89 NULLFUNC,
90 "Machine Maintenence",
85ca828a 91 7,
08345b74 92 {
93 { ShowMachineInfo, NULLMENU, 2, {
85ca828a 94 {"show","Get machine information"},
08345b74 95 {"name","Machine's Name: "}
96 } },
97 { AddMachine, NULLMENU, 2, {
85ca828a 98 {"add","Add a new machine"},
08345b74 99 {"name","Machine's Name: "},
100 } },
101 { UpdateMachine, NULLMENU, 2, {
85ca828a 102 {"update","Update machine information"},
08345b74 103 {"name","Machine's Name: "},
104 } },
08345b74 105 { DeleteMachine, NULLMENU, 2, {
85ca828a 106 {"delete","Delete this machine"},
08345b74 107 {"name","Machine's Name: "}
108 } },
461c03b6 109 { MachineToClusterMap, NULLMENU, 3, {
85ca828a 110 {"map", "Show Machine to cluster mapping"},
111 {"name", "Machine's Name: "},
112 {"cluster", "Cluster's Name: "},
461c03b6 113 } },
08345b74 114 { AddMachineToCluster, NULLMENU, 3, {
85ca828a 115 {"addcluster","Add machines to a clusters"},
08345b74 116 {"name","Machine's Name: "},
85ca828a 117 {"cluster", "Cluster's Name: "},
08345b74 118 } },
85ca828a 119 { RemoveMachineFromCluster, NULLMENU, 3, {
120 {"remcluster", "Remove machines from clusters"},
08345b74 121 {"name","Machine's Name: "},
85ca828a 122 {"cluster", "Cluster's Name: "},
08345b74 123 } },
124 }
125};
126
127Menu clustermaint_cluster_menu = {
128 NULLFUNC,
129 NULLFUNC,
130 "Cluster Information",
85ca828a 131 7,
08345b74 132 {
133 { ShowClusterInfo, NULLMENU, 2, {
85ca828a 134 {"show", "Get cluster information"},
08345b74 135 {"name", "Cluster's Name: "}
136 } },
137 { MachinesInCluster, NULLMENU, 2, {
85ca828a 138 {"machines", "List all machines in a cluster"},
08345b74 139 {"clus", "Cluster's Name: "}
461c03b6 140 } },
08345b74 141 { AddCluster, NULLMENU, 2, {
85ca828a 142 {"add", "Add a new cluster"},
08345b74 143 {"name","Cluster's Name: "},
144 } },
145 { UpdateCluster, NULLMENU, 2, {
85ca828a 146 {"update", "Update cluster information"},
08345b74 147 {"name","Cluster's Name: "},
148 } },
08345b74 149 { DeleteCluster, NULLMENU, 2, {
85ca828a 150 {"delete", "Delete this cluster"},
08345b74 151 {"name", "Cluster's Name: "}
152 } },
85ca828a 153 { AddMachineToCluster, NULLMENU, 3, {
154 {"addcluster","Add machines to a clusters"},
155 {"name","Machine's Name: "},
156 {"cluster", "Cluster's Name: "},
157 } },
158 { RemoveMachineFromCluster, NULLMENU, 3, {
159 {"remcluster", "Remove machines from clusters"},
160 {"name","Machine's Name: "},
161 {"cluster", "Cluster's Name: "},
162 } },
08345b74 163 }
164};
165
85ca828a 166Menu clustermaint_data_menu = {
08345b74 167 NULLFUNC,
168 NULLFUNC,
461c03b6 169 "Cluster Data Maintenence",
08345b74 170 3,
171 {
461c03b6 172 { ShowClusterData, NULLMENU, 3, {
85ca828a 173 {"show", "Show Data on a given Cluster"},
461c03b6 174 {"clus", "Cluster's Name: "},
85ca828a 175 {"label", "Label Identifing the data: "},
08345b74 176 } },
461c03b6 177 { AddClusterData, NULLMENU, 4, {
178 {"add", "Add Data to a given Cluster"},
08345b74 179 {"clus", "Cluster Name: "},
85ca828a 180 {"label", "Label Identifing the data: "},
181 {"data", "The data to be added: "},
08345b74 182 } },
461c03b6 183 { RemoveClusterData, NULLMENU, 4, {
184 {"delete", "Remove Data to a given Cluster"},
08345b74 185 {"clus", "Cluster's Name: "},
85ca828a 186 {"label", "Label Identifing the data: "},
187 {"data", "The data to be removed: "},
08345b74 188 } }
189 }
190};
191
461c03b6 192Menu clustermaint_top_menu = {
08345b74 193 NULLFUNC,
194 NULLFUNC,
195 "Cluster Maintenence",
196 5,
197 {
198 SUBMENU("machine", "Work on Machines", &clustermaint_machine_menu),
199 SUBMENU("cluster", "Work on Clusters", &clustermaint_cluster_menu),
85ca828a 200 SUBMENU("data", "Work with cluster data", &clustermaint_data_menu),
08345b74 201 {MachineToClusterMap, NULLMENU, 3, {
202 {"map", "Machine to Cluster Mapping"},
203 {"machine", "Machine Name: "},
204 {"clus", "Cluster Name: "}
205 } },
206 SIMPLEFUNC("verbose", "Toggle Delete Confirmation", ToggleVerboseMode),
207 }
208};
209
210/*
211 * Dcmmaint menus
212 */
213
214/* Commenting out all DCM maint stuff.
215
216Menu dcmmaint_service_menu = {
217 dcmmaint_service_menu_entry,
218 dcmmaint_service_menu_exit,
219 NULL,
220 5,
221 {
222 SIMPLEFUNC("show", "Show fields of service", show_service),
223 SIMPLEFUNC("interval", "Change the interval field", change_interval),
224 SIMPLEFUNC("target_path", "Change the target_path field",
225 change_target_path),
226 SIMPLEFUNC("script", "Change the script field", change_script),
227 SIMPLEFUNC("dfgen",
228 "Change the date of the latest generation of the db file",
229 change_dfgen)
230 }
231};
232
233Menu dcmmaint_host_info_menu = {
234 dcmmaint_host_info_menu_entry,
235 dcmmaint_host_info_menu_exit,
236 NULL,
237 8,
238 {
239 SIMPLEFUNC("show", "Show values of entry", show_host_info),
240 SIMPLEFUNC("last_time", "Change the last_time field", change_last_time),
241 SIMPLEFUNC("success", "Change the success field", change_success),
242 SIMPLEFUNC("override", "Change the override field", change_override),
243 SIMPLEFUNC("enable", "Change the enable field", change_enable),
244 SIMPLEFUNC("value1", "Change the value1 field", change_value1),
245 SIMPLEFUNC("value2", "Change the value2 field", change_value2),
246 SIMPLEFUNC("rvdacls", "Change the RVD ACLs (for RVD servers only)",
247 update_rvd_server)
248 }
249};
250
251Menu dcmmaint_top_menu = {
252 NULLFUNC,
253 NULLFUNC,
254 "Data Control Manager Maintenance",
255 9,
256 {
257 SUBMENU("hi_change", "Modify a service-host entry",
258 &dcmmaint_host_info_menu),
259 SIMPLEFUNC("hi_add", "Create new service-host entry", do_host_info),
260 SIMPLEFUNC("hi_delete", "Remove a service-host entry", do_host_info),
261 SIMPLEFUNC("hi_list", "List service-host entries", do_host_info),
262 SUBMENU("s_change", "Modify info for an existing service",
263 &dcmmaint_service_menu),
264 SIMPLEFUNC("s_add", "Create new service", do_service),
265 SIMPLEFUNC("s_delete", "Remove a service", do_service),
266 SIMPLEFUNC("s_list", "List services", do_service),
267 SIMPLEFUNC("help", "How to use this program", instructions)
268 }
269};
270
271Commenting out all DCM maint stuff. */
272
273/*
274 * Listmaint Menus
275 */
276
277Menu listmaint_list_menu = {
278 NULLFUNC,
279 NULLFUNC,
280 "Lists",
281 5,
282 {
283 SIMPLEFUNC("member",
284 "List all lists to which a given member belongs",
285 ListByMember),
402461ad 286 SIMPLEFUNC("admin",
287 "List all items which a given member can administer",
08345b74 288 ListByAdministrator),
289 SIMPLEFUNC("groups", "List all lists which are groups",
290 ListAllGroups),
291 SIMPLEFUNC("public", "List all public mailing lists",
292 ListAllPublicMailLists),
293 SIMPLEFUNC("maillists", "List all mailing lists",
294 ListAllMailLists)
295 }
296};
297
298Menu listmaint_member_menu = {
461c03b6 299 ListmaintMemberMenuEntry,
300 ListmaintMemberMenuExit,
08345b74 301 NULL,
402461ad 302 7,
08345b74 303 {
402461ad 304 SIMPLEFUNC("add", "Add a member to this list",
08345b74 305 AddMember),
402461ad 306 SIMPLEFUNC("remove", "Remove a member from this list",
08345b74 307 DeleteMember),
402461ad 308 SIMPLEFUNC("all", "Show the members of this list",
461c03b6 309 ListAllMembers),
08345b74 310 SIMPLEFUNC("user", "Show the members of type USER",
311 ListUserMembers),
312 SIMPLEFUNC("list", "Show the members of type LIST",
313 ListListMembers),
314 SIMPLEFUNC("string", "Show the members of type STRING",
402461ad 315 ListStringMembers),
316 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete",
317 ToggleVerboseMode)
08345b74 318 }
319};
320
321Menu listmaint_top_menu = {
322 NULLFUNC,
323 NULLFUNC,
324 "List Maintenance Menu",
325 8,
326 {
08345b74 327 { ShowListInfo, NULLMENU, 2, {
328 {"show", "Display information about a list"},
329 {"list name", "Name of list: "}
330 } },
85ca828a 331 { NULLFUNC, &listmaint_member_menu, 2, {
332 {"add", "Create new List"},
402461ad 333 {"list name", "Name of list: "}
85ca828a 334 } },
461c03b6 335 { UpdateList, NULLMENU, 2, {
08345b74 336 {"update", "Update characteristics of a list"},
337 {"list name", "Name of list: "}
338 } },
85ca828a 339 { DeleteList, NULLMENU, 2, {
340 {"delete", "Delete a List"},
341 {"list name", "Name of list: "}
342 } },
08345b74 343 { NULLFUNC, &listmaint_member_menu, 2, {
344 {"members", "Change/Display the membership of a list"},
402461ad 345 {"list name", "Name of list: "}
08345b74 346 } },
461c03b6 347 SIMPLEFUNC("query_remove",
348 "Interactively remove an item from all lists",
349 InterRemoveItemFromLists),
08345b74 350 SUBMENU("list_lists", "Display inventory of lists",
351 &listmaint_list_menu),
85ca828a 352 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete",
353 ToggleVerboseMode),
461c03b6 354 SIMPLEFUNC("help", "How to use this program", ListHelp)
08345b74 355 }
356};
357
358/*
359 * NFSmaint menus.
360 */
361
362Menu nfsmaint_top_menu = {
363 NULLFUNC,
364 NULLFUNC,
365 "NFS Maintenence",
461c03b6 366 5,
08345b74 367 {
075fe5bb 368 { ShowNFSService, NULLMENU, 2, {
85ca828a 369 { "show", "Show an NFS server" },
08345b74 370 { "machine", "Machine Name: "},
08345b74 371 } },
075fe5bb 372 { AddNFSService, NULLMENU, 2, {
08345b74 373 { "add", "Add NFS server" },
374 { "machine", "Machine Name: "},
08345b74 375 } },
075fe5bb 376 { UpdateNFSService, NULLMENU, 2, {
08345b74 377 { "update", "Update NFS server"},
378 { "machine", "Machine Name: "},
08345b74 379 } },
075fe5bb 380 { DeleteNFSService, NULLMENU, 2, {
08345b74 381 { "delete", "Delete NFS server"},
382 {"machine", "Machine Name: "},
08345b74 383 } },
384 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
461c03b6 385/* SIMPLEFUNC("help", "Help", NFSHelp), */
08345b74 386 }
387};
388
389/*
390 * Portmaint menus.
391 */
392
393/* Queries have not been implemented yet :-(
394
395Menu servmenu = {
396 NULLFUNC,
397 NULLFUNC,
398 "Server Maintenence",
399 8,
400 {
401 { getserv, NULLMENU, 2, {
402 {"get", "Services Info"},
403 {"serv", "Service Name: "}
404 } },
405 { addserv, NULLMENU, 4, {
406 {"add", "Add Service"},
407 {"srv", "Name: "},
408 {"proto", "Protocol: "},
409 {"port", "Port: "}
410 } },
411 { updserv, NULLMENU, 4, {
412 {"update", "Update Service"},
413 {"srv", "Name: "},
414 {"proto", "Protocol: "},
415 {"port", "Port: "}
416 } },
417 {delserv, NULLMENU, 3, {
418 {"delete", "Delete Service"},
419 {"serv", "Service Name: "},
420 {"proto", "Protocol: "}
421 } },
422 { getassc, NULLMENU, 2, {
423 {"get_alias", "Get All Aliases for Service"},
424 {"srv", "Service Name: "}
425 } },
426 { alas, NULLMENU, 3, {
427 {"+", "Add Alias"},
428 {"srv", "Service Name: "},
429 {"als", "Alias: "}
430 } },
431 { alas, NULLMENU, 3, {
432 {"-", "Delete Alias"},
433 {"srv", "Service Name: "},
434 {"als", "Alias: "}
435 } },
436 SIMPLEFUNC("toggle", "Toggle Verbosity of Delete", toggle_verb)
437 }
438};
439
440*/
441/*
442 * smsmaint - TBS
443 */
444
445/*
446 * Usermaint menu.
447 */
448
075fe5bb 449Menu usermaint_pobox_menu = {
450 NULLFUNC,
451 NULLFUNC,
452 "Edit User Post Office Boxes",
453 3,
454 {
455 {GetUserPOBox, NULLMENU, 2, {
456 {"show", "Show a user's post office box"},
457 {"login name", "login name: "}
458 } },
459 {SetUserPOBox, NULLMENU, 2, {
460 {"set", "Set (Add or Change) a user's post office box"},
461 {"login name", "login name: "}
462 } },
463 {RemoveUserPOBox, NULLMENU, 2, {
464 {"remove", "Remove a user's post office box"},
465 {"login name", "login name: "}
466 } },
467 }
468};
469
08345b74 470Menu usermaint_quota_menu = {
471 NULLFUNC,
472 NULLFUNC,
075fe5bb 473 "Edit User and Default Quotas",
08345b74 474 6,
475 {
476 SIMPLEFUNC("shdef", "Show default user quota (in KB)", ShowDefaultQuota),
08345b74 477 {ChangeDefaultQuota, NULLMENU, 2, {
478 {"chdef", "Change default user quota"},
479 {"quota", "New quota (in KB): "}
480 } },
075fe5bb 481 SIMPLEFUNC("shquota", "Show a user's disk quota on a filesytem",
482 ShowUserQuota),
483 SIMPLEFUNC("addquota", "Add a new disk quota for user on a filesytem",
484 AddUserQuota),
485 SIMPLEFUNC("chquota", "Change a user's disk quota on a filesytem",
486 ChangeUserQuota),
487 SIMPLEFUNC("rmquota", "Remove a user's disk quota on a filesytem",
488 RemoveUserQuota),
08345b74 489 }
490};
491
492Menu usermaint_top_menu = {
493 NULLFUNC,
494 NULLFUNC,
495 "SMS User Maintenance",
075fe5bb 496 9,
08345b74 497 {
498 {ShowUserByLogin, NULLMENU, 2, {
499 {"login", "Show user information by login name"},
500 {"login name", "Desired login name: "}
501 } },
502 {ShowUserByName, NULLMENU, 3, {
075fe5bb 503 {"name", "Show user information by name"},
08345b74 504 {"first", "First name: "},
505 {"last", "Last name: "}
506 } },
507 {ShowUserByClass, NULLMENU, 2, {
075fe5bb 508 {"class", "Show names of users in a given class"},
08345b74 509 {"login name", "Desired class: "}
510 } },
075fe5bb 511 {UpdateUser, NULLMENU, 2, {
08345b74 512 {"modify", "Change all user fields"},
513 {"login", "Login name: "}
514 } },
515/* SIMPLEFUNC("chpw", "Change a user's password", change_user_password), */
075fe5bb 516 SIMPLEFUNC("adduser", "Add a new user to the database",
517 AddNewUser),
518 SIMPLEFUNC("register", "Register a user", RegisterUser),
08345b74 519 {DeleteUser, NULLMENU, 2, {
520 {"delete", "Delete user"},
521 {"login", "Login name: "}
522 } },
523 {DeleteUserByUid, NULLMENU, 2, {
524 {"udelete", "Delete user by uid"},
525 {"uid", "User ID (not MIT ID!): "}
526 } },
075fe5bb 527 SUBMENU("pobox", "User PO Boxes", &usermaint_pobox_menu),
08345b74 528 SUBMENU("quota", "User Quotas", &usermaint_quota_menu),
529 }
530};
531
532/*
85ca828a 533 * Sms top menu
08345b74 534 */
535
85ca828a 536Menu sms_top_menu = {
08345b74 537 NULLFUNC,
538 NULLFUNC,
85ca828a 539 "Sms Database Manipulation",
08345b74 540 5,
541 {
542 SUBMENU("attachmaint","open the attachmaint menu",&attachmaint_top_menu),
543 SUBMENU("clustermaint","open the clustermaint menu",
544 &clustermaint_top_menu),
545/* SUBMENU("dcmmaint","open the dcmmaint menu",&dcmmaint_top_menu), */
546 SUBMENU("listmaint","open the listmaint menu",&listmaint_top_menu),
547 SUBMENU("nfsmaint","open the nfsmaint menu",&nfsmaint_top_menu),
548/* SUBMENU("portmaint","open the portmaint menu",&portmaint_top_menu), */
549/* SUBMENU("smsmaint","open the smsmaint menu",&smsmaint_top_menu), */
550 SUBMENU("usermaint","open the usermaint menu",&usermaint_top_menu)
551 }
552};
553
This page took 2.038237 seconds and 5 git commands to generate.