]> code.citadel.org Git - citadel.git/blobdiff - webcit/userlist.c
* Brought over the newer string tokenizer from Citadel
[citadel.git] / webcit / userlist.c
index 1f6642f924a095dcf72cba3d4212814a84800433..8fd97db3538772189e4f33c83c35cfe44b58d9e1 100644 (file)
@@ -1,13 +1,26 @@
+#include <ctype.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
+#include <fcntl.h>
 #include <signal.h>
 #include <sys/types.h>
-#include <ctype.h>
+#include <sys/wait.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <limits.h>
+#include <netinet/in.h>
+#include <netdb.h>
 #include <string.h>
-#include <time.h>
+#include <pwd.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <pthread.h>
+#include <signal.h>
 #include "webcit.h"
-#include "child.h"
+
+
+
 
 struct namelist {
        struct namelist *next;
@@ -19,8 +32,8 @@ struct namelist {
  */
 void userlist(void)
 {
-       char buf[256];
-       char fl[256];
+       char buf[SIZ];
+       char fl[SIZ];
        struct tm *tmbuf;
        long lc;
        struct namelist *bio = NULL;
@@ -36,8 +49,7 @@ void userlist(void)
                        strcpy(bptr->name, buf);
                        bio = bptr;
                }
-       printf("HTTP/1.0 200 OK\n");
-       output_headers(1, "bottom");
+       output_headers(1);
 
        serv_puts("LIST");
        serv_gets(buf);
@@ -45,7 +57,7 @@ void userlist(void)
                wprintf("<EM>%s</EM><BR>\n", &buf[4]);
                goto DONE;
        }
-       wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
+       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);
@@ -97,15 +109,14 @@ void userlist(void)
  */
 void showuser(void)
 {
-       char who[256];
-       char buf[256];
+       char who[SIZ];
+       char buf[SIZ];
        int have_pic;
 
-       printf("HTTP/1.0 200 OK\n");
-       output_headers(1, "bottom");
+       output_headers(1);
 
 
-       wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=007700><TR><TD>");
+       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");
 
@@ -129,7 +140,15 @@ void showuser(void)
        wprintf("</TD><TD><H1>%s</H1></TD></TR></TABLE></CENTER>\n", who);
        serv_printf("RBIO %s", who);
        serv_gets(buf);
-       if (buf[0] == '1')
+       if (buf[0] == '1') {
                fmout(NULL);
+       }
+       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");
        wDumpContent(1);
 }