12 #include <sys/types.h>
14 #include <sys/socket.h>
17 #include <netinet/in.h>
32 * menu of commands (just the menu html itself)
35 void embed_main_menu(void)
37 wprintf("<CENTER><TABLE border=0><TR>");
39 wprintf("<TD>"); /* start of first column */
42 wprintf("<LI><B><A HREF=\"/knrooms\">\n");
43 wprintf("List known rooms</B></A><BR>\n");
44 wprintf("Where can I go from here?</LI>\n");
46 wprintf("<LI><B><A HREF=\"/gotonext\">\n");
47 wprintf("Goto next room</B></A><BR>\n");
48 wprintf("...with <EM>unread</EM> messages</LI>\n");
50 wprintf("<LI><B><A HREF=\"/skip\">\n");
51 wprintf("Skip to next room</B></A><BR>\n");
52 wprintf("(come back here later)</LI>\n");
54 if ((strlen(WC->ugname) > 0) && (strcasecmp(WC->ugname, WC->wc_roomname))) {
55 wprintf("<LI><B><A HREF=\"/ungoto\">\n");
56 wprintf("Ungoto</B></A><BR>\n");
57 wprintf("(oops! Back to %s)</LI>\n", WC->ugname);
61 wprintf("</TD><TD>\n"); /* start of second column */
64 wprintf("<LI><B><A HREF=\"/readnew\">\n");
65 wprintf("Read new messages</B></A><BR>...in this room</LI>\n");
67 wprintf("<LI><B><A HREF=\"/readfwd\">\n");
68 wprintf("Read all messages</B></A><BR>...old <EM>and</EM> new</LI>\n");
70 wprintf("<LI><B><A HREF=\"/display_enter\">\n");
71 wprintf("Enter a message</B></A><BR>(post in this room)</LI>");
74 wprintf("</TD><TD>"); /* start of third column */
77 wprintf("<LI><B><A HREF=\"/static/whoframeset.html\" TARGET=\"_top\">\n");
78 wprintf("Who is online?</B></A><BR>(users <EM>currently</EM> logged on)</LI>\n");
80 wprintf("<LI><B><A HREF=\"/userlist\">\n");
81 wprintf("User list</B></A><BR>(all registered users)</LI>\n");
83 wprintf("<LI><B><A HREF=\"/advanced\">\n");
84 wprintf("Advanced options</B></A><BR>...and maintenance</LI>\n");
86 wprintf("<LI><B><A HREF=\"/termquit\" TARGET=\"top\">\n");
87 wprintf("Log off</B></A><BR>Bye!</LI>\n");
90 wprintf("</TR></TABLE>\n");
92 wprintf("</CENTER>\n");
98 void embed_advanced_menu(void)
101 wprintf("<TABLE WIDTH=100%><TR VALIGN=TOP><TD>");
104 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
105 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
106 wprintf("<B>Interaction</B>\n");
107 wprintf("</FONT></TD></TR></TABLE>\n");
110 wprintf("<LI><A HREF=\"/display_page\">\n");
111 wprintf("Page another user</A>\n");
113 wprintf("<LI><A HREF=\"/chat\">");
114 wprintf("Chat with other online users</A>\n");
116 wprintf("<LI><A HREF=\"/display_generic\">\n");
117 wprintf("<FONT SIZE=-2>Generic server command</FONT></A>\n");
121 wprintf("</TD><TD>");
123 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
124 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
125 wprintf("<B>Your info</B>\n");
126 wprintf("</FONT></TD></TR></TABLE>\n");
129 wprintf("<LI><A HREF=\"/display_editbio\">\n");
130 wprintf("Enter your 'bio' (a few words about yourself)</A>\n");
132 wprintf("<LI><A HREF=\"/display_editpic\">\n");
133 wprintf("Edit your online photo</A>\n");
135 wprintf("<LI><A HREF=\"/display_reg\">\n");
136 wprintf("Re-enter your registration info (name, address, etc.)</A>\n");
138 wprintf("<LI><A HREF=\"/display_changepw\">\n");
139 wprintf("Change your password</A>\n");
144 wprintf("</TD></TR><TR VALIGN=TOP><TD>");
146 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
147 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
148 wprintf("<B>Advanced room commands</B>\n");
149 wprintf("</FONT></TD></TR></TABLE>\n");
152 wprintf("<LI><A HREF=\"/display_private\">\n");
153 wprintf("Go to a 'hidden' room</A>\n");
155 wprintf("<LI><A HREF=\"/display_entroom\">");
156 wprintf("Create a new room</A>\n");
158 wprintf("<LI><A HREF=\"/display_zap\">");
159 wprintf("Zap (forget) this room (%s)</A>\n", WC->wc_roomname);
161 wprintf("<LI><A HREF=\"/zapped_list\">");
162 wprintf("List all forgotten rooms</A>\n");
166 wprintf("</TD><TD>");
168 if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
169 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007777><TR><TD>");
170 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
171 wprintf("<B>Administrative functions</B>\n");
172 wprintf("</FONT></TD></TR></TABLE>\n");
175 wprintf("<LI><A HREF=\"/display_editroom\">\n");
176 wprintf("Edit or delete this room</A>\n");
178 wprintf("<LI><A HREF=\"/display_siteconfig\">\n");
179 wprintf("Edit site-wide configuration</A>\n");
181 if (WC->axlevel >= 6) {
182 wprintf("<LI><A HREF=\"/validate\">\n");
183 wprintf("Validate new users</A>\n");
185 wprintf("<LI><A HREF=\"/select_floor_to_edit_pic\">\n");
186 wprintf("Set or change a floor label graphic</A>\n");
188 wprintf("<LI><A HREF=\"/display_netconf\">\n");
189 wprintf("Configure networking with other systems</A>\n");
193 wprintf("</TD></TR></TABLE>");
195 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
196 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
197 wprintf("<B>Basic commands</B>\n");
198 wprintf("</FONT></TD></TR></TABLE>\n");
206 * menu of commands (as a page)
208 void display_main_menu(void)
216 void display_advanced_menu(void)
219 embed_advanced_menu();
226 * Display the screen to enter a generic server command
228 void display_generic(void)
232 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
233 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
234 wprintf("<B>Enter a server command</B>\n");
235 wprintf("</FONT></TD></TR></TABLE>\n");
238 wprintf("This screen allows you to enter Citadel server commands which are\n");
239 wprintf("not supported by WebCit. If you do not know what that means,\n");
240 wprintf("then this screen will not be of much use to you.<BR>\n");
242 wprintf("<FORM METHOD=\"POST\" ACTION=\"/do_generic\">\n");
244 wprintf("Enter command:<BR>\n");
245 wprintf("<INPUT TYPE=\"text\" NAME=\"g_cmd\" SIZE=80 MAXLENGTH=\"250\"><BR>\n");
247 wprintf("Command input (if requesting SEND_LISTING transfer mode):<BR>\n");
248 wprintf("<TEXTAREA NAME=\"g_input\" ROWS=10 COLS=80 WIDTH=80></TEXTAREA>\n");
250 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Send command\">");
251 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
253 wprintf("</FORM></CENTER>\n");
257 void do_generic(void)
264 if (strcasecmp(bstr("sc"), "Send command")) {
271 serv_printf("%s", bstr("g_cmd"));
274 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770077><TR><TD>");
275 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
276 wprintf("<B>Server command results</B>\n");
277 wprintf("</FONT></TD></TR></TABLE>\n");
279 wprintf("<TABLE border=0><TR><TD>Command:</TD><TD><TT>");
280 escputs(bstr("g_cmd"));
281 wprintf("</TT></TD></TR><TR><TD>Result:</TD><TD><TT>");
283 wprintf("</TT></TD></TR></TABLE><BR>\n");
286 serv_printf("\n\n000");
288 if ((buf[0] == '1') || (buf[0] == '8')) {
289 while (serv_gets(gcontent), strcmp(gcontent, "000")) {
296 text_to_server(bstr("g_input"));
302 serv_read(junk, len);
308 memset(junk, 0, len);
309 serv_write(junk, len);
313 wprintf("<A HREF=\"/display_generic\">Enter another command</A><BR>\n");
314 wprintf("<A HREF=\"/display_advanced\">Return to menu</A>\n");
322 * Display the menubar. Set as_single_page to
323 * display HTML headers and footers -- otherwise it's assumed
324 * that the menubar is being embedded in another page.
326 void display_menubar(int as_single_page) {
330 if (as_single_page) {
334 "<TITLE>MenuBar</TITLE>\n"
335 "<STYLE TYPE=\"text/css\">\n"
336 "BODY { text-decoration: none; }\n"
339 "<BODY BACKGROUND=\"/image&name=background\" "
340 "TEXT=\"#000000\" LINK=\"#FFFFFF\" "
341 "ALINK=\"#FFFFFF\" VLINK=\"#FFFFFF\">\n");
344 menubar_body = fopen("static/menubar.html", "r");
345 if (menubar_body == NULL) {
346 wprintf("menubar<BR>%s", strerror(errno));
348 while (fgets(buf, sizeof(buf), menubar_body) != NULL) {
351 fclose(menubar_body);
355 if (as_single_page) {