12 #include <sys/types.h>
14 #include <sys/socket.h>
17 #include <netinet/in.h>
32 void display_main_menu(void)
38 svprintf("BOXTITLE", WCS_STRING, "Basic commands");
39 do_template("beginbox");
41 wprintf("<TABLE border=0 align=center><TR>");
42 wprintf("<TD>"); /* start of first column */
45 wprintf("<LI><B><A HREF=\"/knrooms\">\n");
46 wprintf("List known rooms</B></A><BR>\n");
47 wprintf("Where can I go from here?</LI>\n");
49 wprintf("<LI><B><A HREF=\"/gotonext\">\n");
50 wprintf("Goto next room</B></A><BR>\n");
51 wprintf("...with <EM>unread</EM> messages</LI>\n");
53 wprintf("<LI><B><A HREF=\"/skip\">\n");
54 wprintf("Skip to next room</B></A><BR>\n");
55 wprintf("(come back here later)</LI>\n");
57 if ((strlen(WC->ugname) > 0) && (strcasecmp(WC->ugname, WC->wc_roomname))) {
58 wprintf("<LI><B><A HREF=\"/ungoto\">\n");
59 wprintf("Ungoto</B></A><BR>\n");
60 wprintf("(oops! Back to %s)</LI>\n", WC->ugname);
64 wprintf("</TD><TD>\n"); /* start of second column */
67 wprintf("<LI><B><A HREF=\"/readnew\">\n");
68 wprintf("Read new messages</B></A><BR>...in this room</LI>\n");
70 wprintf("<LI><B><A HREF=\"/readfwd\">\n");
71 wprintf("Read all messages</B></A><BR>...old <EM>and</EM> new</LI>\n");
73 wprintf("<LI><B><A HREF=\"/display_enter\">\n");
74 wprintf("Enter a message</B></A><BR>(post in this room)</LI>");
77 wprintf("</TD><TD>"); /* start of third column */
80 wprintf("<LI><B><A HREF=\"/summary\">\n");
81 wprintf("Summary page</B></A><BR>Summary of my account</LI>\n");
83 wprintf("<LI><B><A HREF=\"/userlist\">\n");
84 wprintf("User list</B></A><BR>(all registered users)</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");
91 do_template("endbox");
93 wprintf("<TABLE WIDTH=100%%><TR VALIGN=TOP><TD>");
95 svprintf("BOXTITLE", WCS_STRING, "Interaction");
96 do_template("beginbox");
99 wprintf("<LI><A HREF=\"/whobbs\">\n");
100 wprintf("Who is online?</A><font size=-2> "
101 "(users <EM>currently</EM> logged on)</font>\n");
102 wprintf("<LI><A HREF=\"/chat\">");
103 wprintf("Chat with other online users</A>\n");
105 wprintf("<LI><A HREF=\"/display_generic\">\n");
106 wprintf("<FONT SIZE=-2>Generic server command</FONT></A>\n");
109 do_template("endbox");
111 wprintf("</TD><TD>");
113 svprintf("BOXTITLE", WCS_STRING, "Your info");
114 do_template("beginbox");
117 wprintf("<LI><A HREF=\"/display_editbio\">\n");
118 wprintf("Enter your 'bio' (a few words about yourself)</A>\n");
120 wprintf("<LI><A HREF=\"/display_editpic\">\n");
121 wprintf("Edit your online photo</A>\n");
123 wprintf("<LI><A HREF=\"/display_reg\">\n");
124 wprintf("Re-enter your registration info (name, address, etc.)</A>\n");
126 wprintf("<LI><A HREF=\"/display_changepw\">\n");
127 wprintf("Change your password</A>\n");
130 do_template("endbox");
132 wprintf("</TD></TR><TR VALIGN=TOP><TD>");
134 svprintf("BOXTITLE", WCS_STRING, "Advanced room commands");
135 do_template("beginbox");
138 wprintf("<LI><A HREF=\"/display_private\">\n");
139 wprintf("Go to a 'hidden' room</A>\n");
141 wprintf("<LI><A HREF=\"/display_entroom\">");
142 wprintf("Create a new room</A>\n");
144 wprintf("<LI><A HREF=\"/display_zap\">");
145 wprintf("Zap (forget) this room (%s)</A>\n", WC->wc_roomname);
147 wprintf("<LI><A HREF=\"/display_whok\">\n");
148 wprintf("Access controls for this room</A>\n");
150 wprintf("<LI><A HREF=\"/zapped_list\">");
151 wprintf("List all forgotten rooms</A>\n");
154 do_template("endbox");
156 wprintf("</TD><TD>");
158 if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
159 svprintf("BOXTITLE", WCS_STRING, "Administrative functions");
160 do_template("beginbox");
163 wprintf("<LI><A HREF=\"/display_editroom\">\n");
164 wprintf("Edit or delete this room</A>\n");
166 wprintf("<LI><A HREF=\"/display_siteconfig\">\n");
167 wprintf("Edit site-wide configuration</A>\n");
169 if (WC->axlevel >= 6) {
170 wprintf("<LI><A HREF=\"/select_user_to_edit\">\n");
171 wprintf("Add, change, delete user accounts</A>\n");
173 wprintf("<LI><A HREF=\"/validate\">\n");
174 wprintf("Validate new users</A>\n");
176 wprintf("<LI><A HREF=\"/display_floorconfig\">\n");
177 wprintf("Add, change, or delete floors</A>\n");
179 wprintf("<LI><A HREF=\"/display_netconf\">\n");
180 wprintf("Configure networking with other systems</A>\n");
183 do_template("endbox");
185 wprintf("</TD></TR></TABLE>");
194 * Display the screen to enter a generic server command
196 void display_generic(void)
200 svprintf("BOXTITLE", WCS_STRING, "Enter a server command");
201 do_template("beginbox");
204 wprintf("This screen allows you to enter Citadel server commands which are\n");
205 wprintf("not supported by WebCit. If you do not know what that means,\n");
206 wprintf("then this screen will not be of much use to you.<BR>\n");
208 wprintf("<FORM METHOD=\"POST\" ACTION=\"/do_generic\">\n");
210 wprintf("Enter command:<BR>\n");
211 wprintf("<INPUT TYPE=\"text\" NAME=\"g_cmd\" SIZE=80 MAXLENGTH=\"250\"><BR>\n");
213 wprintf("Command input (if requesting SEND_LISTING transfer mode):<BR>\n");
214 wprintf("<TEXTAREA NAME=\"g_input\" ROWS=10 COLS=80 WIDTH=80></TEXTAREA><BR>\n");
216 wprintf("<FONT SIZE=-2>Detected host header is http://%s</FONT>\n",
218 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Send command\">");
219 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
221 wprintf("</FORM></CENTER>\n");
222 do_template("endbox");
226 void do_generic(void)
233 if (strcasecmp(bstr("sc"), "Send command")) {
240 serv_printf("%s", bstr("g_cmd"));
243 svprintf("BOXTITLE", WCS_STRING, "Server command results");
244 do_template("beginbox");
246 wprintf("<TABLE border=0><TR><TD>Command:</TD><TD><TT>");
247 escputs(bstr("g_cmd"));
248 wprintf("</TT></TD></TR><TR><TD>Result:</TD><TD><TT>");
250 wprintf("</TT></TD></TR></TABLE><BR>\n");
253 serv_printf("\n\n000");
255 if ((buf[0] == '1') || (buf[0] == '8')) {
256 while (serv_gets(gcontent), strcmp(gcontent, "000")) {
263 text_to_server(bstr("g_input"), 0);
269 serv_read(junk, len);
275 memset(junk, 0, len);
276 serv_write(junk, len);
280 wprintf("<A HREF=\"/display_generic\">Enter another command</A><BR>\n");
281 wprintf("<A HREF=\"/display_advanced\">Return to menu</A>\n");
282 do_template("endbox");
290 * Display the menubar. Set as_single_page to
291 * display HTML headers and footers -- otherwise it's assumed
292 * that the menubar is being embedded in another page.
294 void display_menubar(int as_single_page) {
296 if (as_single_page) {
300 "<TITLE>MenuBar</TITLE>\n"
301 "<STYLE TYPE=\"text/css\">\n"
302 "BODY { text-decoration: none; }\n"
305 do_template("background");
308 do_template("menubar");
310 if (as_single_page) {