* Chat now appears in a separate window
[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=\"#\" onClick=\"window.open('/chat', "
203                         "'ctdl_chat_window', "
204                         "'toolbar=no,location=no,directories=no,copyhistory=no,"
205                         "status=no,scrollbars=yes,resizable=yes');\""
206                         ">"
207                 );
208                 if (ib_displayas != IB_TEXTONLY) {
209                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
210                         "SRC=\"/static/chat-icon.gif\"><BR>");
211                 }
212                 if (ib_displayas != IB_PICONLY) {
213                         wprintf("Chat<BR>");
214                 }
215                 wprintf("</A></SPAN>\n");
216         }
217
218         if (ib_advanced) {
219                 wprintf("<SPAN CLASS=\"iconbar_link\">"
220                         "<A HREF=\"/display_main_menu\" "
221                         "TITLE=\"Advanced Options Menu: Advanced Room commands, "
222                         "Account Info, and Chat\" "
223                         "TARGET=\"workspace\">"
224                 );
225                 if (ib_displayas != IB_TEXTONLY) {
226                         wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
227                         "SRC=\"/static/advanced-icon.gif\"><BR>");
228                 }
229                 if (ib_displayas != IB_PICONLY) {
230                         wprintf("Advanced options<BR>");
231                 }
232                 wprintf("</A></SPAN>\n");
233         }
234
235         if (ib_logoff) {
236                 wprintf("<SPAN CLASS=\"iconbar_link\">"
237                         "<A HREF=\"/termquit\" TITLE=\"Log off\" TARGET=\"_top\" "
238                         "onClick=\"return confirm('Log off now?');\">"
239                 );
240                 if (ib_displayas != IB_TEXTONLY) {
241                 wprintf("<IMG BORDER=\"0\" WIDTH=\"32\" HEIGHT=\"32\" "
242                         "SRC=\"/static/exit-icon.gif\"><BR>");
243                 }
244                 if (ib_displayas != IB_PICONLY) {
245                         wprintf("Log off<BR>");
246                 }
247                 wprintf("</A></SPAN>\n");
248         }
249
250         wprintf(
251                 "<SPAN CLASS=\"customize\">"
252                 "<A HREF=\"/display_customize_iconbar\" "
253                 "TITLE=\"Customize this menu\" "
254                 "TARGET=\"workspace\">customize this menu</A>"
255                 "</SPAN><BR>\n"
256         );
257
258         if (ib_citadel) if (ib_displayas != IB_TEXTONLY) wprintf(
259                 "<SPAN CLASS=\"powered_by\">"
260                 "<A HREF=\"http://uncensored.citadel.org/citadel\" "
261                 "TITLE=\"Find out more about Citadel/UX\" TARGET=\"aboutcit\" "
262                 "onMouseOver=\"window.status='Find out more about "
263                 "Citadel/UX'; return true;\">powered by<BR><IMG "
264                 "BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
265                 "SRC=\"/static/citadel-logo.jpg\" ALT=\"CITADEL/UX\"></A>"
266                 "</SPAN>\n"
267         );
268
269         wprintf("</CENTER>\n");
270         do_template("endbox");
271         wDumpContent(2);
272 }
273
274
275
276 void display_customize_iconbar(void) {
277         char iconbar[SIZ];
278         char buf[SIZ];
279         char key[SIZ], value[SIZ];
280         int i;
281
282         /* The initialized values of these variables also happen to
283          * specify the default values for users who haven't customized
284          * their iconbars.  These should probably be set in a master
285          * configuration somewhere.
286          */
287         int ib_displayas = IB_PICTEXT;  /* pictures and text, pictures, text */
288         int ib_logo = 1;        /* Site logo */
289         int ib_summary = 0;     /* Summary page icon */
290         int ib_inbox = 0;       /* Inbox icon */
291         int ib_calendar = 0;    /* Calendar icon */
292         int ib_contacts = 0;    /* Contacts icon */
293         int ib_tasks = 0;       /* Tasks icon */
294         int ib_rooms = 1;       /* Rooms icon */
295         int ib_users = 1;       /* Users icon */
296         int ib_chat = 0;        /* Chat icon */
297         int ib_advanced = 1;    /* Advanced Options icon */
298         int ib_logoff = 1;      /* Logoff button */
299         int ib_citadel = 1;     /* 'Powered by Citadel' logo */
300         /*
301          */
302
303         get_preference("iconbar", iconbar);
304         for (i=0; i<num_tokens(iconbar, ','); ++i) {
305                 extract_token(buf, iconbar, i, ',');
306                 extract_token(key, buf, 0, '=');
307                 extract_token(value, buf, 1, '=');
308
309                 if (!strcasecmp(key, "ib_displayas")) ib_displayas = atoi(value);
310                 if (!strcasecmp(key, "ib_logo")) ib_logo = atoi(value);
311                 if (!strcasecmp(key, "ib_summary")) ib_summary = atoi(value);
312                 if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
313                 if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
314                 if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
315                 if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
316                 if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
317                 if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
318                 if (!strcasecmp(key, "ib_chat")) ib_chat = atoi(value);
319                 if (!strcasecmp(key, "ib_advanced")) ib_advanced = atoi(value);
320                 if (!strcasecmp(key, "ib_logoff")) ib_logoff = atoi(value);
321                 if (!strcasecmp(key, "ib_citadel")) ib_citadel = atoi(value);
322         }
323
324         output_headers(3);
325         svprintf("BOXTITLE", WCS_STRING, "Customize the icon bar");
326         do_template("beginbox");
327
328         wprintf("<FORM METHOD=\"POST\" ACTION=\"/commit_iconbar\">\n");
329
330         wprintf("<CENTER>"
331                 "Display icons as: ");
332         for (i=0; i<=2; ++i) {
333                 wprintf("<INPUT TYPE=\"radio\" NAME=\"ib_displayas\" VALUE=\"%d\"", i);
334                 if (ib_displayas == i) wprintf(" CHECKED");
335                 wprintf(">");
336                 if (i == IB_PICTEXT) wprintf("pictures and text");
337                 if (i == IB_PICONLY) wprintf("pictures only");
338                 if (i == IB_TEXTONLY) wprintf("text only");
339                 wprintf("\n");
340         }
341         wprintf("<BR><BR>\n");
342
343         wprintf("Select the icons you would like to see displayed "
344                 "in the &quot;icon bar&quot; menu on the left side of the "
345                 "screen.</CENTER><BR>\n"
346         );
347
348         wprintf("<TABLE border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
349
350         wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
351                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logo\" VALUE=\"yes\" %s>"
352                 "</TD><TD>"
353                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
354                 "SRC=\"/image&name=hello\" ALT=\"&nbsp;\">"
355                 "</TD><TD>"
356                 "<B>Site logo</B><BR>"
357                 "A graphic describing this site"
358                 "</TD></TR>\n",
359                 (ib_logo ? "CHECKED" : "")
360         );
361
362         wprintf("<TR><TD>"
363                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_summary\" VALUE=\"yes\" %s>"
364                 "</TD><TD>"
365                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
366                 "SRC=\"/static/summary.gif\" ALT=\"&nbsp;\">"
367                 "</TD><TD>"
368                 "<B>Summary</B><BR>"
369                 "Your summary page"
370                 "</TD></TR>\n",
371                 (ib_summary ? "CHECKED" : "")
372         );
373
374         wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
375                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_inbox\" VALUE=\"yes\" %s>"
376                 "</TD><TD>"
377                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
378                 "SRC=\"/static/mail.gif\" ALT=\"&nbsp;\">"
379                 "</TD><TD>"
380                 "<B>Mail (inbox)</B><BR>"
381                 "A shortcut to your e-mail Inbox."
382                 "</TD></TR>\n",
383                 (ib_inbox ? "CHECKED" : "")
384         );
385
386         wprintf("<TR><TD>"
387                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_contacts\" "
388                 "VALUE=\"yes\" %s>"
389                 "</TD><TD>"
390                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
391                 "SRC=\"/static/vcard.gif\" ALT=\"&nbsp;\">"
392                 "</TD><TD>"
393                 "<B>Contacts</B><BR>"
394                 "Your personal address book."
395                 "</TD></TR>\n",
396                 (ib_contacts ? "CHECKED" : "")
397         );
398
399 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
400         wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
401                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_calendar\" "
402                 "VALUE=\"yes\" %s>"
403                 "</TD><TD>"
404                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
405                 "SRC=\"/static/vcalendar.gif\" ALT=\"&nbsp;\">"
406                 "</TD><TD>"
407                 "<B>Calendar</B><BR>"
408                 "A shortcut to your personal calendar."
409                 "</TD></TR>\n",
410                 (ib_calendar ? "CHECKED" : "")
411         );
412
413         wprintf("<TR><TD>"
414                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_tasks\" VALUE=\"yes\" %s>"
415                 "</TD><TD>"
416                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
417                 "SRC=\"/static/vcalendar.gif\" ALT=\"&nbsp;\">"
418                 "</TD><TD>"
419                 "<B>Tasks</B><BR>"
420                 "A shortcut to your personal task list."
421                 "</TD></TR>\n",
422                 (ib_tasks ? "CHECKED" : "")
423         );
424 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
425
426         wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
427                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_rooms\" VALUE=\"yes\" %s>"
428                 "</TD><TD>"
429                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
430                 "SRC=\"/static/rooms-icon.gif\" ALT=\"&nbsp;\">"
431                 "</TD><TD>"
432                 "<B>Rooms</B><BR>"
433                 "Clicking this icon displays a list of all accesible "
434                 "rooms (or folders) available."
435                 "</TD></TR>\n",
436                 (ib_rooms ? "CHECKED" : "")
437         );
438
439         wprintf("<TR><TD>"
440                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_users\" VALUE=\"yes\" %s>"
441                 "</TD><TD>"
442                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
443                 "SRC=\"/static/users-icon.gif\" ALT=\"&nbsp;\">"
444                 "</TD><TD>"
445                 "<B>Users</B><BR>"
446                 "Clicking this icon displays a list of all users "
447                 "currently logged in."
448                 "</TD></TR>\n",
449                 (ib_users ? "CHECKED" : "")
450         );
451
452         wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
453                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_chat\" VALUE=\"yes\" %s>"
454                 "</TD><TD>"
455                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
456                 "SRC=\"/static/chat-icon.gif\" ALT=\"&nbsp;\">"
457                 "</TD><TD>"
458                 "<B>Chat</B><BR>"
459                 "Clicking this icon enters real-time chat mode "
460                 "with other users in the same room."
461                 "</TD></TR>\n",
462                 (ib_chat ? "CHECKED" : "")
463         );
464
465         wprintf("<TR><TD>"
466                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_advanced\" "
467                 "VALUE=\"yes\" %s>"
468                 "</TD><TD>"
469                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
470                 "SRC=\"/static/advanced-icon.gif\" ALT=\"&nbsp;\">"
471                 "</TD><TD>"
472                 "<B>Advanced options</B><BR>"
473                 "Access to the complete menu of Citadel functions."
474                 "</TD></TR>\n",
475                 (ib_advanced ? "CHECKED" : "")
476         );
477
478         wprintf("<TR BGCOLOR=\"#CCCCCC\"><TD>"
479                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_logoff\" "
480                 "VALUE=\"yes\" %s>"
481                 "</TD><TD>"
482                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
483                 "SRC=\"/static/exit-icon.gif\" ALT=\"&nbsp;\">"
484                 "</TD><TD>"
485                 "<B>Log off</B><BR>"
486                 "Exit from the Citadel system.  If you remove this icon "
487                 "then you will have no way out!"
488                 "</TD></TR>\n",
489                 (ib_logoff ? "CHECKED" : "")
490         );
491         wprintf("<TR><TD>"
492                 "<INPUT TYPE=\"checkbox\" NAME=\"ib_citadel\" "
493                 "VALUE=\"yes\" %s>"
494                 "</TD><TD>"
495                 "<IMG BORDER=\"0\" WIDTH=\"48\" HEIGHT=\"48\" "
496                 "SRC=\"/static/citadel-logo.jpg\" ALT=\"&nbsp;\">"
497                 "</TD><TD>"
498                 "<B>Citadel logo</B><BR>"
499                 "Displays the &quot;Powered by Citadel&quot; graphic"
500                 "</TD></TR>\n",
501                 (ib_citadel ? "CHECKED" : "")
502         );
503
504         wprintf("</TABLE><BR>\n"
505                 "<CENTER>"
506                 "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">"
507                 "&nbsp;"
508                 "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">"
509                 "</CENTER></FORM>\n"
510         );
511
512         do_template("endbox");
513         wDumpContent(2);
514 }
515
516
517 void commit_iconbar(void) {
518         char iconbar[SIZ];
519         int i;
520
521         char *boxen[] = {
522                 "ib_logo",
523                 "ib_summary",
524                 "ib_inbox",
525                 "ib_calendar",
526                 "ib_contacts",
527                 "ib_tasks",
528                 "ib_rooms",
529                 "ib_users",
530                 "ib_chat",
531                 "ib_advanced",
532                 "ib_logoff",
533                 "ib_citadel"
534         };
535
536         if (strcmp(bstr("sc"), "OK")) {
537                 display_main_menu();
538                 return;
539         }
540
541         sprintf(iconbar, "ib_displayas=%d", atoi(bstr("ib_displayas")));
542
543         for (i=0; i<(sizeof(boxen)/sizeof(char *)); ++i) {
544                 sprintf(&iconbar[strlen(iconbar)], ",%s=", boxen[i]);
545                 if (!strcasecmp(bstr(boxen[i]), "yes")) {
546                         sprintf(&iconbar[strlen(iconbar)], "1");
547                 }
548                 else {
549                         sprintf(&iconbar[strlen(iconbar)], "0");
550                 }
551         }
552
553         set_preference("iconbar", iconbar);
554
555         output_headers(3);
556         do_template("beginbox_nt");
557         wprintf(
558                 "<IMG SRC=\"/static/advanced-icon.gif\" "
559                 "onLoad=\"javascript:top['iconbarframe'].location.reload();\">"
560                 "&nbsp;"
561                 "Your icon bar has been updated.  Please select any of its "
562                 "choices to continue.\n"
563         );
564         do_template("endbox");
565         wDumpContent(2);
566 }