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=\"/whobbs\">\n");
83 wprintf("Who is online?</B></A><BR>(users <EM>currently</EM> logged on)</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=\"/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");
110 wprintf("</TD><TD>");
112 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>");
113 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
114 wprintf("<B>Your info</B>\n");
115 wprintf("</FONT></TD></TR></TABLE>\n");
118 wprintf("<LI><A HREF=\"/display_editbio\">\n");
119 wprintf("Enter your 'bio' (a few words about yourself)</A>\n");
121 wprintf("<LI><A HREF=\"/display_editpic\">\n");
122 wprintf("Edit your online photo</A>\n");
124 wprintf("<LI><A HREF=\"/display_reg\">\n");
125 wprintf("Re-enter your registration info (name, address, etc.)</A>\n");
127 wprintf("<LI><A HREF=\"/display_changepw\">\n");
128 wprintf("Change your password</A>\n");
133 wprintf("</TD></TR><TR VALIGN=TOP><TD>");
135 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=000077><TR><TD>");
136 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
137 wprintf("<B>Advanced room commands</B>\n");
138 wprintf("</FONT></TD></TR></TABLE>\n");
141 wprintf("<LI><A HREF=\"/display_private\">\n");
142 wprintf("Go to a 'hidden' room</A>\n");
144 wprintf("<LI><A HREF=\"/display_entroom\">");
145 wprintf("Create a new room</A>\n");
147 wprintf("<LI><A HREF=\"/display_zap\">");
148 wprintf("Zap (forget) this room (%s)</A>\n", WC->wc_roomname);
150 wprintf("<LI><A HREF=\"/display_whok\">\n");
151 wprintf("Access controls for this room</A>\n");
153 wprintf("<LI><A HREF=\"/zapped_list\">");
154 wprintf("List all forgotten rooms</A>\n");
158 wprintf("</TD><TD>");
160 if ((WC->axlevel >= 6) || (WC->is_room_aide)) {
161 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007777><TR><TD>");
162 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
163 wprintf("<B>Administrative functions</B>\n");
164 wprintf("</FONT></TD></TR></TABLE>\n");
167 wprintf("<LI><A HREF=\"/display_editroom\">\n");
168 wprintf("Edit or delete this room</A>\n");
170 wprintf("<LI><A HREF=\"/display_siteconfig\">\n");
171 wprintf("Edit site-wide configuration</A>\n");
173 if (WC->axlevel >= 6) {
174 wprintf("<LI><A HREF=\"/select_user_to_edit\">\n");
175 wprintf("Add, change, delete user accounts</A>\n");
177 wprintf("<LI><A HREF=\"/validate\">\n");
178 wprintf("Validate new users</A>\n");
180 wprintf("<LI><A HREF=\"/select_floor_to_edit_pic\">\n");
181 wprintf("Set or change a floor label graphic</A>\n");
183 wprintf("<LI><A HREF=\"/display_netconf\">\n");
184 wprintf("Configure networking with other systems</A>\n");
188 wprintf("</TD></TR></TABLE>");
197 * Display the screen to enter a generic server command
199 void display_generic(void)
203 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770077><TR><TD>");
204 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
205 wprintf("<B>Enter a server command</B>\n");
206 wprintf("</FONT></TD></TR></TABLE>\n");
209 wprintf("This screen allows you to enter Citadel server commands which are\n");
210 wprintf("not supported by WebCit. If you do not know what that means,\n");
211 wprintf("then this screen will not be of much use to you.<BR>\n");
213 wprintf("<FORM METHOD=\"POST\" ACTION=\"/do_generic\">\n");
215 wprintf("Enter command:<BR>\n");
216 wprintf("<INPUT TYPE=\"text\" NAME=\"g_cmd\" SIZE=80 MAXLENGTH=\"250\"><BR>\n");
218 wprintf("Command input (if requesting SEND_LISTING transfer mode):<BR>\n");
219 wprintf("<TEXTAREA NAME=\"g_input\" ROWS=10 COLS=80 WIDTH=80></TEXTAREA>\n");
221 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Send command\">");
222 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><BR>\n");
224 wprintf("</FORM></CENTER>\n");
228 void do_generic(void)
235 if (strcasecmp(bstr("sc"), "Send command")) {
242 serv_printf("%s", bstr("g_cmd"));
245 wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=770077><TR><TD>");
246 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
247 wprintf("<B>Server command results</B>\n");
248 wprintf("</FONT></TD></TR></TABLE>\n");
250 wprintf("<TABLE border=0><TR><TD>Command:</TD><TD><TT>");
251 escputs(bstr("g_cmd"));
252 wprintf("</TT></TD></TR><TR><TD>Result:</TD><TD><TT>");
254 wprintf("</TT></TD></TR></TABLE><BR>\n");
257 serv_printf("\n\n000");
259 if ((buf[0] == '1') || (buf[0] == '8')) {
260 while (serv_gets(gcontent), strcmp(gcontent, "000")) {
267 text_to_server(bstr("g_input"));
273 serv_read(junk, len);
279 memset(junk, 0, len);
280 serv_write(junk, len);
284 wprintf("<A HREF=\"/display_generic\">Enter another command</A><BR>\n");
285 wprintf("<A HREF=\"/display_advanced\">Return to menu</A>\n");
293 * Display the menubar. Set as_single_page to
294 * display HTML headers and footers -- otherwise it's assumed
295 * that the menubar is being embedded in another page.
297 void display_menubar(int as_single_page) {
299 if (as_single_page) {
303 "<TITLE>MenuBar</TITLE>\n"
304 "<STYLE TYPE=\"text/css\">\n"
305 "BODY { text-decoration: none; }\n"
308 do_template("background");
311 do_template("menubar");
313 if (as_single_page) {