]> code.citadel.org Git - citadel.git/blob - webcit/useredit.c
* Don't display room banner on screens that don't pertain to a particular room
[citadel.git] / webcit / useredit.c
1 /*
2  * Administrative screen to add/change/delete user accounts
3  *
4  */
5
6
7 #include <ctype.h>
8 #include <stdlib.h>
9 #include <unistd.h>
10 #include <stdio.h>
11 #include <fcntl.h>
12 #include <signal.h>
13 #include <sys/types.h>
14 #include <sys/wait.h>
15 #include <sys/socket.h>
16 #include <sys/time.h>
17 #include <limits.h>
18 #include <netinet/in.h>
19 #include <netdb.h>
20 #include <string.h>
21 #include <pwd.h>
22 #include <errno.h>
23 #include <stdarg.h>
24 #include <pthread.h>
25 #include <signal.h>
26 #include "webcit.h"
27
28
29
30
31
32 void select_user_to_edit(void)
33 {
34         char buf[SIZ];
35         char username[SIZ];
36
37         output_headers(3);      /* No room banner on this screen */
38
39         wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>");
40         wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>"
41                 "Add/change/delete user accounts"
42                 "</B></FONT></TD></TR></TABLE>\n");
43
44         wprintf("<TABLE border=0 CELLSPACING=10><TR VALIGN=TOP>"
45                 "<TD>To edit an existing user account, select the user "
46                 "name from the list and click 'Edit'.<BR><BR>");
47         
48         wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/display_edituser\">\n");
49         wprintf("<SELECT NAME=\"username\" SIZE=10>\n");
50         serv_puts("LIST");
51         serv_gets(buf);
52         if (buf[0] == '1') {
53                 while (serv_gets(buf), strcmp(buf, "000")) {
54                         extract(username, buf, 0);
55                         wprintf("<OPTION>");
56                         escputs(username);
57                         wprintf("\n");
58                 }
59         }
60         wprintf("</SELECT><BR>\n");
61
62         wprintf("<input type=submit name=sc value=\"Edit\">");
63         wprintf("</FORM></CENTER>\n");
64
65         wprintf("</TD><TD>"
66                 "To create a new user account, enter the desired "
67                 "user name in the box below and click 'Create'.<BR><BR>");
68
69         wprintf("<CENTER><FORM METHOD=\"POST\" ACTION=\"/create_user\">\n");
70         wprintf("New user: ");
71         wprintf("<input type=text name=username><BR>\n"
72                 "<input type=submit value=\"Create\">"
73                 "</FORM></CENTER>\n");
74
75         wprintf("</TD></TR></TABLE>\n");
76
77         wDumpContent(1);
78 }
79