* Moved to the new string tokenizer API
[citadel.git] / webcit / userlist.c
index d05e635a42f6484d69198b452afb9847359cf303..69a4c2e88b940dc5cc604773b8ecad1f781622d3 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * $Id$
+ *
+ * Display a list of all accounts on a Citadel system.
+ *
+ */
+
 #include <ctype.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -19,9 +26,6 @@
 #include <signal.h>
 #include "webcit.h"
 
-
-
-
 struct namelist {
        struct namelist *next;
        char name[32];
@@ -50,26 +54,30 @@ void userlist(void)
                        strcpy(bptr->name, buf);
                        bio = bptr;
                }
-       output_headers(3);
+       output_headers(1, 1, 2, 0, 0, 0, 0);
+       wprintf("<div id=\"banner\">\n"
+               "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
+               "<SPAN CLASS=\"titlebar\">User list for ");
+       escputs(serv_info.serv_humannode);
+       wprintf("</SPAN>"
+               "</TD></TR></TABLE>\n"
+               "</div>\n<div id=\"content\">\n"
+       );
 
        serv_puts("LIST");
        serv_gets(buf);
        if (buf[0] != '1') {
-               wprintf("<EM>%s</EM><BR>\n", &buf[4]);
+               wprintf("<EM>%s</EM><br />\n", &buf[4]);
                goto DONE;
        }
 
-       svprintf("BOXTITLE", WCS_STRING, "User list for %s",
-                       serv_info.serv_humannode);
-
-       do_template("beginbox");
-       wprintf("<CENTER>");
-       wprintf("<TABLE border=0 width=100%%>");
+       wprintf("<div id=\"fix_scrollbar_bug\">"
+               "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
        wprintf("<TR><TH>User Name</TH><TH>Number</TH><TH>Access Level</TH>");
-       wprintf("<TH>Last Call</TH><TH>Total Calls</TH><TH>Total Posts</TH></TR>\n");
+       wprintf("<TH>Last Login</TH><TH>Total Logins</TH><TH>Total Posts</TH></TR>\n");
 
        while (serv_gets(buf), strcmp(buf, "000")) {
-               extract(fl, buf, 0);
+               extract_token(fl, buf, 0, '|', sizeof fl);
                has_bio = 0;
                for (bptr = bio; bptr != NULL; bptr = bptr->next) {
                        if (!strcasecmp(fl, bptr->name))
@@ -103,9 +111,7 @@ void userlist(void)
                        extract_long(buf, 4), extract_long(buf, 5));
 
        }
-       wprintf("</TABLE>");
-       wprintf("</CENTER>\n");
-       do_template("endbox");
+       wprintf("</table></div>\n");
 DONE:  wDumpContent(1);
 }
 
@@ -119,12 +125,19 @@ void showuser(void)
        char buf[SIZ];
        int have_pic;
 
-       output_headers(3);
+       strcpy(who, bstr("who"));
 
-       svprintf("BOXTITLE", WCS_STRING, "User profile");
-       do_template("beginbox");
+       output_headers(1, 1, 2, 0, 0, 0, 0);
+       wprintf("<div id=\"banner\">\n"
+               "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
+               "<SPAN CLASS=\"titlebar\">User profile</SPAN>"
+               "</TD></TR></TABLE>\n"
+               "</div>\n<div id=\"content\">\n"
+       );
+
+       wprintf("<div id=\"fix_scrollbar_bug\">"
+               "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
 
-       strcpy(who, bstr("who"));
        serv_printf("OIMG _userpic_|%s", who);
        serv_gets(buf);
        if (buf[0] == '2') {
@@ -147,14 +160,15 @@ void showuser(void)
        if (buf[0] == '1') {
                fmout(NULL, "JUSTIFY");
        }
-       wprintf("<BR><A HREF=\"/display_page&recp=");
+       wprintf("<br /><A HREF=\"/display_page&recp=");
        urlescputs(who);
        wprintf("\">"
                "<IMG SRC=\"/static/page.gif\" ALIGN=MIDDLE BORDER=0>"
                "&nbsp;&nbsp;"
-               "Click here to page this user (send an instant message)"
-               "</A>\n");
+               "Click here to send an instant message to ");
+       escputs(who);
+       wprintf("</A>\n");
 
-       do_template("endbox");
+       wprintf("</td></tr></table></div>\n");
        wDumpContent(1);
 }