]> code.citadel.org Git - citadel.git/blobdiff - webcit/userlist.c
* Cleaned up the rcs/cvs Id tags and leading comments at the top of some files
[citadel.git] / webcit / userlist.c
index 8fd97db3538772189e4f33c83c35cfe44b58d9e1..217c58bb744dd97bc58dc19e372ef75bfc5ff095 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];
@@ -39,6 +43,7 @@ void userlist(void)
        struct namelist *bio = NULL;
        struct namelist *bptr;
        int has_bio;
+       int bg = 0;
 
        serv_puts("LBIO");
        serv_gets(buf);
@@ -49,23 +54,23 @@ void userlist(void)
                        strcpy(bptr->name, buf);
                        bio = bptr;
                }
-       output_headers(1);
+       output_headers(1, 1, 0, 0, 0, 0, 0);
 
        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;
        }
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>");
-       wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
-       wprintf("<B>User list for ");
-       escputs(serv_info.serv_humannode);
-       wprintf("</B></FONT></TD></TR></TABLE>\n");
 
-       wprintf("<CENTER><TABLE border>");
+       svprintf("BOXTITLE", WCS_STRING, "User list for %s",
+                       serv_info.serv_humannode);
+
+       do_template("beginbox");
+       wprintf("<CENTER>");
+       wprintf("<TABLE border=0 width=100%%>");
        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);
@@ -74,7 +79,10 @@ void userlist(void)
                        if (!strcasecmp(fl, bptr->name))
                                has_bio = 1;
                }
-               wprintf("<TR><TD>");
+               bg = 1 - bg;
+               wprintf("<TR BGCOLOR=\"#%s\"><TD>",
+                       (bg ? "DDDDDD" : "FFFFFF")
+               );
                if (has_bio) {
                        wprintf("<A HREF=\"/showuser&who=");
                        urlescputs(fl);
@@ -99,8 +107,10 @@ void userlist(void)
                        extract_long(buf, 4), extract_long(buf, 5));
 
        }
-       wprintf("</TABLE></CENTER>\n");
-      DONE:wDumpContent(1);
+       wprintf("</TABLE>");
+       wprintf("</CENTER>\n");
+       do_template("endbox");
+DONE:  wDumpContent(1);
 }
 
 
@@ -113,12 +123,10 @@ void showuser(void)
        char buf[SIZ];
        int have_pic;
 
-       output_headers(1);
+       output_headers(1, 1, 0, 0, 0, 0, 0);
 
-
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>");
-       wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"<B>User profile");
-       wprintf("</B></FONT></TD></TR></TABLE>\n");
+       svprintf("BOXTITLE", WCS_STRING, "User profile");
+       do_template("beginbox");
 
        strcpy(who, bstr("who"));
        serv_printf("OIMG _userpic_|%s", who);
@@ -141,14 +149,16 @@ void showuser(void)
        serv_printf("RBIO %s", who);
        serv_gets(buf);
        if (buf[0] == '1') {
-               fmout(NULL);
+               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");
+
+       do_template("endbox");
        wDumpContent(1);
 }