]> andersk Git - moira.git/blame - clients/moira/menus.c
Initial revision
[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
0a2c64cb 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.
08345b74 8 *
9 * Created: 4/11/88
10 * By: Chris D. Peterson
11 *
12 * $Source$
13 * $Author$
14 * $Header$
15 *
0a2c64cb 16 * Copyright 1988 by the Massachusetts Institute of Technology.
08345b74 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"
0a2c64cb 26#include "defs.h"
27#include "f_defs.h"
461c03b6 28#include "globals.h"
08345b74 29
0a2c64cb 30/* ------------------------- Second Tier Menus ------------------------- */
31
32/*
33 * Cluster Data Menu
08345b74 34 */
35
0a2c64cb 36Menu cluster_data_menu = {
37 NULLFUNC,
38 NULLFUNC,
39 "Cluster Data Menu",
461c03b6 40 4,
08345b74 41 {
0a2c64cb 42 { ShowClusterData, NULLMENU, 3, {
43 {"show", "Show Data on a given Cluster"},
44 {"clus", "Cluster's Name: "},
45 {"label", "Label Identifing the data: "},
08345b74 46 } },
0a2c64cb 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: "},
08345b74 52 } },
0a2c64cb 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: "},
58 } },
59 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
08345b74 60 }
61};
62
0a2c64cb 63/*
64 * List Information Menu
65 */
66
67Menu list_info_menu = {
68 NULLFUNC,
69 NULLFUNC,
70 "List Information Menu",
71 5,
72 {
73 SIMPLEFUNC("member",
74 "Show all lists to which a given member belongs",
75 ListByMember),
76 SIMPLEFUNC("admin",
77 "Show all items which a given member can administer",
78 ListByAdministrator),
79 SIMPLEFUNC("groups", "Show all lists which are groups",
80 ListAllGroups),
81 SIMPLEFUNC("public", "Show all public mailing lists",
82 ListAllPublicMailLists),
83 SIMPLEFUNC("maillists", "Show all mailing lists",
84 ListAllMailLists)
85 }
86};
87
88/*
89 * List Member Menu
90 */
91
92Menu list_member_menu = {
93 ListmaintMemberMenuEntry,
94 ListmaintMemberMenuExit,
95 NULL,
96 7,
97 {
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",
104 ListStringMembers),
105 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
106 }
08345b74 107};
108
109/*
0a2c64cb 110 * Machine To Cluster Mappings Menu
08345b74 111 */
112
0a2c64cb 113Menu mappings_menu = {
08345b74 114 NULLFUNC,
115 NULLFUNC,
0a2c64cb 116 "Machine To Cluster Mappings Menu",
117 4,
08345b74 118 {
461c03b6 119 { MachineToClusterMap, NULLMENU, 3, {
85ca828a 120 {"map", "Show Machine to cluster mapping"},
121 {"name", "Machine's Name: "},
122 {"cluster", "Cluster's Name: "},
461c03b6 123 } },
08345b74 124 { AddMachineToCluster, NULLMENU, 3, {
85ca828a 125 {"addcluster","Add machines to a clusters"},
08345b74 126 {"name","Machine's Name: "},
85ca828a 127 {"cluster", "Cluster's Name: "},
08345b74 128 } },
85ca828a 129 { RemoveMachineFromCluster, NULLMENU, 3, {
130 {"remcluster", "Remove machines from clusters"},
08345b74 131 {"name","Machine's Name: "},
85ca828a 132 {"cluster", "Cluster's Name: "},
08345b74 133 } },
0a2c64cb 134 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
08345b74 135 }
136};
137
0a2c64cb 138/*
139 * Post Office Box Menu
140 */
141
142Menu pobox_menu = {
08345b74 143 NULLFUNC,
144 NULLFUNC,
0a2c64cb 145 "Post Office Box Menu",
146 4,
147 {
148 {GetUserPOBox, NULLMENU, 2, {
149 {"show", "Show a user's post office box"},
150 {"login name", "login name: "}
151 } },
152 {SetUserPOBox, NULLMENU, 2, {
153 {"set", "Set (Add or Change) a user's post office box"},
154 {"login name", "login name: "}
155 } },
156 {RemoveUserPOBox, NULLMENU, 2, {
157 {"remove", "Remove a user's post office box"},
158 {"login name", "login name: "}
159 } },
160 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
161 }
162};
163
164/*
165 * Quota Menu
166 */
167
168Menu quota_menu = {
169 NULLFUNC,
170 NULLFUNC,
171 "Quota Menu",
172 7,
173 {
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): "}
178 } },
179 SIMPLEFUNC("shquota", "Show a user's disk quota on a filesytem",
180 ShowUserQuota),
181 SIMPLEFUNC("addquota", "Add a new disk quota for user on a filesytem",
182 AddUserQuota),
183 SIMPLEFUNC("chquota", "Change a user's disk quota on a filesytem",
184 ChangeUserQuota),
185 SIMPLEFUNC("rmquota", "Remove a user's disk quota on a filesytem",
186 RemoveUserQuota),
187 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
188 }
189};
190
191/* ------------------------- First Tier Menus ------------------------- */
192
193/*
194 * Cluster Menu
195 */
196
197Menu cluster_menu = {
198 NULLFUNC,
199 NULLFUNC,
200 "Cluster Menu",
85ca828a 201 7,
08345b74 202 {
203 { ShowClusterInfo, NULLMENU, 2, {
85ca828a 204 {"show", "Get cluster information"},
08345b74 205 {"name", "Cluster's Name: "}
206 } },
08345b74 207 { AddCluster, NULLMENU, 2, {
85ca828a 208 {"add", "Add a new cluster"},
08345b74 209 {"name","Cluster's Name: "},
210 } },
211 { UpdateCluster, NULLMENU, 2, {
85ca828a 212 {"update", "Update cluster information"},
08345b74 213 {"name","Cluster's Name: "},
214 } },
08345b74 215 { DeleteCluster, NULLMENU, 2, {
85ca828a 216 {"delete", "Delete this cluster"},
08345b74 217 {"name", "Cluster's Name: "}
218 } },
0a2c64cb 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)
08345b74 222 }
223};
224
0a2c64cb 225/*
226 * Filesystem Menu
227 */
228
229Menu filesys_menu = {
230 NULLFUNC,
231 NULLFUNC,
232 "Filesystem Menu",
233 10,
08345b74 234 {
0a2c64cb 235 { GetFS, NULLMENU, 2, {
236 {"get", "Get Filesystem Name Information"},
237 {"name", "Name of Filesystem: "}
08345b74 238 } },
0a2c64cb 239 { AddFS, NULLMENU, 2, {
240 {"add", "Add New Filesystem to Database"},
241 {"name", "name: "},
08345b74 242 } },
0a2c64cb 243 { ChangeFS, NULLMENU, 2, {
244 {"change", "Update Filesystem Information"},
245 {"name", "name: "},
246 } },
247 { DeleteFS, NULLMENU, 2, {
248 {"delete", "Delete Filesystem"},
249 {"name", "Filesystem Name: "}
250 } },
251 { GetFSAlias, NULLMENU, 2, {
252 {"check", "Check An Association"},
253 {"name", "alias name : "}
254 } },
255 { CreateFSAlias, NULLMENU, 2, {
256 {"alias", "Associate with a Filesystem"},
257 {"name", "alias name : "},
258 } },
259 { DeleteFSAlias, NULLMENU, 2, {
260 {"unalias", "Disassociate from a Filesystem"},
261 {"name", "alias name : "},
08345b74 262 } },
0a2c64cb 263 SUBMENU("quotas","Quota Menu", &quota_menu),
264 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
265 SIMPLEFUNC("help", "Help ..", AttachHelp)
08345b74 266 }
267};
268
269/*
0a2c64cb 270 * Machine Menu
08345b74 271 */
272
0a2c64cb 273Menu machine_menu = {
08345b74 274 NULLFUNC,
275 NULLFUNC,
0a2c64cb 276 "Machine Menu",
277 6,
08345b74 278 {
0a2c64cb 279 { ShowMachineInfo, NULLMENU, 2, {
280 {"show","Get machine information"},
281 {"name","Machine's Name: "}
282 } },
283 { AddMachine, NULLMENU, 2, {
284 {"add","Add a new machine"},
285 {"name","Machine's Name: "},
286 } },
287 { UpdateMachine, NULLMENU, 2, {
288 {"update","Update machine information"},
289 {"name","Machine's Name: "},
290 } },
291 { DeleteMachine, NULLMENU, 2, {
292 {"delete","Delete this machine"},
293 {"name","Machine's Name: "}
294 } },
295 SUBMENU("mappings","Machine To Cluster Mappings Menu", &mappings_menu),
296 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
08345b74 297 }
298};
299
08345b74 300/*
0a2c64cb 301 * List Menu
08345b74 302 */
303
0a2c64cb 304Menu list_menu = {
08345b74 305 NULLFUNC,
306 NULLFUNC,
0a2c64cb 307 "List Menu",
308 10,
08345b74 309 {
08345b74 310 { ShowListInfo, NULLMENU, 2, {
311 {"show", "Display information about a list"},
312 {"list name", "Name of list: "}
313 } },
0a2c64cb 314 { NULLFUNC, &list_member_menu, 2, {
85ca828a 315 {"add", "Create new List"},
402461ad 316 {"list name", "Name of list: "}
85ca828a 317 } },
461c03b6 318 { UpdateList, NULLMENU, 2, {
08345b74 319 {"update", "Update characteristics of a list"},
320 {"list name", "Name of list: "}
321 } },
85ca828a 322 { DeleteList, NULLMENU, 2, {
323 {"delete", "Delete a List"},
324 {"list name", "Name of list: "}
325 } },
461c03b6 326 SIMPLEFUNC("query_remove",
327 "Interactively remove an item from all lists",
328 InterRemoveItemFromLists),
0a2c64cb 329 { NULLFUNC, &list_member_menu, 2, {
330 {"members", "Member Menu - Change/Show Members of a List."},
331 {"list name", "Name of list: "}
332 } },
333 SUBMENU("list_info", "List Info Menu",
334 &list_info_menu),
335 SUBMENU("quotas","Quota Menu", &quota_menu),
336 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
337 SIMPLEFUNC("help", "Print Help", ListHelp)
08345b74 338 }
339};
340
341/*
0a2c64cb 342 * NFS Physical Menu
08345b74 343 */
344
0a2c64cb 345Menu nfsphys_menu = {
08345b74 346 NULLFUNC,
347 NULLFUNC,
0a2c64cb 348 "NFS Physical Menu",
349 6,
08345b74 350 {
075fe5bb 351 { ShowNFSService, NULLMENU, 2, {
85ca828a 352 { "show", "Show an NFS server" },
08345b74 353 { "machine", "Machine Name: "},
08345b74 354 } },
075fe5bb 355 { AddNFSService, NULLMENU, 2, {
08345b74 356 { "add", "Add NFS server" },
357 { "machine", "Machine Name: "},
08345b74 358 } },
075fe5bb 359 { UpdateNFSService, NULLMENU, 2, {
08345b74 360 { "update", "Update NFS server"},
361 { "machine", "Machine Name: "},
08345b74 362 } },
075fe5bb 363 { DeleteNFSService, NULLMENU, 2, {
08345b74 364 { "delete", "Delete NFS server"},
365 {"machine", "Machine Name: "},
08345b74 366 } },
0a2c64cb 367 SUBMENU("quotas","Quota Menu", &quota_menu),
08345b74 368 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
461c03b6 369/* SIMPLEFUNC("help", "Help", NFSHelp), */
08345b74 370 }
371};
372
373/*
0a2c64cb 374 * User Menu
08345b74 375 */
376
0a2c64cb 377Menu user_menu = {
075fe5bb 378 NULLFUNC,
379 NULLFUNC,
0a2c64cb 380 "User Menu",
381 11,
08345b74 382 {
383 {ShowUserByLogin, NULLMENU, 2, {
384 {"login", "Show user information by login name"},
385 {"login name", "Desired login name: "}
386 } },
387 {ShowUserByName, NULLMENU, 3, {
075fe5bb 388 {"name", "Show user information by name"},
08345b74 389 {"first", "First name: "},
390 {"last", "Last name: "}
391 } },
392 {ShowUserByClass, NULLMENU, 2, {
075fe5bb 393 {"class", "Show names of users in a given class"},
08345b74 394 {"login name", "Desired class: "}
395 } },
075fe5bb 396 {UpdateUser, NULLMENU, 2, {
08345b74 397 {"modify", "Change all user fields"},
398 {"login", "Login name: "}
399 } },
400/* SIMPLEFUNC("chpw", "Change a user's password", change_user_password), */
075fe5bb 401 SIMPLEFUNC("adduser", "Add a new user to the database",
402 AddNewUser),
403 SIMPLEFUNC("register", "Register a user", RegisterUser),
08345b74 404 {DeleteUser, NULLMENU, 2, {
405 {"delete", "Delete user"},
406 {"login", "Login name: "}
407 } },
408 {DeleteUserByUid, NULLMENU, 2, {
409 {"udelete", "Delete user by uid"},
410 {"uid", "User ID (not MIT ID!): "}
411 } },
0a2c64cb 412 SUBMENU("pobox", "Post Office Box Menu", &pobox_menu),
413 SUBMENU("quota", "Quota Menu", &quota_menu),
414 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
08345b74 415 }
416};
417
0a2c64cb 418/* ------------------------- Root Menu ------------------------- */
419
08345b74 420/*
85ca828a 421 * Sms top menu
08345b74 422 */
423
85ca828a 424Menu sms_top_menu = {
08345b74 425 NULLFUNC,
426 NULLFUNC,
85ca828a 427 "Sms Database Manipulation",
0a2c64cb 428 6,
08345b74 429 {
0a2c64cb 430 SUBMENU("cluster","Cluster Menu",&cluster_menu),
431 SUBMENU("filesys","Filesystem Menu", &filesys_menu),
432 SUBMENU("list","Lists and Group Menu", &list_menu),
433 SUBMENU("machine","Machine Menu",&machine_menu),
434 SUBMENU("nfs","NFS Physical Menu", &nfsphys_menu),
435 SUBMENU("user","User Menu", &user_menu)
08345b74 436 }
437};
438
This page took 0.275159 seconds and 5 git commands to generate.