]> code.citadel.org Git - citadel.git/blobdiff - webcit/who.c
* Integrated the first batch of new icons.
[citadel.git] / webcit / who.c
index eed1403f21a5d2b4b3073ac9b308237f944363ac..6dd225f7c363d34b5765013d237f23f003c681cf 100644 (file)
@@ -35,8 +35,9 @@
  */
 void whobbs(void)
 {
-       char buf[SIZ], sess, user[SIZ], room[SIZ], host[SIZ],
+       char buf[SIZ], user[SIZ], room[SIZ], host[SIZ],
                realroom[SIZ], realhost[SIZ];
+       int sess;
        time_t last_activity;
        time_t now;
        int bg = 0;
@@ -52,7 +53,7 @@ void whobbs(void)
 
        wprintf("<div id=\"banner\">\n");
        wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>");
-       wprintf("<IMG SRC=\"/static/users-icon.gif\" ALT=\" \" ALIGN=MIDDLE>");
+       wprintf("<IMG SRC=\"/static/usermanag_48x.gif\" ALT=\" \" ALIGN=MIDDLE>");
        wprintf("<SPAN CLASS=\"titlebar\">&nbsp;Users currently on ");
        escputs(serv_info.serv_humannode);
        wprintf("</SPAN></TD><TD ALIGN=RIGHT>");
@@ -61,16 +62,16 @@ void whobbs(void)
        wprintf("</div>\n"
                "<div id=\"content\">\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("<div id=\"fix_scrollbar_bug\">"
+               "<table border=0 cellspacing=0 width=100%% bgcolor=\"#FFFFFF\">"
+               "<tr>\n");
+       wprintf("<TH COLSPAN=3>&nbsp;</TH>\n");
        wprintf("<TH>User Name</TH>\n");
        wprintf("<TH>Room</TH>");
        wprintf("<TH>From host</TH>\n</TR>\n");
 
        serv_puts("TIME");
-       serv_gets(buf);
+       serv_getln(buf, sizeof buf);
        if (buf[0] == '2') {
                now = extract_long(&buf[4], 0);
        }
@@ -79,15 +80,15 @@ void whobbs(void)
        }
 
        serv_puts("RWHO");
-       serv_gets(buf);
+       serv_getln(buf, sizeof buf);
        if (buf[0] == '1') {
-               while (serv_gets(buf), strcmp(buf, "000")) {
+               while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
                        sess = extract_int(buf, 0);
-                       extract(user, buf, 1);
-                       extract(room, buf, 2);
-                       extract(host, buf, 3);
-                       extract(realroom, buf, 9);
-                       extract(realhost, buf, 10);
+                       extract_token(user, buf, 1, '|', sizeof user);
+                       extract_token(room, buf, 2, '|', sizeof room);
+                       extract_token(host, buf, 3, '|', sizeof host);
+                       extract_token(realroom, buf, 9, '|', sizeof realroom);
+                       extract_token(realhost, buf, 10, '|', sizeof realhost);
                        last_activity = extract_long(buf, 5);
 
                        bg = 1 - bg;
@@ -96,17 +97,17 @@ void whobbs(void)
                        );
 
 
-                       wprintf("<TD>%d</TD><TD>", sess);
+                       wprintf("<td>");
                        if ((WC->is_aide) &&
                            (sess != WC->ctdl_pid)) {
                                wprintf(" <A HREF=\"/terminate_session&which_session=%d&session_owner=", sess);
                                urlescputs(user);
                                wprintf("\" onClick=\"return ConfirmKill();\" "
-                               ">(kill)</A>");
+                               ">[kill]</A>");
                        }
                        if (sess == WC->ctdl_pid) {
                                wprintf(" <A HREF=\"/edit_me\" "
-                                       ">(edit)</A>");
+                                       ">[edit]</A>");
                        }
                        wprintf("</TD>");
 
@@ -159,12 +160,12 @@ void whobbs(void)
                        wprintf("</TD>\n</TR>");
                }
        }
-       wprintf("</TABLE>\n"
+       wprintf("</TABLE></div>\n"
+               "<div align=center>"
                "Click on a name to read user info.  Click on "
                "<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");
+               "a page (instant message) to that user.</div>\n");
        wDumpContent(1);
 }
 
@@ -174,7 +175,7 @@ void terminate_session(void)
        char buf[SIZ];
 
        serv_printf("TERM %s", bstr("which_session"));
-       serv_gets(buf);
+       serv_getln(buf, sizeof buf);
        whobbs();
 }
 
@@ -188,15 +189,15 @@ void edit_me(void)
 
        if (!strcasecmp(bstr("sc"), "Change room name")) {
                serv_printf("RCHG %s", bstr("fake_roomname"));
-               serv_gets(buf);
+               serv_getln(buf, sizeof buf);
                http_redirect("/whobbs");
        } else if (!strcasecmp(bstr("sc"), "Change host name")) {
                serv_printf("HCHG %s", bstr("fake_hostname"));
-               serv_gets(buf);
+               serv_getln(buf, sizeof buf);
                http_redirect("/whobbs");
        } else if (!strcasecmp(bstr("sc"), "Change user name")) {
                serv_printf("UCHG %s", bstr("fake_username"));
-               serv_gets(buf);
+               serv_getln(buf, sizeof buf);
                http_redirect("/whobbs");
        } else if (!strcasecmp(bstr("sc"), "Cancel")) {
                http_redirect("/whobbs");