]> code.citadel.org Git - citadel.git/blobdiff - webcit/who.c
* Finally tracked down the WC->vars heap corruption issue (for real this
[citadel.git] / webcit / who.c
index 7eb676c7f72a4c25b9c1a2b8c5974d32fa8d394a..0ccad321fc15b561bcaef6c731409021d978626b 100644 (file)
@@ -35,6 +35,7 @@ void whobbs(void)
                realroom[SIZ], realhost[SIZ];
        time_t last_activity;
        time_t now;
+       int bg = 0;
 
        output_headers(7);
 
@@ -45,16 +46,18 @@ void whobbs(void)
                "</SCRIPT>\n"
        );
 
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>");
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
        wprintf("<IMG SRC=\"/static/users-icon.gif\" ALT=\" \" ALIGN=MIDDLE>");
-       wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\">&nbsp;&nbsp;<B>Users currently on ");
+       wprintf("<SPAN CLASS=\"titlebar\">&nbsp;Users currently on ");
        escputs(serv_info.serv_humannode);
-       wprintf("</B></FONT></TD><TD>");
+       wprintf("</SPAN></TD><TD ALIGN=RIGHT>");
        offer_start_page();
-       wprintf("</TD></TR></TABLE>\n");
+       wprintf("</TD></TR></TABLE><BR>\n");
 
-       wprintf("<CENTER><TABLE BORDER=1 WIDTH=100%%>\n<TR>\n");
-       wprintf("<TH>Session ID</TH>\n");
+       do_template("beginbox_nt");
+       wprintf("<CENTER>"
+               "<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%%>\n<TR>\n");
+       wprintf("<TH COLSPAN=4>Session ID</TH>\n");
        wprintf("<TH>User Name</TH>\n");
        wprintf("<TH>Room</TH>");
        wprintf("<TH>From host</TH>\n</TR>\n");
@@ -80,28 +83,46 @@ void whobbs(void)
                        extract(realhost, buf, 10);
                        last_activity = extract_long(buf, 5);
 
-                       wprintf("<TR>\n\t<TD ALIGN=center>%d", sess);
+                       bg = 1 - bg;
+                       wprintf("<TR BGCOLOR=\"#%s\">",
+                               (bg ? "DDDDDD" : "FFFFFF")
+                       );
+
+
+                       wprintf("<TD>%d</TD><TD>", sess);
                        if ((WC->is_aide) &&
-                           (sess != serv_info.serv_pid)) {
+                           (sess != WC->ctdl_pid)) {
                                wprintf(" <A HREF=\"/terminate_session&which_session=%d&session_owner=", sess);
                                urlescputs(user);
                                wprintf("\" onClick=\"return ConfirmKill();\" "
                                ">(kill)</A>");
                        }
-                       if (sess == serv_info.serv_pid) {
+                       if (sess == WC->ctdl_pid) {
                                wprintf(" <A HREF=\"/edit_me\" "
                                        ">(edit)</A>");
                        }
-                       wprintf("</TD>\n\t<TD>");
+                       wprintf("</TD>");
 
                        /* (link to page this user) */
-                       wprintf("<A HREF=\"/display_page&recp=");
+                       wprintf("<TD><A HREF=\"/display_page&recp=");
                        urlescputs(user);
                        wprintf("\">"
                                "<IMG ALIGN=MIDDLE WIDTH=20 HEIGHT=15 "
                                "SRC=\"/static/page.gif\" "
                                "ALT=\"(p)\""
                                " BORDER=0></A>&nbsp;");
+                       wprintf("</TD>");
+
+                       /* (idle flag) */
+                       wprintf("<TD>");
+                       if ((now - last_activity) > 900L) {
+                               wprintf("&nbsp;"
+                                       "<IMG ALIGN=MIDDLE "
+                                       "SRC=\"/static/idle.gif\" "
+                                       "ALT=\"[idle]\" BORDER=0>");
+                       }
+                       wprintf("</TD>\n\t<TD>");
+
 
 
                        /* username (link to user bio/photo page) */
@@ -111,13 +132,6 @@ void whobbs(void)
                        escputs(user);
                        wprintf("</A>");
 
-                       if ((now - last_activity) > 900L) {
-                               wprintf("&nbsp;"
-                                       "<IMG ALIGN=MIDDLE "
-                                       "SRC=\"/static/idle.gif\" "
-                                       "ALT=\"[idle]\" BORDER=0>");
-                       }
-
                        /* room */
                        wprintf("</TD>\n\t<TD>");
                        escputs(room);
@@ -143,6 +157,7 @@ void whobbs(void)
                "<IMG ALIGN=MIDDLE SRC=\"/static/page.gif\" ALT=\"(p)\" "
                "BORDER=0> to send "
                "a page (instant message) to that user.<BR></CENTER>\n");
+       do_template("endbox");
        wDumpContent(1);
 }
 
@@ -182,10 +197,10 @@ void edit_me(void)
 
                output_headers(3);
 
-               wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=000077><TR><TD>");
-               wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"><B>");
+               wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
+               wprintf("<SPAN CLASS=\"titlebar\">");
                wprintf("Edit your session display");
-               wprintf("</B></FONT></TD></TR></TABLE>\n");
+               wprintf("</SPAN></TD></TR></TABLE>\n");
                wprintf("This screen allows you to change the way your\n");
                wprintf("session appears in the 'Who is online' listing.\n");
                wprintf("To turn off any 'fake' name you've previously\n");