]> code.citadel.org Git - citadel.git/blob - webcit/iconbar.c
* can add chat to iconbar
[citadel.git] / webcit / iconbar.c
1 /* $Id$ */
2
3 #include <ctype.h>
4 #include <stdlib.h>
5 #include <unistd.h>
6 #include <stdio.h>
7 #include <fcntl.h>
8 #include <signal.h>
9 #include <sys/types.h>
10 #include <sys/wait.h>
11 #include <sys/socket.h>
12 #include <sys/time.h>
13 #include <limits.h>
14 #include <netinet/in.h>
15 #include <netdb.h>
16 #include <string.h>
17 #include <time.h>
18 #include <pwd.h>
19 #include <errno.h>
20 #include <stdarg.h>
21 #include <pthread.h>
22 #include <signal.h>
23 #include "webcit.h"
24
25
26 /* Values for ib_displayas */
27 #define IB_PICTEXT      0
28 #define IB_PICONLY      1
29 #define IB_TEXTONLY     2
30
31 void do_iconbar(void) {
32         char iconbar[SIZ];
33         char buf[SIZ];
34         char key[SIZ], value[SIZ];
35         int i;
36
37         /* The initialized values of these variables also happen to
38          * specify the default values for users who haven't customized
39          * their iconbars.  These should probably be set in a master
40          * configuration somewhere.
41          */
42         int ib_displayas = 0;   /* pictures and text, pictures, text */
43         int ib_logo = 1;        /* Site logo */
44         int ib_summary = 0;     /* Summary page icon */
45         int ib_inbox = 0;       /* Inbox icon */
46         int ib_calendar = 0;    /* Calendar icon */
47         int ib_contacts = 0;    /* Contacts icon */
48         int ib_tasks = 0;       /* Tasks icon */
49         int ib_rooms = 1;       /* Rooms icon */
50         int ib_users = 1;       /* Users icon */
51         int ib_chat = 0;        /* Chat icon */
52         int ib_advanced = 1;    /* Advanced Options icon */
53         int ib_logoff = 1;      /* Logoff button */
54         int ib_citadel = 1;     /* 'Powered by Citadel' logo */
55         /*
56          */
57
58         get_preference("iconbar", iconbar);
59         for (i=0; i<num_tokens(iconbar, ','); ++i) {
60                 extract_token(buf, iconbar, i, ',');
61                 extract_token(key, buf, 0, '=');
62                 extract_token(value, buf, 1, '=');
63
64                 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
65                 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
66                 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
67                 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
68                 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
69                 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
70                 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
71                 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
72                 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
73                 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
74                 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
75                 if (!strcasecmp(key, "ib_logoff")) ib_logoff = atoi(value);
76                 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
77         }
78
79         output_headers(11);
80         do_template("beginbox_nt");
81
82         wprintf("<center>\n");
83
84         if (ib_logo) if (ib_displayas != IB_TEXTONLY) wprintf(
85                 "<IMG BORDER=\"0\" WIDTH=\"48\" "
86                         "HEIGHT=\"48\" SRC=\"/image&name=hello\" ALT=\"&nbsp;\">"
87                         "<BR>\n"
88         );
89
90         if (ib_summary) {
91                 wprintf("<SPAN CLASS=\"iconbar_link\">"
92                         "<A HREF=\"/summary\" "
93                         "TITLE=\"Your summary page\" "
94                         "TARGET=\"workspace\">"
95                 );
96                 if (ib_displayas != IB_TEXTONLY) {
97                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
98                                 "SRC=\"/static/summary.gif\"><BR>");
99                 }
100                 if (ib_displayas != IB_PICONLY) {
101                         wprintf("Summary<BR>");
102                 }
103                 wprintf("</A></SPAN>\n");
104         }
105
106         if (ib_inbox) {
107                 wprintf("<SPAN CLASS=\"iconbar_link\">"
108                         "<A HREF=\"/dotgoto?room=_MAIL_\" "
109                         "TITLE=\"Go to your e-mail inbox\" "
110                         "TARGET=\"workspace\">"
111                 );
112                 if (ib_displayas != IB_TEXTONLY) {
113                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
114                                 "SRC=\"/static/mail.gif\"><BR>");
115                 }
116                 if (ib_displayas != IB_PICONLY) {
117                         wprintf("Mail<BR>");
118                 }
119                 wprintf("</A></SPAN>\n");
120         }
121
122         if (ib_calendar) {
123                 wprintf("<SPAN CLASS=\"iconbar_link\">"
124                         "<A HREF=\"/dotgoto?room=Calendar\" "
125                         "TITLE=\"Go to your personal calendar\" "
126                         "TARGET=\"workspace\">"
127                 );
128                 if (ib_displayas != IB_TEXTONLY) {
129                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
130                         "SRC=\"/static/vcalendar.gif\"><BR>");
131                 }
132                 if (ib_displayas != IB_PICONLY) {
133                         wprintf("Calendar<BR>");
134                 }
135                 wprintf("</A></SPAN>\n");
136         }
137
138         if (ib_contacts) {
139                 wprintf("<SPAN CLASS=\"iconbar_link\">"
140                         "<A HREF=\"/dotgoto?room=Contacts\" "
141                         "TITLE=\"Go to your personal address book\" "
142                         "TARGET=\"workspace\">"
143                 );
144                 if (ib_displayas != IB_TEXTONLY) {
145                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
146                         "SRC=\"/static/vcard.gif\"><BR>");
147                 }
148                 if (ib_displayas != IB_PICONLY) {
149                         wprintf("Contacts<BR>");
150                 }
151                 wprintf("</A></SPAN>\n");
152         }
153
154         if (ib_tasks)  {
155                 wprintf("<SPAN CLASS=\"iconbar_link\">"
156                         "<A HREF=\"/dotgoto?room=Tasks\" "
157                         "TITLE=\"Go to your personal task list\" "
158                         "TARGET=\"workspace\">"
159                 );
160                 if (ib_displayas != IB_TEXTONLY) {
161                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
162                         "SRC=\"/static/vcalendar.gif\"><BR>");
163                 }
164                 if (ib_displayas != IB_PICONLY) {
165                         wprintf("Tasks<BR>");
166                 }
167                 wprintf("</A></SPAN>\n");
168         }
169
170         if (ib_rooms) {
171                 wprintf("<SPAN CLASS=\"iconbar_link\">"
172                         "<A HREF=\"/knrooms\" TITLE=\"Shows a list of all "
173                         "Rooms that you have access to\" TARGET=\"workspace\">"
174                 );
175                 if (ib_displayas != IB_TEXTONLY) {
176                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
177                         "SRC=\"/static/rooms-icon.gif\"><BR>");
178                 }
179                 if (ib_displayas != IB_PICONLY) {
180                         wprintf("Rooms<BR>");
181                 }
182                 wprintf("</A></SPAN>\n");
183         }
184
185         if (ib_users) {
186                 wprintf("<SPAN CLASS=\"iconbar_link\">"
187                         "<A HREF=\"/whobbs\" TITLE=\"See who is online right now\" "
188                         "TARGET=\"workspace\">"
189                 );
190                 if (ib_displayas != IB_TEXTONLY) {
191                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
192                         "SRC=\"/static/users-icon.gif\"><BR>");
193                 }
194                 if (ib_displayas != IB_PICONLY) {
195                         wprintf("Users<BR>");
196                 }
197                 wprintf("</A></SPAN>\n");
198         }
199
200         if (ib_chat) {
201                 wprintf("<SPAN CLASS=\"iconbar_link\">"
202                         "<A HREF=\"/chat\" TITLE=\"Chat with other users in this room\" "
203                         "TARGET=\"workspace\">"
204                 );
205                 if (ib_displayas != IB_TEXTONLY) {
206                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
207                         "SRC=\"/static/chat-icon.gif\"><BR>");
208                 }
209                 if (ib_displayas != IB_PICONLY) {
210                         wprintf("Chat<BR>");
211                 }
212                 wprintf("</A></SPAN>\n");
213         }
214
215         if (ib_advanced) {
216                 wprintf("<SPAN CLASS=\"iconbar_link\">"
217                         "<A HREF=\"/display_main_menu\" "
218                         "TITLE=\"Advanced Options Menu: Advanced Room commands, "
219                         "Account Info, and Chat\" "
220                         "TARGET=\"workspace\">"
221                 );
222                 if (ib_displayas != IB_TEXTONLY) {
223                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
224                         "SRC=\"/static/advanced-icon.gif\"><BR>");
225                 }
226                 if (ib_displayas != IB_PICONLY) {
227                         wprintf("Advanced options<BR>");
228                 }
229                 wprintf("</A></SPAN>\n");
230         }
231
232         if (ib_logoff) {
233                 wprintf("<SPAN CLASS=\"iconbar_link\">"
234                         "<A HREF=\"/termquit\" TITLE=\"Log off\" TARGET=\"_top\" "
235                         "onClick=\"return confirm('Log off now?');\">"
236                 );
237                 if (ib_displayas != IB_TEXTONLY) {
238                 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
239                         "SRC=\"/static/exit-icon.gif\"><BR>");
240                 }
241                 if (ib_displayas != IB_PICONLY) {
242                         wprintf("Log off<BR>");
243                 }
244                 wprintf("</A></SPAN>\n");
245         }
246
247         wprintf(
248                 "<SPAN CLASS=\"customize\">"
249                 "<A HREF=\"/display_customize_iconbar\" "
250                 "TITLE=\"Customize this menu\" "
251                 "TARGET=\"workspace\">customize this menu</A>"
252                 "</SPAN><BR>\n"
253         );
254
255         if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
256                 "<SPAN CLASS=\"powered_by\">"
257                 "<A HREF=\"http://uncensored.citadel.org/citadel\" "
258                 "TITLE=\"Find out more about Citadel/UX\" TARGET=\"aboutcit\" "
259                 "onMouseOver=\"window.status='Find out more about "
260                 "Citadel/UX'; return true;\">powered by<BR><IMG "
261                 "BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
262                 "SRC=\"/static/citadel-logo.jpg\" ALT=\"CITADEL/UX\"></A>"
263                 "</SPAN>\n"
264         );
265
266         wprintf("</CENTER>\n");
267         do_template("endbox");
268         wDumpContent(2);
269 }
270
271
272
273 void display_customize_iconbar(void) {
274         char iconbar[SIZ];
275         char buf[SIZ];
276         char key[SIZ], value[SIZ];
277         int i;
278
279         /* The initialized values of these variables also happen to
280          * specify the default values for users who haven't customized
281          * their iconbars.  These should probably be set in a master
282          * configuration somewhere.
283          */
284         int ib_displayas = IB_PICTEXT;  /* pictures and text, pictures, text */
285         int ib_logo = 1;        /* Site logo */
286         int ib_summary = 0;     /* Summary page icon */
287         int ib_inbox = 0;       /* Inbox icon */
288         int ib_calendar = 0;    /* Calendar icon */
289         int ib_contacts = 0;    /* Contacts icon */
290         int ib_tasks = 0;       /* Tasks icon */
291         int ib_rooms = 1;       /* Rooms icon */
292         int ib_users = 1;       /* Users icon */
293         int ib_chat = 0;        /* Chat icon */
294         int ib_advanced = 1;    /* Advanced Options icon */
295         int ib_logoff = 1;      /* Logoff button */
296         int ib_citadel = 1;     /* 'Powered by Citadel' logo */
297         /*
298          */
299
300         get_preference("iconbar", iconbar);
301         for (i=0; i<num_tokens(iconbar, ','); ++i) {
302                 extract_token(buf, iconbar, i, ',');
303                 extract_token(key, buf, 0, '=');
304                 extract_token(value, buf, 1, '=');
305
306                 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
307                 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
308                 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
309                 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
310                 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
311                 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
312                 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
313                 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
314                 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
315                 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
316                 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
317                 if (!strcasecmp(key, "ib_logoff")) ib_logoff = atoi(value);
318                 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
319         }
320
321         output_headers(3);
322         svprintf("BOXTITLE", WCS_STRING, "Customize the icon bar");
323         do_template("beginbox");
324
325         wprintf("<FORM METHOD=\"POST\" ACTION=\"/commit_iconbar\">\n");
326
327         wprintf("<CENTER>"
328                 "Display icons as: ");
329         for (i=0; i<=2; ++i) {
330                 wprintf("<INPUT TYPE=\"radio\" NAME=\"ib_displayas\" VALUE=\"%d\"", i);
331                 if (ib_displayas == i) wprintf(" CHECKED");
332                 wprintf(">");
333                 if (i == IB_PICTEXT) wprintf("pictures and text");
334                 if (i == IB_PICONLY) wprintf("pictures only");
335                 if (i == IB_TEXTONLY) wprintf("text only");
336                 wprintf("\n");
337         }
338         wprintf("<BR><BR>\n");
339
340         wprintf("Select the icons you would like to see displayed "
341                 "in the &quot;icon bar&quot; menu on the left side of the "
342                 "screen.</CENTER><BR>\n"
343         );
344
345         wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
346
347         wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
348                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
349                 "</TD><TD>"
350                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
351                 "SRC=\"/image&name=hello\" ALT=\"&nbsp;\">"
352                 "</TD><TD>"
353                 "<B>Site logo</B><BR>"
354                 "A graphic describing this site"
355                 "</TD></TR>\n",
356                 (ib_logo ? "CHECKED" : "")
357         );
358
359         wprintf("<TR><TD>"
360                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
361                 "</TD><TD>"
362                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
363                 "SRC=\"/static/summary.gif\" ALT=\"&nbsp;\">"
364                 "</TD><TD>"
365                 "<B>Summary</B><BR>"
366                 "Your summary page"
367                 "</TD></TR>\n",
368                 (ib_summary ? "CHECKED" : "")
369         );
370
371         wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
372                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
373                 "</TD><TD>"
374                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
375                 "SRC=\"/static/mail.gif\" ALT=\"&nbsp;\">"
376                 "</TD><TD>"
377                 "<B>Mail (inbox)</B><BR>"
378                 "A shortcut to your e-mail Inbox."
379                 "</TD></TR>\n",
380                 (ib_inbox ? "CHECKED" : "")
381         );
382
383         wprintf("<TR><TD>"
384                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
385                 "VALUE=\"yes\" %s>"
386                 "</TD><TD>"
387                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
388                 "SRC=\"/static/vcard.gif\" ALT=\"&nbsp;\">"
389                 "</TD><TD>"
390                 "<B>Contacts</B><BR>"
391                 "Your personal address book."
392                 "</TD></TR>\n",
393                 (ib_contacts ? "CHECKED" : "")
394         );
395
396 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
397         wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
398                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
399                 "VALUE=\"yes\" %s>"
400                 "</TD><TD>"
401                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
402                 "SRC=\"/static/vcalendar.gif\" ALT=\"&nbsp;\">"
403                 "</TD><TD>"
404                 "<B>Calendar</B><BR>"
405                 "A shortcut to your personal calendar."
406                 "</TD></TR>\n",
407                 (ib_calendar ? "CHECKED" : "")
408         );
409
410         wprintf("<TR><TD>"
411                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
412                 "</TD><TD>"
413                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
414                 "SRC=\"/static/vcalendar.gif\" ALT=\"&nbsp;\">"
415                 "</TD><TD>"
416                 "<B>Tasks</B><BR>"
417                 "A shortcut to your personal task list."
418                 "</TD></TR>\n",
419                 (ib_tasks ? "CHECKED" : "")
420         );
421 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
422
423         wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
424                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
425                 "</TD><TD>"
426                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
427                 "SRC=\"/static/rooms-icon.gif\" ALT=\"&nbsp;\">"
428                 "</TD><TD>"
429                 "<B>Rooms</B><BR>"
430                 "Clicking this icon displays a list of all accesible "
431                 "rooms (or folders) available."
432                 "</TD></TR>\n",
433                 (ib_rooms ? "CHECKED" : "")
434         );
435
436         wprintf("<TR><TD>"
437                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
438                 "</TD><TD>"
439                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
440                 "SRC=\"/static/users-icon.gif\" ALT=\"&nbsp;\">"
441                 "</TD><TD>"
442                 "<B>Users</B><BR>"
443                 "Clicking this icon displays a list of all users "
444                 "currently logged in."
445                 "</TD></TR>\n",
446                 (ib_users ? "CHECKED" : "")
447         );
448
449         wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
450                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
451                 "</TD><TD>"
452                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
453                 "SRC=\"/static/chat-icon.gif\" ALT=\"&nbsp;\">"
454                 "</TD><TD>"
455                 "<B>Chat</B><BR>"
456                 "Clicking this icon enters real-time chat mode "
457                 "with other users in the same room."
458                 "</TD></TR>\n",
459                 (ib_chat ? "CHECKED" : "")
460         );
461
462         wprintf("<TR><TD>"
463                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
464                 "VALUE=\"yes\" %s>"
465                 "</TD><TD>"
466                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
467                 "SRC=\"/static/advanced-icon.gif\" ALT=\"&nbsp;\">"
468                 "</TD><TD>"
469                 "<B>Advanced options</B><BR>"
470                 "Access to the complete menu of Citadel functions."
471                 "</TD></TR>\n",
472                 (ib_advanced ? "CHECKED" : "")
473         );
474
475         wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
476                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logoff\" "
477                 "VALUE=\"yes\" %s>"
478                 "</TD><TD>"
479                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
480                 "SRC=\"/static/exit-icon.gif\" ALT=\"&nbsp;\">"
481                 "</TD><TD>"
482                 "<B>Log off</B><BR>"
483                 "Exit from the Citadel system.  If you remove this icon "
484                 "then you will have no way out!"
485                 "</TD></TR>\n",
486                 (ib_logoff ? "CHECKED" : "")
487         );
488         wprintf("<TR><TD>"
489                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
490                 "VALUE=\"yes\" %s>"
491                 "</TD><TD>"
492                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
493                 "SRC=\"/static/citadel-logo.jpg\" ALT=\"&nbsp;\">"
494                 "</TD><TD>"
495                 "<B>Citadel logo</B><BR>"
496                 "Displays the &quot;Powered by Citadel&quot; graphic"
497                 "</TD></TR>\n",
498                 (ib_citadel ? "CHECKED" : "")
499         );
500
501         wprintf("</TABLE><BR>\n"
502                 "<CENTER>"
503                 "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">"
504                 "&nbsp;"
505                 "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">"
506                 "</CENTER></FORM>\n"
507         );
508
509         do_template("endbox");
510         wDumpContent(2);
511 }
512
513
514 void commit_iconbar(void) {
515         char iconbar[SIZ];
516         int i;
517
518         char *boxen[] = {
519                 "ib_logo",
520                 "ib_summary",
521                 "ib_inbox",
522                 "ib_calendar",
523                 "ib_contacts",
524                 "ib_tasks",
525                 "ib_rooms",
526                 "ib_users",
527                 "ib_chat",
528                 "ib_advanced",
529                 "ib_logoff",
530                 "ib_citadel"
531         };
532
533         if (strcmp(bstr("sc"), "OK")) {
534                 display_main_menu();
535                 return;
536         }
537
538         sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
539
540         for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
541                 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
542                 if (!strcasecmp(bstr(boxen[i]), "yes")) {
543                         sprintf(&iconbar[strlen(iconbar)], "1");
544                 }
545                 else {
546                         sprintf(&iconbar[strlen(iconbar)], "0");
547                 }
548         }
549
550         set_preference("iconbar", iconbar);
551
552         output_headers(3);
553         do_template("beginbox_nt");
554         wprintf(
555                 "<IMG SRC=\"/static/advanced-icon.gif\" "
556                 "onLoad=\"javascript:top['iconbarframe'].location.reload();\">"
557                 "&nbsp;"
558                 "Your icon bar has been updated.  Please select any of its "
559                 "choices to continue.\n"
560         );
561         do_template("endbox");
562         wDumpContent(2);
563 }