]> andersk Git - moira.git/blob - clients/moira/menus.c
Initial revision
[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 #include "mit-copyright.h"
25 #include "allmaint.h"
26
27 /*
28  * Attachmaint Menus
29  */
30
31 Menu attachmaint_filemenu = {
32   NULLFUNC, 
33   NULLFUNC, 
34   "Filesystem Maintenance",
35   5,
36   {
37     { GetFS, NULLMENU, 2, {
38       {"get", "Get Filesystem Name Information"},
39       {"name", "Name of Filesystem: "}
40     } },
41     { AddFS, NULLMENU, 2, {
42       {"add", "Add New Filesystem to Database"},
43       {"name", "name: "},
44     } },
45     { ChangeFS, NULLMENU, 2, {
46       {"change", "Update Filesystem Information"},
47       {"name", "name: "},
48     } },
49     { RenameFS, NULLMENU, 2, {
50       {"rename", "Rename Filesystem"},
51       {"name", "Current (Old)  Name: "},
52     } },
53     { DeleteFS, NULLMENU, 2, {
54       {"delete", "Delete Filesystem"},
55       {"name", "Filesystem Name: "}
56     } } 
57   }
58 };
59
60 Menu attachmaint_top_menu = {
61   NULLFUNC, 
62   NULLFUNC, 
63   "Attach/Filesystem Maintenance", 
64   7,
65   {
66     SUBMENU("filesystem", "Filesystem Work", &filemenu),
67     { GetFSAlias, NULLMENU, 2, {
68       {"check", "Check An Association."},
69       {"name", "name (user/group/course): "}
70     } },
71     { CreateFSAlias, NULLMENU, 2, {
72       {"alais", "Associate with a Filesystem."},
73       {"name", "name (user/course/project): "},
74     } },
75     { DeleteFSAlias, NULLMENU, 2, {
76       {"unalias", "Disassociate from a Filesystem."},
77       {"name", "name (user/course/project): "},
78     } },
79     SIMPLEFUNC("verbose", "Toggle Verbosity of Delete.", ToggleVerboseMode),
80     SIMPLEFUNC("help", "Help ...", AttachHelp)
81   }
82 };
83
84 /*
85  * Clustermaint Menus
86  */
87
88 Menu clustermaint_machine_menu = {
89   NULLFUNC,
90   NULLFUNC,
91   "Machine Maintenence",
92   7,
93   {
94     { ShowMachineInfo, NULLMENU, 2, {
95       {"ShowMachineInfo","Get machine information."},
96       {"name","Machine's Name: "}
97     } },
98     { AddMachine, NULLMENU, 2, {
99       {"AddMachine","Add a new machine."},
100       {"name","Machine's Name: "},
101     } },
102     { UpdateMachine, NULLMENU, 2, {
103       {"UpdateMachine","Update machine information."},
104       {"name","Machine's Name: "},
105     } },
106     { ChangeMachineName,  NULLMENU, 2, {
107       {"ChangeMachineName", "Change the name of machine"},
108       {"old", "Current (old) Machine's Name: "},
109     } },
110     { DeleteMachine, NULLMENU, 2, {
111       {"DeleteMachine","Delete this machine."},
112       {"name","Machine's Name: "}
113     } },
114     { AddMachineToCluster, NULLMENU, 3, {
115       {"AddMachineToCluster","Add this machine to a cluster."},
116       {"name","Machine's Name: "},
117       {"cluster","Name of the Cluster: "}
118     } },
119     { DeleteMachineFromAllClusters, NULLMENU, 2, {
120       {"DeleteMachineFromAllClusters",
121          "Delete this machine from all clusters."},
122       {"name","Machine's Name: "},
123     } },
124   }
125 };
126
127 Menu clustermaint_cluster_menu = {
128   NULLFUNC,
129   NULLFUNC,
130   "Cluster Information",
131   6,
132   {
133     { ShowClusterInfo, NULLMENU, 2, {
134       {"info", "Get cluster information."},
135       {"name", "Cluster's Name: "}
136     } },
137     { MachinesInCluster, NULLMENU, 2, {
138       {"machines", "List all machines in this cluster."},
139       {"clus", "Cluster's Name: "}
140     } }
141     { AddCluster, NULLMENU, 2, {
142       {"add", "Add a new cluster."},
143       {"name","Cluster's Name: "},
144     } },
145     { UpdateCluster, NULLMENU, 2, {
146       {"update", "Update cluster information."},
147       {"name","Cluster's Name: "},
148     } },
149     { ChangeClusterName,  NULLMENU, 2, {
150       {"cname", "Change the name of this cluster."},
151       {"old", "Current (old) Cluster's Name: "},
152     } },
153     { DeleteCluster, NULLMENU, 2, {
154       {"delete", "Delete this cluster."},
155       {"name", "Cluster's Name: "}
156     } },
157   }
158 };
159
160 Menu clustermaint_service_menu= {
161   NULLFUNC,
162   NULLFUNC,
163   "Service Cluster Maintenence",
164   3,
165   {
166     { ShowServicesForCluster, NULLMENU, 2, {
167       {"show_one", "Show a Service Cluster"},
168       {"clus", "Cluster's Name: "}
169     } },
170     { AddService, NULLMENU, 2, {
171       {"add", "Add a Service to a Cluster"},
172       {"clus", "Cluster Name: "},
173     } },
174     { DeleteService, NULLMENU, 2, {
175       {"delete", "Delete a Service from a Cluster"},
176       {"clus", "Cluster's Name: "},
177     } } 
178   }
179 };
180
181 Menu clusetermaint_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_service_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     MemberMenuEntry,
289     MemberMenuExit,
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                    ListMembers),
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         { UpdateListInfo, 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         { DeleteUserFromLists, NULLMENU, 2, {
335             { "deluser", "Interactively query/delete user from all lists"},
336             { "user name", "Login name of user: "}
337         } },
338         SUBMENU("list_lists", "Display inventory of lists",
339                 &listmaint_list_menu),
340         SIMPLEFUNC("help", "How to use this program", Instructions)
341     } 
342 };
343
344 /*
345  * NFSmaint menus.
346  */
347
348 Menu nfsmaint_top_menu = {
349   NULLFUNC,
350   NULLFUNC,
351   "NFS Maintenence",
352   6,
353   {
354     { ShowNFSService, NULLMENU, 3, {
355       { "show", "Show an NFS server " },
356       { "machine", "Machine Name: "},
357       { "device", "Device: "}
358     } },
359     { AddNFSService, NULLMENU, 3, {
360       { "add", "Add NFS server" },
361       { "machine", "Machine Name: "},
362       { "device", "Device: "}
363     } },
364     { UpdateNFSService, NULLMENU, 3, {
365       { "update", "Update NFS server"},
366       { "machine", "Machine Name: "},
367       { "device", "Device: "}
368     } },
369     { DeleteNFSService, NULLMENU, 3, {
370       { "delete", "Delete NFS server"},
371       {"machine", "Machine Name: "},
372       {"device", "Device: "}
373     } },
374     SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
375     SIMPLEFUNC("help", "Help", NFSHelp),
376   }
377 };
378
379 /*
380  * Portmaint menus.
381  */
382
383 /* Queries have not been implemented yet :-( 
384
385 Menu servmenu = {
386   NULLFUNC,
387   NULLFUNC,
388   "Server Maintenence",
389   8,
390   {
391     { getserv, NULLMENU, 2, {
392       {"get", "Services Info"},
393       {"serv", "Service Name: "}
394     } },
395     { addserv, NULLMENU, 4, {
396       {"add", "Add Service"},
397       {"srv", "Name: "},
398       {"proto", "Protocol: "},
399       {"port", "Port: "}
400     } },
401     { updserv, NULLMENU, 4, {
402       {"update", "Update Service"},
403       {"srv", "Name: "},
404       {"proto", "Protocol: "},
405       {"port", "Port: "}
406     } },
407     {delserv, NULLMENU, 3, {
408       {"delete", "Delete Service"},
409       {"serv", "Service Name: "},
410       {"proto", "Protocol: "}
411     } },
412     {  getassc, NULLMENU, 2, {
413       {"get_alias", "Get All Aliases for Service"},
414       {"srv", "Service Name: "}
415     } },
416     { alas, NULLMENU, 3, {
417       {"+", "Add Alias"},
418       {"srv", "Service Name: "},
419       {"als", "Alias: "}
420     } },
421     { alas, NULLMENU, 3, {
422       {"-", "Delete Alias"},
423       {"srv", "Service Name: "},
424       {"als", "Alias: "}
425     } },
426     SIMPLEFUNC("toggle", "Toggle Verbosity of Delete", toggle_verb)
427   }
428 };
429
430 */
431 /*
432  * smsmaint - TBS
433  */
434
435 /* 
436  * Usermaint menu.
437  */
438
439 Menu usermaint_quota_menu = {
440   NULLFUNC,
441   NULLFUNC,
442   "Edit User Quotas and Server Machines",
443   6,
444   {
445     SIMPLEFUNC("shdef", "Show default user quota (in KB)", ShowDefaultQuota),
446     {ShowUserQuota, NULLMENU, 2, {
447        {"shquota", "Show a user's quota (in KB)"},
448        {"login", "Login name: "}
449      } },
450     {ChangeDefaultQuota, NULLMENU, 2, {
451       {"chdef", "Change default user quota"},
452       {"quota", "New quota (in KB): "}
453     } },
454     {ChangeUserQuota, NULLMENU, 2, {
455       {"chquota", "Change a user's disk quota"},
456       {"user", "Login name: "}
457     } },
458     {AddUserLocker, NULLMENU, 5, {
459       {"create", "Create a quota & locker for a user"},
460       {"login", "User's login name: "},
461       {"machine", "Server host name: "},
462       {"device", "Physical device on host: "},
463       {"quota", "Quota in KB: "}
464     } },
465     {DeleteUserLocker, NULLMENU, 2, {
466       {"del", "Delete a user's quota & locker"},
467       {"login", "User's login: "}
468     } }
469   } 
470 };
471
472 Menu usermaint_top_menu = {
473   NULLFUNC,
474   NULLFUNC,
475   "SMS User Maintenance",
476   8,
477   {
478     {ShowUserByLogin, NULLMENU, 2, {
479        {"login", "Show user information by login name"},
480        {"login name", "Desired login name: "}
481      } },
482     {ShowUserByName, NULLMENU, 3, {
483       {"full", "Show user information by name (use * for wildcard)."},
484       {"first", "First name: "},
485       {"last", "Last name: "}
486     } },
487     {ShowUserByClass, NULLMENU, 2, {
488        {"login", "Show names of users in a give class."},
489        {"login name", "Desired class: "}
490      } },    
491     {ModifyUser, NULLMENU, 2, {
492       {"modify", "Change all user fields"},
493       {"login", "Login name: "}
494     } },
495 /*    SIMPLEFUNC("chpw", "Change a user's password", change_user_password), */
496     {ChangeUserPOBox, NULLMENU, 2, {
497       {"chpobox", "Change a user's post office box"},
498       {"login name", "login name: "}
499     } },
500 /*    {enter_user, NULLMENU, 6, {
501       {"enter", "Enter unregistered user"},
502       {"first", "User's first name: "},
503       {"middle", "User's middle initial: "},
504       {"last", "User's last name: "},
505       {"mit_id", "User's MIT ID: "},
506       {"mit_year", "User's MIT year: "}
507     } },
508     {reg_user, NULLMENU, 5, {
509       {"register", "Register unregistered user"},
510       {"first", "User's first name: "},
511       {"last", "User's last name: "},
512       {"mit_id", "User's MIT ID: "},
513       {"login", "Login name to assign: "}
514     } },
515  */
516     {DeleteUser, NULLMENU, 2, {
517       {"delete", "Delete user"},
518       {"login", "Login name: "}
519     } },
520     {DeleteUserByUid, NULLMENU, 2, {
521       {"udelete", "Delete user by uid"},
522       {"uid", "User ID (not MIT ID!): "}
523     } },
524     SUBMENU("quota", "User Quotas", &usermaint_quota_menu),
525   }
526 };
527
528 /* 
529  * Allmaint top menu
530  */
531
532 Menu allmaint_top_menu = {
533   NULLFUNC,
534   NULLFUNC,
535   "All Maint Top Level Menu",
536   5,
537   {
538     SUBMENU("attachmaint","open the attachmaint menu",&attachmaint_top_menu),
539     SUBMENU("clustermaint","open the clustermaint menu",
540             &clustermaint_top_menu),
541 /*    SUBMENU("dcmmaint","open the dcmmaint menu",&dcmmaint_top_menu), */
542     SUBMENU("listmaint","open the listmaint menu",&listmaint_top_menu),
543     SUBMENU("nfsmaint","open the nfsmaint menu",&nfsmaint_top_menu),
544 /*    SUBMENU("portmaint","open the portmaint menu",&portmaint_top_menu), */
545 /*    SUBMENU("smsmaint","open the smsmaint menu",&smsmaint_top_menu), */
546     SUBMENU("usermaint","open the usermaint menu",&usermaint_top_menu)
547   }
548 };  
549        
This page took 0.077866 seconds and 5 git commands to generate.