16 * menu of commands (just the menu html itself)
19 void embed_main_menu(void)
21 wprintf("<CENTER><TABLE border=0><TR>");
23 wprintf("<TD>"); /* start of first column */
26 wprintf("<LI><B><A HREF=\"/knrooms\">\n");
27 wprintf("List known rooms</B></A><BR>\n");
28 wprintf("Where can I go from here?</LI>\n");
30 wprintf("<LI><B><A HREF=\"/gotonext\">\n");
31 wprintf("Goto next room</B></A><BR>\n");
32 wprintf("...with <EM>unread</EM> messages</LI>\n");
34 wprintf("<LI><B><A HREF=\"/skip\">\n");
35 wprintf("Skip to next room</B></A><BR>\n");
36 wprintf("(come back here later)</LI>\n");
38 if ((strlen(ugname) > 0) && (strcasecmp(ugname, wc_roomname))) {
39 wprintf("<LI><B><A HREF=\"/ungoto\">\n");
40 wprintf("Ungoto</B></A><BR>\n");
41 wprintf("(oops! Back to %s)</LI>\n", ugname);
45 wprintf("</TD><TD>\n"); /* start of second column */
48 wprintf("<LI><B><A HREF=\"/readnew\">\n");
49 wprintf("Read new messages</B></A><BR>...in this room</LI>\n");
51 wprintf("<LI><B><A HREF=\"/readfwd\">\n");
52 wprintf("Read all messages</B></A><BR>...old <EM>and</EM> new</LI>\n");
54 wprintf("<LI><B><A HREF=\"/display_enter\">\n");
55 wprintf("Enter a message</B></A><BR>(post in this room)</LI>");
58 wprintf("</TD><TD>"); /* start of third column */
61 wprintf("<LI><B><A HREF=\"/whobbs\">\n");
62 wprintf("Who is online?</B></A><BR>(users <EM>currently</EM> logged on)</LI>\n");
64 wprintf("<LI><B><A HREF=\"/userlist\">\n");
65 wprintf("User list</B></A><BR>(all registered users)</LI>\n");
67 wprintf("<LI><B><A HREF=\"/advanced\">\n");
68 wprintf("Advanced options</B></A><BR>...and maintenance</LI>\n");
70 wprintf("<LI><B><A HREF=\"/termquit\">\n");
71 wprintf("Log off</B></A><BR>Bye!</LI>\n");
74 wprintf("</TR></TABLE>\n");
76 wprintf("</CENTER>\n");
82 void embed_advanced_menu(void)
85 wprintf("<TABLE WIDTH=100%><TR VALIGN=TOP><TD>");
88 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
89 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
90 wprintf("<B>Interaction</B>\n");
91 wprintf("</FONT></TD></TR></TABLE>\n");
94 wprintf("<LI><A HREF=\"/display_page\">\n");
95 wprintf("Page another user</A>\n");
97 wprintf("<LI><A HREF=\"/chat\">");
98 wprintf("Chat with other online users</A>\n");
100 wprintf("<LI><A HREF=\"/display_generic\">\n");
101 wprintf("<FONT SIZE=-2>Generic server command</FONT></A>\n");
105 wprintf("</TD><TD>");
107 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
108 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
109 wprintf("<B>Your info</B>\n");
110 wprintf("</FONT></TD></TR></TABLE>\n");
113 wprintf("<LI><A HREF=\"/display_editbio\">\n");
114 wprintf("Enter your 'bio' (a few words about yourself)</A>\n");
116 wprintf("<LI><A HREF=\"/display_editpic\">\n");
117 wprintf("Edit your online photo</A>\n");
119 wprintf("<LI><A HREF=\"/display_reg\">\n");
120 wprintf("Re-enter your registration info (name, address, etc.)</A>\n");
122 wprintf("<LI><A HREF=\"/display_changepw\">\n");
123 wprintf("Change your password</A>\n");
128 wprintf("</TD></TR><TR VALIGN=TOP><TD>");
130 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
131 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
132 wprintf("<B>Advanced room commands</B>\n");
133 wprintf("</FONT></TD></TR></TABLE>\n");
136 wprintf("<LI><A HREF=\"/display_private\">\n");
137 wprintf("Go to a 'hidden' room</A>\n");
139 wprintf("<LI><A HREF=\"/display_entroom\">");
140 wprintf("Create a new room</A>\n");
142 wprintf("<LI><A HREF=\"/display_zap\">");
143 wprintf("Zap (forget) this room (%s)</A>\n", wc_roomname);
145 wprintf("<LI><A HREF=\"/zapped_list\">");
146 wprintf("List all forgotten rooms</A>\n");
150 wprintf("</TD><TD>");
152 if ((axlevel >= 6) || (is_room_aide)) {
153 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007777><TR><TD>");
154 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
155 wprintf("<B>Administrative functions</B>\n");
156 wprintf("</FONT></TD></TR></TABLE>\n");
159 wprintf("<LI><A HREF=\"/display_editroom\">\n");
160 wprintf("Edit or delete this room</A>\n");
162 wprintf("<LI><A HREF=\"/display_siteconfig\">\n");
163 wprintf("Edit site-wide configuration</A>\n");
166 wprintf("<LI><A HREF=\"/validate\">\n");
167 wprintf("Validate new users</A>\n");
169 wprintf("<LI><A HREF=\"/select_floor_to_edit_pic\">\n");
170 wprintf("Set or change a floor label graphic</A>\n");
172 wprintf("<LI><A HREF=\"/display_netconf\">\n");
173 wprintf("Configure networking with other systems</A>\n");
177 wprintf("</TD></TR></TABLE>");
179 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
180 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
181 wprintf("<B>Basic commands</B>\n");
182 wprintf("</FONT></TD></TR></TABLE>\n");
190 * menu of commands (as a page)
192 void display_main_menu(void)
194 printf("HTTP/1.0 200 OK\n");
201 void display_advanced_menu(void)
203 printf("HTTP/1.0 200 OK\n");
205 embed_advanced_menu();
212 * Display the screen to enter a generic server command
214 void display_generic(void)
216 printf("HTTP/1.0 200 OK\n");
219 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
220 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
221 wprintf("<B>Enter a server command</B>\n");
222 wprintf("</FONT></TD></TR></TABLE>\n");
225 wprintf("This screen allows you to enter Citadel server commands which are\n");
226 wprintf("not supported by WebCit. If you do not know what that means,\n");
227 wprintf("then this screen will not be of much use to you.<BR>\n");
229 wprintf("<FORM METHOD=\"POST\" ACTION=\"/do_generic\">\n");
231 wprintf("Enter command:<BR>\n");
232 wprintf("<INPUT TYPE=\"text\" NAME=\"g_cmd\" SIZE=80 MAXLENGTH=\"250\"><BR>\n");
234 wprintf("Command input (if requesting SEND_LISTING transfer mode):<BR>\n");
235 wprintf("<TEXTAREA NAME=\"g_input\" ROWS=10 COLS=80 WIDTH=80></TEXTAREA>\n");
237 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Send command\">");
238 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
240 wprintf("</FORM></CENTER>\n");
244 void do_generic(void)
251 if (strcasecmp(bstr("sc"), "Send command")) {
256 printf("HTTP/1.0 200 OK\n");
259 serv_printf("%s", bstr("g_cmd"));
262 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
263 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
264 wprintf("<B>Server command results</B>\n");
265 wprintf("</FONT></TD></TR></TABLE>\n");
267 wprintf("<TABLE border=0><TR><TD>Command:</TD><TD><TT>");
268 escputs(bstr("g_cmd"));
269 wprintf("</TT></TD></TR><TR><TD>Result:</TD><TD><TT>");
271 wprintf("</TT></TD></TR></TABLE><BR>\n");
274 serv_printf("\n\n000");
276 if ((buf[0] == '1') || (buf[0] == '8')) {
277 while (serv_gets(gcontent), strcmp(gcontent, "000")) {
284 text_to_server(bstr("g_input"));
290 serv_read(junk, len);
297 serv_write(junk, len);
301 wprintf("<A HREF=\"/display_generic\">Enter another command</A><BR>\n");
302 wprintf("<A HREF=\"/display_advanced\">Return to menu</A>\n");
310 * Display the menubar. Set as_single_page to
311 * display HTML headers and footers -- otherwise it's assumed
312 * that the menubar is being embedded in another page.
314 void display_menubar(int as_single_page) {
318 if (as_single_page) {
319 printf("HTTP/1.0 200 OK\n");
323 "<TITLE>MenuBar</TITLE>\n"
324 "<STYLE TYPE=\"text/css\">\n"
325 "BODY { text-decoration: none; }\n"
328 "<BODY BACKGROUND=\"/image&name=background\" "
329 "TEXT=\"#000000\" LINK=\"#FFFFFF\" "
330 "ALINK=\"#FFFFFF\" VLINK=\"#FFFFFF\">\n");
333 menubar_body = fopen("static/menubar.html", "r");
334 if (menubar_body == NULL) {
335 wprintf("menubar<BR>%s", strerror(errno));
337 while (fgets(buf, sizeof(buf), menubar_body) != NULL) {
340 fclose(menubar_body);
344 if (as_single_page) {