From 6aefa4e7ec12559226be6269a78631f93cfd8503 Mon Sep 17 00:00:00 2001 From: ptt Date: Mon, 14 Apr 2003 19:46:14 +0000 Subject: *** empty log message *** git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@794 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/web/mod_ptt.c | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/pttbbs/web/mod_ptt.c b/pttbbs/web/mod_ptt.c index d5606e9f..3c4309ed 100644 --- a/pttbbs/web/mod_ptt.c +++ b/pttbbs/web/mod_ptt.c @@ -63,6 +63,37 @@ static int xml_header(request_rec *r) ap_rprintf(r, " shm=\"%d\" \n", SHM->loaded ); ap_rprintf(r, " max_user=\"%d\" -->", SHM->max_user ); } +static int userlist(request_rec *r) +{ + int i,offset=0; + userinfo_t *ptr; + xml_header(r); + if (r->header_only) { + return OK; + } + if(r->args) offset=atoi(r->args); + if(offset<0 || offset>SHM->UTMPnumber)offset=0; + + ap_rprintf(r,""); + for(i=offset;iUTMPnumber && i<50+offset;i++) + { + ptr= (userinfo_t *)SHM->sorted[SHM->currsorted][0][i]; + if(!ptr || ptr->userid[0]==0 || ptr->invisible ) continue; + ap_rprintf(r,"\n"); + ap_rprintf(r," %d\n",i+1); + ap_rprintf(r," %d\n",SHM->UTMPnumber); + ap_rprintf(r," %d\n",ptr->uid); + ap_rprintf(r," %s\n",ptr->userid); + ap_rprintf(r," %s\n", + ap_escape_html(r->pool,ptr->username)); + ap_rprintf(r," %s\n",ptr->from); + ap_rprintf(r," %d\n",ptr->from_alias); + ap_rprintf(r," %d\n",ptr->mailalert); + ap_rprintf(r," %s\n",ap_escape_html(r->pool,ptr->mind)); + ap_rprintf(r,""); + } + ap_rprintf(r,""); +} static int showboard(request_rec *r, int id) { int i; @@ -151,7 +182,6 @@ static int showxml(request_rec *r) int bid=1; xml_header(r); if (r->header_only) { - ap_kill_timeout(r); return OK; } if(r->args) bid=atoi(r->args); @@ -176,7 +206,9 @@ static int ptt_handler(request_rec *r) if(!strncmp(r->unparsed_uri,"/menu",5)) showmenujs(r); - else + else if(!strncmp(r->unparsed_uri,"/userlist",9)) + userlist(r); + else showxml(r); ap_kill_timeout(r); -- cgit v1.2.3