X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fuserlist.c;h=1f6642f924a095dcf72cba3d4212814a84800433;hb=c90b9009ad3b2411389d3dad969c19ec17688268;hp=bfa2fc70c3bb606504ebe9956830d1092603881c;hpb=05b7980adba4f517c3fc30d3ce97adb5c337c750;p=citadel.git diff --git a/webcit/userlist.c b/webcit/userlist.c index bfa2fc70c..1f6642f92 100644 --- a/webcit/userlist.c +++ b/webcit/userlist.c @@ -12,12 +12,13 @@ struct namelist { struct namelist *next; char name[32]; - }; +}; /* * display the userlist */ -void userlist(void) { +void userlist(void) +{ char buf[256]; char fl[256]; struct tm *tmbuf; @@ -28,41 +29,39 @@ void userlist(void) { serv_puts("LBIO"); serv_gets(buf); - if (buf[0]=='1') while (serv_gets(buf), strcmp(buf,"000")) { - bptr = (struct namelist *) malloc(sizeof(struct namelist)); - bptr->next = bio; - strcpy(bptr->name, buf); - bio = bptr; + if (buf[0] == '1') + while (serv_gets(buf), strcmp(buf, "000")) { + bptr = (struct namelist *) malloc(sizeof(struct namelist)); + bptr->next = bio; + strcpy(bptr->name, buf); + bio = bptr; } - - - printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + printf("HTTP/1.0 200 OK\n"); + output_headers(1, "bottom"); serv_puts("LIST"); serv_gets(buf); - if (buf[0]!='1') { - wprintf("%s
\n",&buf[4]); + if (buf[0] != '1') { + wprintf("%s
\n", &buf[4]); goto DONE; - } - - - wprintf("
"); - wprintf("User list for "); + } + wprintf("
"); + wprintf("User list for "); escputs(serv_info.serv_humannode); - wprintf("
\n"); + wprintf("
\n"); wprintf("
"); wprintf(""); wprintf("\n"); - while (serv_gets(buf), strcmp(buf,"000")) { - extract(fl,buf,0); + while (serv_gets(buf), strcmp(buf, "000")) { + extract(fl, buf, 0); has_bio = 0; - for (bptr=bio; bptr!=NULL; bptr=bptr->next) { - if (!strcasecmp(fl,bptr->name)) has_bio = 1; - } + for (bptr = bio; bptr != NULL; bptr = bptr->next) { + if (!strcasecmp(fl, bptr->name)) + has_bio = 1; + } wprintf("\n", - extract_long(buf,4),extract_long(buf,5)); + extract_long(buf, 4), extract_long(buf, 5)); - } - wprintf("
User NameNumberAccess LevelLast CallTotal CallsTotal Posts
"); if (has_bio) { wprintf(""); escputs(fl); wprintf(""); - } - else { + } else { escputs(fl); - } + } wprintf("%ld%d", - extract_long(buf,2), - extract_int(buf,1)); - lc = extract_long(buf,3); - tmbuf = (struct tm *)localtime(&lc); + extract_long(buf, 2), + extract_int(buf, 1)); + lc = extract_long(buf, 3); + tmbuf = (struct tm *) localtime(&lc); wprintf("%02d/%02d/%04d ", - (tmbuf->tm_mon+1), + (tmbuf->tm_mon + 1), tmbuf->tm_mday, (tmbuf->tm_year + 1900)); - + wprintf("%ld%5ld
\n"); -DONE: wDumpContent(1); } + wprintf("\n"); + DONE:wDumpContent(1); +} /* * Display (non confidential) information about a particular user */ -void showuser(void) { +void showuser(void) +{ char who[256]; char buf[256]; int have_pic; - printf("HTTP/1.0 200 OK\n"); - output_headers(1, "bottom"); + printf("HTTP/1.0 200 OK\n"); + output_headers(1, "bottom"); - wprintf("
"); - wprintf("User profile"); - wprintf("
\n"); + wprintf("
"); + wprintf("User profile"); + wprintf("
\n"); strcpy(who, bstr("who")); serv_printf("OIMG _userpic_|%s", who); serv_gets(buf); - if (buf[0]=='2') { + if (buf[0] == '2') { have_pic = 1; serv_puts("CLOS"); serv_gets(buf); - } - else { + } else { have_pic = 0; - } + } wprintf("
"); if (have_pic == 1) { wprintf(""); - } - wprintf("

%s

\n",who); - serv_printf("RBIO %s",who); - serv_gets(buf); - if (buf[0]=='1') fmout(NULL); - wDumpContent(1); } + wprintf("

%s

\n", who); + serv_printf("RBIO %s", who); + serv_gets(buf); + if (buf[0] == '1') + fmout(NULL); + wDumpContent(1); +}