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