12 #include <sys/types.h>
14 #include <sys/socket.h>
17 #include <netinet/in.h>
32 void display_main_menu(void)
36 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770077><TR><TD>"
37 "<FONT SIZE=+1 COLOR=\"FFFFFF\""
38 "<B>Basic commands</B>\n"
40 "</TD></TR></TABLE>\n"
41 "<CENTER><TABLE border=0><TR>"
44 wprintf("<TD>"); /* start of first column */
47 wprintf("<LI><B><A HREF=\"/knrooms\">\n");
48 wprintf("List known rooms</B></A><BR>\n");
49 wprintf("Where can I go from here?</LI>\n");
51 wprintf("<LI><B><A HREF=\"/gotonext\">\n");
52 wprintf("Goto next room</B></A><BR>\n");
53 wprintf("...with <EM>unread</EM> messages</LI>\n");
55 wprintf("<LI><B><A HREF=\"/skip\">\n");
56 wprintf("Skip to next room</B></A><BR>\n");
57 wprintf("(come back here later)</LI>\n");
59 if ((strlen(WC->ugname) > 0) && (strcasecmp(WC->ugname, WC->wc_roomname))) {
60 wprintf("<LI><B><A HREF=\"/ungoto\">\n");
61 wprintf("Ungoto</B></A><BR>\n");
62 wprintf("(oops! Back to %s)</LI>\n", WC->ugname);
66 wprintf("</TD><TD>\n"); /* start of second column */
69 wprintf("<LI><B><A HREF=\"/readnew\">\n");
70 wprintf("Read new messages</B></A><BR>...in this room</LI>\n");
72 wprintf("<LI><B><A HREF=\"/readfwd\">\n");
73 wprintf("Read all messages</B></A><BR>...old <EM>and</EM> new</LI>\n");
75 wprintf("<LI><B><A HREF=\"/display_enter\">\n");
76 wprintf("Enter a message</B></A><BR>(post in this room)</LI>");
79 wprintf("</TD><TD>"); /* start of third column */
82 wprintf("<LI><B><A HREF=\"/summary\">\n");
83 wprintf("Summary page</B></A><BR>Summary of my account</LI>\n");
85 wprintf("<LI><B><A HREF=\"/userlist\">\n");
86 wprintf("User list</B></A><BR>(all registered users)</LI>\n");
88 wprintf("<LI><B><A HREF=\"/termquit\" TARGET=\"_top\">\n");
89 wprintf("Log off</B></A><BR>Bye!</LI>\n");
92 wprintf("</TR></TABLE>\n");
94 wprintf("<TABLE WIDTH=100%%><TR VALIGN=TOP><TD>");
96 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770000><TR><TD>");
97 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
98 wprintf("<B>Interaction</B>\n");
99 wprintf("</FONT></TD></TR></TABLE>\n");
102 wprintf("<LI><A HREF=\"/whobbs\">\n");
103 wprintf("Who is online?</A><font size=-2> "
104 "(users <EM>currently</EM> logged on)</font>\n");
105 wprintf("<LI><A HREF=\"/chat\">");
106 wprintf("Chat with other online users</A>\n");
108 wprintf("<LI><A HREF=\"/display_generic\">\n");
109 wprintf("<FONT SIZE=-2>Generic server command</FONT></A>\n");
113 wprintf("</TD><TD>");
115 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>");
116 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
117 wprintf("<B>Your info</B>\n");
118 wprintf("</FONT></TD></TR></TABLE>\n");
121 wprintf("<LI><A HREF=\"/display_editbio\">\n");
122 wprintf("Enter your 'bio' (a few words about yourself)</A>\n");
124 wprintf("<LI><A HREF=\"/display_editpic\">\n");
125 wprintf("Edit your online photo</A>\n");
127 wprintf("<LI><A HREF=\"/display_reg\">\n");
128 wprintf("Re-enter your registration info (name, address, etc.)</A>\n");
130 wprintf("<LI><A HREF=\"/display_changepw\">\n");
131 wprintf("Change your password</A>\n");
136 wprintf("</TD></TR><TR VALIGN=TOP><TD>");
138 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=000077><TR><TD>");
139 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
140 wprintf("<B>Advanced room commands</B>\n");
141 wprintf("</FONT></TD></TR></TABLE>\n");
144 wprintf("<LI><A HREF=\"/display_private\">\n");
145 wprintf("Go to a 'hidden' room</A>\n");
147 wprintf("<LI><A HREF=\"/display_entroom\">");
148 wprintf("Create a new room</A>\n");
150 wprintf("<LI><A HREF=\"/display_zap\">");
151 wprintf("Zap (forget) this room (%s)</A>\n", WC->wc_roomname);
153 wprintf("<LI><A HREF=\"/display_whok\">\n");
154 wprintf("Access controls for this room</A>\n");
156 wprintf("<LI><A HREF=\"/zapped_list\">");
157 wprintf("List all forgotten rooms</A>\n");
161 wprintf("</TD><TD>");
163 if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
164 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007777><TR><TD>");
165 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
166 wprintf("<B>Administrative functions</B>\n");
167 wprintf("</FONT></TD></TR></TABLE>\n");
170 wprintf("<LI><A HREF=\"/display_editroom\">\n");
171 wprintf("Edit or delete this room</A>\n");
173 wprintf("<LI><A HREF=\"/display_siteconfig\">\n");
174 wprintf("Edit site-wide configuration</A>\n");
176 if (WC->axlevel >= 6) {
177 wprintf("<LI><A HREF=\"/select_user_to_edit\">\n");
178 wprintf("Add, change, delete user accounts</A>\n");
180 wprintf("<LI><A HREF=\"/validate\">\n");
181 wprintf("Validate new users</A>\n");
183 wprintf("<LI><A HREF=\"/display_floorconfig\">\n");
184 wprintf("Add, change, or delete floors</A>\n");
186 wprintf("<LI><A HREF=\"/display_netconf\">\n");
187 wprintf("Configure networking with other systems</A>\n");
188 wprintf("<LI><A HREF=\"/static/colorpicker.html\">\n");
189 wprintf("Reconfigure color scheme</A>\n");
193 wprintf("</TD></TR></TABLE>");
202 * Display the screen to enter a generic server command
204 void display_generic(void)
208 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770077><TR><TD>");
209 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
210 wprintf("<B>Enter a server command</B>\n");
211 wprintf("</FONT></TD></TR></TABLE>\n");
214 wprintf("This screen allows you to enter Citadel server commands which are\n");
215 wprintf("not supported by WebCit. If you do not know what that means,\n");
216 wprintf("then this screen will not be of much use to you.<BR>\n");
218 wprintf("<FORM METHOD=\"POST\" ACTION=\"/do_generic\">\n");
220 wprintf("Enter command:<BR>\n");
221 wprintf("<INPUT TYPE=\"text\" NAME=\"g_cmd\" SIZE=80 MAXLENGTH=\"250\"><BR>\n");
223 wprintf("Command input (if requesting SEND_LISTING transfer mode):<BR>\n");
224 wprintf("<TEXTAREA NAME=\"g_input\" ROWS=10 COLS=80 WIDTH=80></TEXTAREA><BR>\n");
226 wprintf("<FONT SIZE=-2>Detected host header is http://%s</FONT>\n",
228 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Send command\">");
229 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
231 wprintf("</FORM></CENTER>\n");
235 void do_generic(void)
242 if (strcasecmp(bstr("sc"), "Send command")) {
249 serv_printf("%s", bstr("g_cmd"));
252 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770077><TR><TD>");
253 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
254 wprintf("<B>Server command results</B>\n");
255 wprintf("</FONT></TD></TR></TABLE>\n");
257 wprintf("<TABLE border=0><TR><TD>Command:</TD><TD><TT>");
258 escputs(bstr("g_cmd"));
259 wprintf("</TT></TD></TR><TR><TD>Result:</TD><TD><TT>");
261 wprintf("</TT></TD></TR></TABLE><BR>\n");
264 serv_printf("\n\n000");
266 if ((buf[0] == '1') || (buf[0] == '8')) {
267 while (serv_gets(gcontent), strcmp(gcontent, "000")) {
274 text_to_server(bstr("g_input"), 0);
280 serv_read(junk, len);
286 memset(junk, 0, len);
287 serv_write(junk, len);
291 wprintf("<A HREF=\"/display_generic\">Enter another command</A><BR>\n");
292 wprintf("<A HREF=\"/display_advanced\">Return to menu</A>\n");
300 * Display the menubar. Set as_single_page to
301 * display HTML headers and footers -- otherwise it's assumed
302 * that the menubar is being embedded in another page.
304 void display_menubar(int as_single_page) {
306 if (as_single_page) {
310 "<TITLE>MenuBar</TITLE>\n"
311 "<STYLE TYPE=\"text/css\">\n"
312 "BODY { text-decoration: none; }\n"
315 do_template("background");
318 do_template("menubar");
320 if (as_single_page) {