12 #include <sys/types.h>
14 #include <sys/socket.h>
17 #include <netinet/in.h>
32 void display_main_menu(void)
36 svprintf("BOXTITLE", WCS_STRING, "Basic commands");
37 do_template("beginbox");
39 wprintf("<TABLE border=0 align=center><TR>");
40 wprintf("<TD>"); /* start of first column */
43 wprintf("<LI><B><A HREF=\"/knrooms\">\n");
44 wprintf("List known rooms</B></A><BR>\n");
45 wprintf("Where can I go from here?</LI>\n");
47 wprintf("<LI><B><A HREF=\"/gotonext\">\n");
48 wprintf("Goto next room</B></A><BR>\n");
49 wprintf("...with <EM>unread</EM> messages</LI>\n");
51 wprintf("<LI><B><A HREF=\"/skip\">\n");
52 wprintf("Skip to next room</B></A><BR>\n");
53 wprintf("(come back here later)</LI>\n");
55 if ((strlen(WC->ugname) > 0) && (strcasecmp(WC->ugname, WC->wc_roomname))) {
56 wprintf("<LI><B><A HREF=\"/ungoto\">\n");
57 wprintf("Ungoto</B></A><BR>\n");
58 wprintf("(oops! Back to %s)</LI>\n", WC->ugname);
62 wprintf("</TD><TD>\n"); /* start of second column */
65 wprintf("<LI><B><A HREF=\"/readnew\">\n");
66 wprintf("Read new messages</B></A><BR>...in this room</LI>\n");
68 wprintf("<LI><B><A HREF=\"/readfwd\">\n");
69 wprintf("Read all messages</B></A><BR>...old <EM>and</EM> new</LI>\n");
71 wprintf("<LI><B><A HREF=\"/display_enter\">\n");
72 wprintf("Enter a message</B></A><BR>(post in this room)</LI>");
75 wprintf("</TD><TD>"); /* start of third column */
78 wprintf("<LI><B><A HREF=\"/summary\">\n");
79 wprintf("Summary page</B></A><BR>Summary of my account</LI>\n");
81 wprintf("<LI><B><A HREF=\"/userlist\">\n");
82 wprintf("User list</B></A><BR>(all registered users)</LI>\n");
84 wprintf("<LI><B><A HREF=\"/termquit\" TARGET=\"_top\">\n");
85 wprintf("Log off</B></A><BR>Bye!</LI>\n");
88 wprintf("</TR></TABLE>\n");
89 do_template("endbox");
91 wprintf("<TABLE WIDTH=100%%><TR VALIGN=TOP><TD>");
93 svprintf("BOXTITLE", WCS_STRING, "Interaction");
94 do_template("beginbox");
97 wprintf("<LI><A HREF=\"/whobbs\">\n");
98 wprintf("Who is online?</A><font size=-2> "
99 "(users <EM>currently</EM> logged on)</font>\n");
100 wprintf("<LI><A HREF=\"/chat\">");
101 wprintf("Chat with other online users</A>\n");
103 wprintf("<LI><A HREF=\"/display_generic\">\n");
104 wprintf("<FONT SIZE=-2>Generic server command</FONT></A>\n");
107 do_template("endbox");
109 wprintf("</TD><TD>");
111 svprintf("BOXTITLE", WCS_STRING, "Your info");
112 do_template("beginbox");
115 wprintf("<LI><A HREF=\"/display_editbio\">\n");
116 wprintf("Enter your 'bio' (a few words about yourself)</A>\n");
118 wprintf("<LI><A HREF=\"/display_editpic\">\n");
119 wprintf("Edit your online photo</A>\n");
121 wprintf("<LI><A HREF=\"/display_reg\">\n");
122 wprintf("Re-enter your registration info (name, address, etc.)</A>\n");
124 wprintf("<LI><A HREF=\"/display_changepw\">\n");
125 wprintf("Change your password</A>\n");
128 do_template("endbox");
130 wprintf("</TD></TR><TR VALIGN=TOP><TD>");
132 svprintf("BOXTITLE", WCS_STRING, "Advanced room commands");
133 do_template("beginbox");
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->wc_roomname);
145 wprintf("<LI><A HREF=\"/display_whok\">\n");
146 wprintf("Access controls for this room</A>\n");
148 wprintf("<LI><A HREF=\"/zapped_list\">");
149 wprintf("List all forgotten rooms</A>\n");
152 do_template("endbox");
154 wprintf("</TD><TD>");
156 if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
157 svprintf("BOXTITLE", WCS_STRING, "Administrative functions");
158 do_template("beginbox");
161 wprintf("<LI><A HREF=\"/display_editroom\">\n");
162 wprintf("Edit or delete this room</A>\n");
164 wprintf("<LI><A HREF=\"/display_siteconfig\">\n");
165 wprintf("Edit site-wide configuration</A>\n");
167 if (WC->axlevel >= 6) {
168 wprintf("<LI><A HREF=\"/select_user_to_edit\">\n");
169 wprintf("Add, change, delete user accounts</A>\n");
171 wprintf("<LI><A HREF=\"/validate\">\n");
172 wprintf("Validate new users</A>\n");
174 wprintf("<LI><A HREF=\"/display_floorconfig\">\n");
175 wprintf("Add, change, or delete floors</A>\n");
177 wprintf("<LI><A HREF=\"/display_netconf\">\n");
178 wprintf("Configure networking with other systems</A>\n");
181 do_template("endbox");
183 wprintf("</TD></TR></TABLE>");
192 * Display the screen to enter a generic server command
194 void display_generic(void)
198 svprintf("BOXTITLE", WCS_STRING, "Enter a server command");
199 do_template("beginbox");
202 wprintf("This screen allows you to enter Citadel server commands which are\n");
203 wprintf("not supported by WebCit. If you do not know what that means,\n");
204 wprintf("then this screen will not be of much use to you.<BR>\n");
206 wprintf("<FORM METHOD=\"POST\" ACTION=\"/do_generic\">\n");
208 wprintf("Enter command:<BR>\n");
209 wprintf("<INPUT TYPE=\"text\" NAME=\"g_cmd\" SIZE=80 MAXLENGTH=\"250\"><BR>\n");
211 wprintf("Command input (if requesting SEND_LISTING transfer mode):<BR>\n");
212 wprintf("<TEXTAREA NAME=\"g_input\" ROWS=10 COLS=80 WIDTH=80></TEXTAREA><BR>\n");
214 wprintf("<FONT SIZE=-2>Detected host header is http://%s</FONT>\n",
216 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Send command\">");
217 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
219 wprintf("</FORM></CENTER>\n");
220 do_template("endbox");
224 void do_generic(void)
231 if (strcasecmp(bstr("sc"), "Send command")) {
238 serv_printf("%s", bstr("g_cmd"));
241 svprintf("BOXTITLE", WCS_STRING, "Server command results");
242 do_template("beginbox");
244 wprintf("<TABLE border=0><TR><TD>Command:</TD><TD><TT>");
245 escputs(bstr("g_cmd"));
246 wprintf("</TT></TD></TR><TR><TD>Result:</TD><TD><TT>");
248 wprintf("</TT></TD></TR></TABLE><BR>\n");
251 serv_printf("\n\n000");
253 if ((buf[0] == '1') || (buf[0] == '8')) {
254 while (serv_gets(gcontent), strcmp(gcontent, "000")) {
261 text_to_server(bstr("g_input"), 0);
267 serv_read(junk, len);
273 memset(junk, 0, len);
274 serv_write(junk, len);
278 wprintf("<A HREF=\"/display_generic\">Enter another command</A><BR>\n");
279 wprintf("<A HREF=\"/display_advanced\">Return to menu</A>\n");
280 do_template("endbox");
288 * Display the menubar. Set as_single_page to
289 * display HTML headers and footers -- otherwise it's assumed
290 * that the menubar is being embedded in another page.
292 void display_menubar(int as_single_page) {
294 if (as_single_page) {
298 "<TITLE>MenuBar</TITLE>\n"
299 "<STYLE TYPE=\"text/css\">\n"
300 "BODY { text-decoration: none; }\n"
303 do_template("background");
306 do_template("menubar");
308 if (as_single_page) {