]>
git.ipfire.org Git - thirdparty/sarg.git/blob - topuser.c
2 * AUTHOR: Pedro Lineu Orso orso@penguintech.com.br
4 * SARG Squid Analysis Report Generator http://sarg.sourceforge.net
7 * please look at http://sarg.sourceforge.net/donations.php
8 * ---------------------------------------------------------------------
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
26 #include "include/conf.h"
31 FILE *fp_in
= NULL
, *fp_ou
= NULL
, *fp_top1
= NULL
, *fp_top2
= NULL
, *fp_top3
= NULL
;
32 long long int ttnbytes
=0, ttnacc
=0, tnacc
=0;
33 long long int tnbytes
=0, ttnelap
=0, tnelap
=0;
34 long long int tnincache
=0, tnoucache
=0, ttnincache
=0, ttnoucache
=0;
37 float inperc
=0.00, ouperc
=0.00;
39 char olduser
[MAXLEN
], csort
[MAXLEN
], periodo
[MAXLEN
], arqper
[MAXLEN
];
40 char wger
[MAXLEN
], top1
[MAXLEN
], top2
[MAXLEN
], top3
[MAXLEN
];
41 char user
[MAXLEN
], nacc
[20], nbytes
[20], preg
[MAXLEN
], tusr
[MAXLEN
];
42 char ip
[MAXLEN
], hora
[9], data
[11], elap
[15], incac
[15], oucac
[15], html
[MAXLEN
];
43 char ipantes
[MAXLEN
], nameantes
[MAXLEN
];
44 char sfield
[10]="2,2";
60 strcat(wger
,"/geral");
62 strcat(top2
,"/top.tmp");
63 strcat(tusr
,"/users");
64 strcat(top3
,"/index.html");
66 if((fp_in
=fopen(wger
,"r"))==NULL
) {
67 fprintf(stderr
, "SARG: (topuser) %s: %s\n",text
[45],wger
);
71 if((fp_top2
=fopen(top2
,"w"))==NULL
) {
72 fprintf(stderr
, "SARG: (topuser) %s: %s\n",text
[45],top2
);
76 fscanf(fp_in
,"%s",user
);
77 fscanf(fp_in
,"%s",nacc
);
78 fscanf(fp_in
,"%s",nbytes
);
79 fscanf(fp_in
,"%s",url
);
80 fscanf(fp_in
,"%s",ip
);
81 fscanf(fp_in
,"%s",hora
);
82 fscanf(fp_in
,"%s",data
);
83 fscanf(fp_in
,"%s",elap
);
84 fscanf(fp_in
,"%s",incac
);
85 fscanf(fp_in
,"%s",oucac
);
91 if(strcmp(olduser
,user
) != 0) {
92 if(strcmp(user
,"TOTAL") != 0)
95 my_lltoa(tnbytes
,val1
,15);
96 my_lltoa(tnacc
,val2
,15);
97 my_lltoa(tnelap
,val3
,15);
98 my_lltoa(tnincache
,val4
,15);
99 my_lltoa(tnoucache
,val5
,15);
100 sprintf(preg
,"%s %s %s %s %s %s\n",olduser
,val1
,val2
,val3
,val4
,val5
);
103 strcpy(olduser
,user
);
107 ttnincache
+=tnincache
;
108 ttnoucache
+=tnoucache
;
116 tnbytes
+=my_atoll(nbytes
);
117 tnacc
+=my_atoll(nacc
);
118 tnelap
+=my_atoll(elap
);
119 tnincache
+=my_atoll(incac
);
120 tnoucache
+=my_atoll(oucac
);
122 fscanf(fp_in
,"%s",user
);
123 fscanf(fp_in
,"%s",nacc
);
124 fscanf(fp_in
,"%s",nbytes
);
125 fscanf(fp_in
,"%s",url
);
126 fscanf(fp_in
,"%s",ip
);
127 fscanf(fp_in
,"%s",hora
);
128 fscanf(fp_in
,"%s",data
);
129 fscanf(fp_in
,"%s",elap
);
130 fscanf(fp_in
,"%s",incac
);
131 fscanf(fp_in
,"%s",oucac
);
133 if(strcmp(user
,"TOTAL") == 0)
137 my_lltoa(tnbytes
,val1
,15);
138 my_lltoa(tnacc
,val2
,15);
139 my_lltoa(tnelap
,val3
,15);
140 my_lltoa(tnincache
,val4
,15);
141 my_lltoa(tnoucache
,val5
,15);
142 sprintf(preg
,"%s %s %s %s %s %s\n",olduser
,val1
,val2
,val3
,val4
,val5
);
148 ttnincache
+=tnincache
;
149 ttnoucache
+=tnoucache
;
151 my_lltoa(ttnbytes
,val1
,15);
152 my_lltoa(ttnacc
,val2
,15);
153 my_lltoa(ttnelap
,val3
,15);
154 my_lltoa(ttnincache
,val4
,15);
155 my_lltoa(ttnoucache
,val5
,15);
156 sprintf(preg
,"TOTAL %s %s %s %s %s\n",val1
,val2
,val3
,val4
,val5
);
157 if (fp_in
) fclose(fp_in
);
158 if (fp_top2
) fclose(fp_top2
);
160 strup(TopuserSortField
);
161 strlow(TopuserSortOrder
);
163 if(strcmp(TopuserSortField
,"USER") == 0)
164 strcpy(sfield
,"1,1");
166 if(strcmp(TopuserSortField
,"CONNECT") == 0)
167 strcpy(sfield
,"3,3");
169 if(strcmp(TopuserSortField
,"TIME") == 0)
170 strcpy(sfield
,"4,4");
172 if(strcmp(TopuserSortOrder
,"normal") == 0)
175 sprintf(csort
,"sort -n -T %s %s -k %s -o '%s' '%s'", TempDir
, order
, sfield
, top1
, top2
);
180 if((fp_top1
=fopen(top1
,"a"))==NULL
) {
181 fprintf(stderr
, "SARG: (topuser) %s: %s\n",text
[45],top1
);
187 if((fp_top1
=fopen(top1
,"r"))==NULL
) {
188 fprintf(stderr
, "SARG: (topuser) %s: %s\n",text
[45],top1
);
192 if((fp_top3
=fopen(top3
,"w"))==NULL
) {
193 fprintf(stderr
, "SARG: (topuser) %s: %s\n",text
[45],top3
);
201 strcpy(arqper
,dirname
);
202 strcat(arqper
,"/periodo");
204 if ((fp_in
= fopen(arqper
, "r")) == 0) {
205 fprintf(stderr
, "SARG: (topuser) %s: %s\n",text
[45],arqper
);
209 fgets(periodo
,sizeof(periodo
),fp_in
);
212 fputs("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"",fp_top3
);
213 fputs(" \"http://www.w3.org/TR/html4/loose.dtd\">\n",fp_top3
);
214 fputs("<html>\n",fp_top3
);
215 fputs("<head>\n",fp_top3
);
216 sprintf(html
," <meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">\n",CharSet
);
218 fputs("</head>\n",fp_top3
);
222 sprintf(preg
,"<body class=\"body\">");
225 if(strlen(LogoImage
) > 0) {
226 fputs("<center><table cellpadding=\"0\" cellspacing=\"0\">\n",fp_top3
);
227 sprintf(preg
,"<tr><th class=\"logo\"><img src='%s' border=0 align=absmiddle width=%s height=%s> %s</th></tr>\n",LogoImage
,Width
,Height
,LogoText
);
229 fputs("<tr><td height=\"5\"></td></tr>\n",fp_top3
);
230 fputs("</table>\n",fp_top3
);
233 if(strcmp(IndexTree
,"date") == 0)
234 show_sarg(fp_top3
, "../../..");
236 show_sarg(fp_top3
, "..");
237 fputs("<center><table cellpadding=\"0\" cellspacing=\"0\">\n",fp_top3
);
238 sprintf(preg
,"<tr><th align=\"center\" class=\"title\">%s</th></tr>\n",Title
);
241 sprintf(preg
,"<tr><td class=\"header3\">%s: %s</td></tr>\n",text
[89],periodo
);
243 strcat(wheader
,(char *)text
[104]);
244 strcat(wheader
,": ");
245 strcat(wheader
,TopuserSortField
);
246 strcat(wheader
,", ");
247 strcat(wheader
,TopuserSortOrder
);
248 sprintf(preg
,"<tr><td class=\"header3\">%s</td></tr>\n",wheader
);
250 sprintf(preg
,"<tr><td class=\"header3\">Topuser %s</td></tr>\n",text
[55]);
253 fputs("</table></center>\n",fp_top3
);
254 fputs("<center><table cellpadding=\"1\" cellspacing=\"2\">\n",fp_top3
);
255 fputs("<tr><td><br></td><td></td></tr>\n",fp_top3
);
257 if(strstr(ReportType
,"topsites") != 0) {
258 sprintf(preg
,"<tr><td class=\"link\" colspan=11><a href=\"topsites.html\"><font class=\"link\">%s</font></a><font class=\"text\"> %s</font></td></tr>\n",text
[119],text
[55]);
262 if(strstr(ReportType
,"sites_users") != 0) {
263 sprintf(preg
,"<tr><td class=\"link\" colspan=11><a href=\"siteuser.html\"><font class=\"link\">%s</font></a><font class=\"text\"> %s</font></td></tr>\n",text
[85],text
[55]);
267 if(dansguardian_count
) {
268 sprintf(preg
,"<tr><td class=\"link\" colspan=11><a href=\"dansguardian.html\"><font class=\"link\">%s</font></a><font class=\"text\"> %s</font></td></tr>\n",text
[128],text
[55]);
272 if(squidguard_count
) {
273 sprintf(preg
,"<tr><td class=\"link\" colspan=11><a href=\"squidguard.html\"><font class=\"link\">%s</font></a><font class=\"text\"> %s</font></td></tr>\n",text
[122],text
[55]);
277 if (strstr(ReportType
,"downloads") != 0 && download_count
) {
278 sprintf(preg
,"<tr><td class=\"link\" colspan=11><a href=\"download.html\"><font class=\"link\">%s</font></a><font class=\"text\"> %s</font></td></tr>\n",text
[125],text
[55]);
282 if (strstr(ReportType
,"denied") != 0 && denied_count
) {
283 sprintf(preg
,"<tr><td class=\"link\" colspan=11><a href=\"denied.html\"><font class=\"link\">%s</font></a><font class=\"text\"> %s</font></td></tr>\n",text
[118],text
[55]);
287 if (strstr(ReportType
,"auth_failures") != 0 && authfail_count
) {
288 sprintf(preg
,"<tr><td class=\"link\" colspan=11><a href=\"authfail.html\"><font class=\"link\">%s</font></a><font class=\"text\"> %s</font></td></tr>\n",text
[117],text
[55]);
293 sprintf(preg
,"<tr><td class=\"link\" colspan=11><a href=\"smartfilter.html\"><font class=\"link\">%s</font></a><font class=\"text\"> %s</font></td></tr>\n",text
[116],text
[55]);
296 strcpy(preg
,"<tr><td></td></tr>\n");
299 if (strstr(ReportType
,"topuser") == 0) {
300 fputs("</body>\n</html>\n",fp_top3
);
305 strcpy(val1
,text
[100]);
306 strcpy(val2
,text
[98]);
307 strcpy(val3
,text
[92]);
308 strcpy(val4
,text
[93]);
309 sprintf(val11
,"%%%s",text
[93]);
310 sprintf(val5
,"%s-%s-%s",text
[113],text
[114],text
[112]);
311 strcpy(val6
,text
[94]);
312 strcpy(val7
,text
[95]);
313 sprintf(val8
,"%%%s",text
[99]);
314 strcpy(val9
,"colspan=2");
317 strcpy(hbc1
,"class=\"header\"");
318 strcpy(hbc2
,"class=\"header\"");
319 strcpy(hbc3
,"class=\"header\"");
320 strcpy(hbc4
,"class=\"header\"");
321 strcpy(hbc5
,"class=\"header3\"");
322 strcpy(hbc6
,"class=\"header\"");
323 strcpy(hbc7
,"class=\"header\"");
324 strcpy(hbc8
,"class=\"header\"");
325 strcpy(hbc9
,"class=\"header\"");
326 strcpy(hbc10
,"class=\"header\"");
328 if(strstr(TopUserFields
,"NUM") == 0) {
332 if(strstr(TopUserFields
,"USERID") == 0) {
336 if(strstr(TopUserFields
,"CONNECT") == 0) {
340 if(strstr(TopUserFields
,"BYTES") == 0) {
344 if(strstr(TopUserFields
,"SETYB") == 0) {
348 if(strstr(TopUserFields
,"IN-CACHE-OUT") == 0) {
352 strcpy(val10
,"<td></td>");
354 if(strstr(TopUserFields
,"USED_TIME") == 0) {
358 if(strstr(TopUserFields
,"MILISEC") == 0) {
362 if(strstr(TopUserFields
,"%TIME") == 0) {
367 sprintf(preg
,"<tr><th %s>%s</th><th %s></th><th %s>%s</th><th %s>%s</th><th %s>%s</th><th %s>%s</th><th %s %s>%s%s</th><th %s>%s</th><th %s>%s</th><th %s>%s</th></tr>\n",hbc1
,val1
,hbc1
,hbc2
,val2
,hbc3
,val3
,hbc4
,val4
,hbc9
,val11
,hbc5
,val9
,val5
,val10
,hbc6
,val6
,hbc7
,val7
,hbc8
,val8
);
371 fscanf(fp_top1
,"%s",user
);
372 fscanf(fp_top1
,"%s",nbytes
);
373 fscanf(fp_top1
,"%s",nacc
);
374 fscanf(fp_top1
,"%s",elap
);
375 fscanf(fp_top1
,"%s",incac
);
376 fscanf(fp_top1
,"%s",oucac
);
378 while(!feof(fp_top1
)) {
379 if(atoi(TopUsersNum
) > 0 && topcount
>= atoi(TopUsersNum
)) goto final
;
381 tnbytes
=my_atoll(nbytes
);
385 perc
=perc
/ ttnbytes
;
390 perc2
=((perc2
* 100) / ttnelap
);
395 inperc
=((inperc
* 100) / tnbytes
);
400 ouperc
=((ouperc
* 100) / tnbytes
);
407 if(strcmp(user
,"TOTAL") != 0){
408 sprintf(href
,"<a href='%s/",user
);
409 sprintf(href2
,"<a href='%s/d",user
);
410 sprintf(href3
,"<a href='%s/graph_day.png'>",user
);
413 strcat(href
,".html'>");
414 strcat(href2
,".html'>");
417 if(strcmp(Graphs
,"yes") != 0)
422 tnelap
=my_atoll(elap
);
426 if(strcmp(Ip2Name
,"yes") == 0) {
427 if(strcmp(user2
,ipantes
) != 0) {
428 strcpy(ipantes
,user2
);
430 strcpy(nameantes
,user2
);
431 } else strcpy(user2
,nameantes
);
435 if(strstr(ReportType
,"date_time") != 0) {
436 sprintf(ltext110
,"%s",text
[110]);
438 for(s
=ltext110
; *s
; ++s
)
442 bzero(href2
, MAXLEN
);
444 sprintf(val1
,"%s/d%s.html",dirname
,user
);
448 if(UserTabFile
[0] != '\0' && strstr(user2
,".") != 0) {
449 sprintf(warea
,":%s:",user2
);
450 if((str
=(char *) strstr(userfile
,warea
)) != (char *) NULL
) {
452 str2
=(char *) strstr(str
+1,":");
455 while(str2
[z1
] != ':') {
459 } else strcpy(name
,user2
);
460 } else strcpy(name
,user2
);
462 if(strcmp(Ip2Name
,"yes") == 0) {
463 if((str
=(char *) strstr(name
, ".")) != (char *) NULL
) {
464 if((str
=(char *) strstr(str
+1, ".")) != (char *) NULL
)
469 twork
=my_atoll(nacc
);
470 my_lltoa(twork
,nacc
,0);
471 sprintf(wwork1
,"%s",fixnum(twork
,1));
472 sprintf(wwork2
,"%s",fixnum(tnbytes
,1));
473 sprintf(wwork3
,"%s",fixnum(tnelap
,1));
475 sprintf(val1
,"%d",posicao
);
477 sprintf(val2
,"%s<img src=\"%s/graph.png\" border=\"0\" title=\"%s %s\"></a> %s<img src=\"%s/datetime.png\" border=\"0\" title=\"%s %s\">\n",href3
,ImageFile
,text
[126],text
[55],href2
,ImageFile
,ltext110
,text
[55]);
479 sprintf(val2
,"%s<img src=\"%s/datetime.png\" border=\"0\" title=\"%s %s\">\n",href2
,ImageFile
,ltext110
,text
[55]);
482 sprintf(val3
,"%3.2f%%",perc
);
483 sprintf(val4
,"%3.2f%%",inperc
);
484 sprintf(val5
,"%3.2f%%",ouperc
);
485 sprintf(val6
,"%s",buildtime(tnelap
));
486 sprintf(val7
,"%3.2f%%",perc2
);
488 strcpy(hbc1
,"class=\"data\"");
489 strcpy(hbc2
,"class=\"data2\"");
490 strcpy(hbc3
,"class=\"data\"");
491 strcpy(hbc4
,"class=\"data\"");
492 strcpy(hbc5
,"class=\"data\"");
493 strcpy(hbc6
,"class=\"data\"");
494 strcpy(hbc7
,"class=\"data\"");
495 strcpy(hbc8
,"class=\"data\"");
496 strcpy(hbc9
,"class=\"data\"");
497 strcpy(hbc10
,"class=\"data\"");
499 if(strstr(TopUserFields
,"NUM") == 0) {
503 if(strstr(TopUserFields
,"USERID") == 0) {
507 if(strstr(TopUserFields
,"CONNECT") == 0) {
511 if(strstr(TopUserFields
,"BYTES") == 0) {
515 if(strstr(TopUserFields
,"SETYB") == 0) {
519 if(strstr(TopUserFields
,"IN-CACHE-OUT") == 0) {
523 if(strstr(TopUserFields
,"IN-CACHE-OUT") == 0) {
527 if(strstr(TopUserFields
,"USED_TIME") == 0) {
531 if(strstr(TopUserFields
,"MILISEC") == 0) {
535 if(strstr(TopUserFields
,"%TIME") == 0) {
540 if(strstr(ReportType
,"users_sites") == 0)
543 if(dotinuser
&& strstr(name
,"_")) {
544 str2
=(char *)subs(name
,"_",".");
549 sprintf(preg
,"<tr><td %s>%s</td><td %s>%s</td><td %s>%s%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s</td><td %s>%s<td %s>%s</td></tr>\n",hbc1
,val1
,hbc2
,val2
,hbc2
,href
,name
,hbc3
,wwork1
,hbc4
,wwork2
,hbc5
,val3
,hbc6
,val4
,hbc7
,val5
,hbc8
,val6
,hbc9
,wwork3
,hbc10
,val7
);
551 if(strstr(user
,"TOTAL") != 0) {
554 inperc
=ttnbytes
/ 100;
555 inperc
=atol(incac
) / inperc
;
559 ouperc
=ttnbytes
/ 100;
560 ouperc
=atol(oucac
) / ouperc
;
563 sprintf(wwork1
,"%s",fixnum(ttnacc
,1));
564 sprintf(wwork2
,"%s",fixnum(ttnbytes
,1));
565 sprintf(wwork3
,"%s",fixnum(ttnelap
,1));
567 strcpy(hbc1
,"class=\"header2\"");
568 strcpy(hbc2
,"class=\"header2\"");
569 strcpy(hbc3
,"class=\"header2\"");
570 strcpy(hbc4
,"class=\"header2\"");
571 strcpy(hbc5
,"class=\"header2\"");
572 strcpy(hbc6
,"class=\"header2\"");
573 strcpy(hbc7
,"class=\"header2\"");
574 strcpy(hbc8
,"class=\"header2\"");
575 strcpy(hbc9
,"class=\"header2\"");
576 strcpy(hbc10
,"class=\"header\"");
578 sprintf(val4
,"%3.2f%%",inperc
);
579 sprintf(val5
,"%3.2f%%",ouperc
);
580 sprintf(val6
,"%s",buildtime(ttnelap
));
581 sprintf(val7
,"%3.2f%%",perc2
);
583 if(strstr(TopUserFields
,"CONNECT") == 0) {
587 if(strstr(TopUserFields
,"BYTES") == 0) {
591 if(strstr(TopUserFields
,"IN-CACHE-OUT") == 0) {
597 if(strstr(TopUserFields
,"USED_TIME") == 0) {
601 if(strstr(TopUserFields
,"MILISEC") == 0) {
606 if(strstr(ReportType
,"date_time") != 0) {
607 if(strstr(TopUserFields
,"TOTAL") != 0)
608 sprintf(preg
,"<tr><td></td><td></td><th %s>%s</th><th %s>%s</th><th %s>%15s</th><td></td><th %s>%s</th><th %s>%s</th><th %s>%s</th><th %s>%s</th></tr>\n",hbc10
,text
[107],hbc1
,wwork1
,hbc2
,wwork2
,hbc3
,val4
,hbc4
,val5
,hbc5
,val6
,hbc6
,wwork3
);
609 } else if(strstr(TopUserFields
,"TOTAL") != 0)
610 sprintf(preg
,"<tr><td></td><td></td><th %s>%s</th><th %s>%s</th><th %s>%15s</th><td></td><th %s>%s</th><th %s>%s</th><th %s>%s</th><th %s>%s</th></tr>\n",hbc10
,text
[107],hbc1
,wwork1
,hbc2
,wwork2
,hbc3
,val4
,hbc4
,val5
,hbc5
,val6
,hbc6
,wwork3
);
617 fscanf(fp_top1
,"%s",user
);
618 fscanf(fp_top1
,"%s",nbytes
);
619 fscanf(fp_top1
,"%s",nacc
);
620 fscanf(fp_top1
,"%s",elap
);
621 fscanf(fp_top1
,"%s",incac
);
622 fscanf(fp_top1
,"%s",oucac
);
626 tnbytes
=ttnbytes
/ totuser
;
629 twork
=ttnacc
/totuser
;
630 twork2
=ttnelap
/totuser
;
631 sprintf(wwork1
,"%s",fixnum(twork
,1));
632 sprintf(wwork2
,"%s",fixnum(tnbytes
,1));
633 sprintf(wwork3
,"%s",fixnum(twork2
,1));
635 if(strstr(TopUserFields
,"CONNECT") == 0) {
639 if(strstr(TopUserFields
,"BYTES") == 0) {
643 if(strstr(TopUserFields
,"IN-CACHE-OUT") == 0) {
649 if(strstr(TopUserFields
,"USED_TIME") == 0) {
653 if(strstr(TopUserFields
,"MILISEC") == 0) {
658 if((strstr(ReportType
,"date_time") != 0 && strstr(TopUserFields
,"AVERAGE") != 0)) {
659 sprintf(preg
,"<tr><td></td><th></th><th %s>%s</th><th %s>%s</th><th %s>%15s</th><td></td><td></td><td></td><th %s>%s</th><th %s>%s</th></tr>\n",hbc10
,text
[96],hbc1
,wwork1
,hbc2
,wwork2
,hbc3
,buildtime(ttnelap
/totuser
),hbc4
,wwork3
);
661 } else if(strstr(TopUserFields
,"AVERAGE") != 0) {
662 sprintf(preg
,"<tr><td></td><th></th><td></td><th %s>%s</th><th %s>%s</th><th %s>%15s</th><td></td><td></td><td></td><th %s>%s</th><th %s>%s</th></tr>\n",hbc10
,text
[96],hbc1
,wwork1
,hbc2
,wwork2
,hbc3
,buildtime(ttnelap
/totuser
),hbc4
,wwork3
);
666 if(strlen(UserAgentLog
) > 0) {
667 fputs("<tr><td></td></tr>\n",fp_top3
);
668 fputs("<tr><td></td></tr>\n",fp_top3
);
669 fputs("<td align=\"left\" colspan=8><font size=-1><a href='useragent.html'>Useragent</a> Report</td>\n",fp_top3
);
672 strcpy(preg
,"</table></center>");
681 if((fp_ou
=fopen(tusr
,"w"))==NULL
) {
682 fprintf(stderr
, "SARG: (topuser) %s: %s\n",text
[45],tusr
);
686 sprintf(preg
,"%d\n",totuser
);
689 fputs("</body>\n</html>\n",fp_top3
);