- fputs("\" alt=\"T\"></a></td>",fp_top3);
- } else {
- sprintf(val1,"%s/d%s.html",outdirname,uinfo->filename);
- unlink(val1);
- }
- if((TopUserFields & TOPUSERFIELDS_USERID) != 0) {
- if((ReportType & REPORT_TYPE_USERS_SITES) == 0)
- fprintf(fp_top3,"<td class=\"data2\">%s</td>",name);
- else
- fprintf(fp_top3,"<td class=\"data2\"><a href=\"%s/%s.html\">%s</a></td>",uinfo->filename,uinfo->filename,uinfo->label);
- }
- if((TopUserFields & TOPUSERFIELDS_CONNECT) != 0)
- fprintf(fp_top3,"<td class=\"data\">%s</td>",fixnum(nacc,1));
- if((TopUserFields & TOPUSERFIELDS_BYTES) != 0)
- fprintf(fp_top3,"<td class=\"data\">%s</td>",fixnum(tnbytes,1));
- if((TopUserFields & TOPUSERFIELDS_SETYB) != 0) {
- perc=(ttnbytes) ? tnbytes * 100. / ttnbytes : 0.;
- fprintf(fp_top3,"<td class=\"data\">%3.2lf%%</td>",perc);
- }
- if((TopUserFields & TOPUSERFIELDS_IN_CACHE_OUT) != 0) {
- inperc=(tnbytes) ? incac * 100. / tnbytes : 0.;
- ouperc=(tnbytes) ? oucac * 100. / tnbytes : 0.;
- fprintf(fp_top3,"<td class=\"data\">%3.2lf%%</td><td class=\"data\">%3.2lf%%</td>",inperc,ouperc);
- }
- if((TopUserFields & TOPUSERFIELDS_USED_TIME) != 0)
- fprintf(fp_top3,"<td class=\"data\">%s</td>",buildtime(tnelap));
- if((TopUserFields & TOPUSERFIELDS_MILISEC) != 0)
- fprintf(fp_top3,"<td class=\"data\">%s</td>",fixnum2(tnelap,1));
- if((TopUserFields & TOPUSERFIELDS_PTIME) != 0) {
- perc2=(ttnelap) ? elap * 100. / ttnelap : 0.;
- fprintf(fp_top3,"<td class=\"data\">%3.2lf%%</td>",perc2);
- }
-
- fputs("</tr>\n",fp_top3);
-
- topcount++;
- }
- fclose(fp_top1);
- unlink(top1);
- longline_destroy(&line);
-
- if((TopUserFields & TOPUSERFIELDS_TOTAL) != 0) {
- fputs("<tr>",fp_top3);
- if((TopUserFields & TOPUSERFIELDS_NUM) != 0)
- fputs("<td></td>",fp_top3);
- if((TopUserFields & TOPUSERFIELDS_DATE_TIME) !=0 && (ReportType & REPORT_TYPE_DATE_TIME) != 0)
- fputs("<td></td>",fp_top3);
- fprintf(fp_top3,"<th class=\"header_l\">%s</th>",_("TOTAL"));
-
- if((TopUserFields & TOPUSERFIELDS_CONNECT) != 0)
- fprintf(fp_top3,"<th class=\"header_r\">%s</th>",fixnum(ttnacc,1));
- if((TopUserFields & TOPUSERFIELDS_BYTES) != 0)
- fprintf(fp_top3,"<th class=\"header_r\">%15s</th>",fixnum(ttnbytes,1));
- if((TopUserFields & TOPUSERFIELDS_SETYB) != 0)
- fputs("<td></td>",fp_top3);
- if((TopUserFields & TOPUSERFIELDS_IN_CACHE_OUT) != 0)
- {
- inperc=(ttnbytes) ? ttnincache * 100. / ttnbytes : 0.;
- ouperc=(ttnbytes) ? ttnoucache *100. / ttnbytes : 0.;
- fprintf(fp_top3,"<th class=\"header_r\">%3.2lf%%</th><th class=\"header_r\">%3.2lf%%</th>",inperc,ouperc);
- }
- if((TopUserFields & TOPUSERFIELDS_USED_TIME) != 0)
- fprintf(fp_top3,"<th class=\"header_r\">%s</th>",buildtime(ttnelap));
- if((TopUserFields & TOPUSERFIELDS_MILISEC) != 0)
- fprintf(fp_top3,"<th class=\"header_r\">%s</th>",fixnum2(ttnelap,1));
-
- fputs("</tr>\n",fp_top3);
- }
-
- if(ntopuser && (TopUserFields & TOPUSERFIELDS_AVERAGE) != 0) {
- fputs("<tr>",fp_top3);
- if((TopUserFields & TOPUSERFIELDS_NUM) != 0)
- fputs("<td></td>",fp_top3);
- if((TopUserFields & TOPUSERFIELDS_DATE_TIME) !=0 && (ReportType & REPORT_TYPE_DATE_TIME) != 0)
- fputs("<td></td>",fp_top3);
- fprintf(fp_top3,"<th class=\"header_l\">%s</th>",_("AVERAGE"));
-
- if((TopUserFields & TOPUSERFIELDS_CONNECT) != 0)
- fprintf(fp_top3,"<th class=\"header_r\">%s</th>",fixnum(ttnacc/totuser,1));
- if((TopUserFields & TOPUSERFIELDS_BYTES) != 0) {
- tnbytes=(totuser) ? ttnbytes / totuser : 0;
- fprintf(fp_top3,"<th class=\"header_r\">%15s</th>",fixnum(tnbytes,1));
- }
- if((TopUserFields & TOPUSERFIELDS_SETYB) != 0)
- fputs("<td></td>",fp_top3);
- if((TopUserFields & TOPUSERFIELDS_IN_CACHE_OUT) != 0)
- fputs("<td></td><td></td>",fp_top3);
- if((TopUserFields & TOPUSERFIELDS_USED_TIME) != 0)
- fprintf(fp_top3,"<th class=\"header_r\">%s</th>",buildtime(ttnelap/totuser));
- if((TopUserFields & TOPUSERFIELDS_MILISEC) != 0)
- fprintf(fp_top3,"<th class=\"header_r\">%s</th>",fixnum2(ttnelap/totuser,1));
- fputs("</tr>\n",fp_top3);
- }
-
- fputs("</table></div>\n",fp_top3);
- if (write_html_trailer(fp_top3)<0)
- debuga(_("Write error in top user list %s\n"),top3);
- if (fclose(fp_top3)==EOF)
- debuga(_("Failed to close the top user list %s - %s\n"),top3,strerror(errno));
-
- if((fp_ou=fopen(tusr,"w"))==NULL) {
- debuga(_("(topuser) Cannot open file %s\n"),tusr);
- exit(EXIT_FAILURE);
- }
- fprintf(fp_ou,"%d\n",totuser);
- fclose(fp_ou);
-
- return;
+ }
+ if((TopUserFields & TOPUSERFIELDS_USED_TIME) != 0)
+ fprintf(fp_top3,"<th class=\"header_r\">%s</th>",buildtime(Statis->ttnelap));
+ if((TopUserFields & TOPUSERFIELDS_MILISEC) != 0)
+ fprintf(fp_top3,"<th class=\"header_r\">%s</th>",fixnum2(Statis->ttnelap,1));
+
+ fputs("</tr>\n",fp_top3);
+ }
+ greport_cleanup();
+
+ if (ntopuser && (TopUserFields & TOPUSERFIELDS_AVERAGE) != 0) {
+ fputs("<tr>",fp_top3);
+ if((TopUserFields & TOPUSERFIELDS_NUM) != 0)
+ fputs("<td></td>",fp_top3);
+ if((TopUserFields & TOPUSERFIELDS_DATE_TIME) !=0 && (ReportType & REPORT_TYPE_DATE_TIME) != 0 && !indexonly)
+ fputs("<td></td>",fp_top3);
+ if((TopUserFields & TOPUSERFIELDS_USERIP) != 0)
+ fprintf(fp_top3,"<th class=\"header_l\" colspan=\"2\">%s</th>",_("AVERAGE"));
+ else
+ fprintf(fp_top3,"<th class=\"header_l\">%s</th>",_("AVERAGE"));
+
+ if((TopUserFields & TOPUSERFIELDS_CONNECT) != 0)
+ fprintf(fp_top3,"<th class=\"header_r\">%s</th>",fixnum(Statis->ttnacc/Statis->totuser,1));
+ if((TopUserFields & TOPUSERFIELDS_BYTES) != 0) {
+ nbytes=(Statis->totuser) ? Statis->ttnbytes / Statis->totuser : 0;
+ fprintf(fp_top3,"<th class=\"header_r\">%15s</th>",fixnum(nbytes,1));
+ }
+ if((TopUserFields & TOPUSERFIELDS_SETYB) != 0)
+ fputs("<td></td>",fp_top3);
+ if((TopUserFields & TOPUSERFIELDS_IN_CACHE_OUT) != 0)
+ fputs("<td></td><td></td>",fp_top3);
+ if((TopUserFields & TOPUSERFIELDS_USED_TIME) != 0)
+ fprintf(fp_top3,"<th class=\"header_r\">%s</th>",buildtime(Statis->ttnelap/Statis->totuser));
+ if((TopUserFields & TOPUSERFIELDS_MILISEC) != 0)
+ fprintf(fp_top3,"<th class=\"header_r\">%s</th>",fixnum2(Statis->ttnelap/Statis->totuser,1));
+ fputs("</tr></tfoot>\n",fp_top3);
+ }
+
+ fputs("</table></div>\n",fp_top3);
+ write_html_trailer(fp_top3);
+ if (fclose(fp_top3)==EOF) {
+ debuga(__FILE__,__LINE__,_("Write error in \"%s\": %s\n"),top3,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+}
+
+/*!
+ Generate the top user email report.
+ */
+static void TopUser_TextEmail(const char *ListFile,struct TopUserStatistics *Statis,struct SortInfoStruct *SortInfo)
+{
+ FileObject *fp_top1;
+ FILE *fp_mail;
+ longline line;
+ struct getwordstruct gwarea;
+ char *warea;
+ char user[MAX_USER_LEN];
+ char strip1[MAXLEN], strip2[MAXLEN], strip3[MAXLEN], strip4[MAXLEN], strip5[MAXLEN], strip6[MAXLEN], strip7[MAXLEN];
+ long long int nbytes;
+ long long int nacc;
+ long long int elap, incac, oucac;
+ double perc=0.00;
+ double perc2=0.00;
+ long long int tnbytes=0;
+ long long int avgacc, avgelap;
+ int topcount=0;
+ struct userinfostruct *uinfo;
+ time_t t;
+ struct tm *local;
+ const char *Subject;
+
+ if ((fp_top1=FileObject_Open(ListFile))==NULL) {
+ debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),ListFile,FileObject_GetLastOpenError());
+ exit(EXIT_FAILURE);
+ }
+
+ fp_mail=Email_OutputFile("topuser");
+
+ if ((line=longline_create())==NULL) {
+ debuga(__FILE__,__LINE__,_("Not enough memory to read file \"%s\"\n"),ListFile);
+ exit(EXIT_FAILURE);
+ }
+
+ safe_strcpy(strip1,_("Squid User Access Report"),sizeof(strip1));
+ strip_latin(strip1);
+ fprintf(fp_mail,"%s\n",strip1);
+
+ snprintf(strip1,sizeof(strip1),_("Sort: %s, %s"),SortInfo->sort_field,SortInfo->sort_order);
+ strip_latin(strip1);
+ fprintf(fp_mail,"%s\n",strip1);
+
+ snprintf(strip1,sizeof(strip1),_("Period: %s"),period.text);
+ strip_latin(strip1);
+ fprintf(fp_mail,"%s\n\n",strip1);
+
+ safe_strcpy(strip1,_("NUM"),sizeof(strip1));
+ strip_latin(strip1);
+ safe_strcpy(strip2,_("USERID"),sizeof(strip2));
+ strip_latin(strip2);
+ safe_strcpy(strip3,_("CONNECT"),sizeof(strip3));
+ strip_latin(strip3);
+ safe_strcpy(strip4,_("BYTES"),sizeof(strip4));
+ strip_latin(strip4);
+ safe_strcpy(strip5,_("ELAPSED TIME"),sizeof(strip5));
+ strip_latin(strip5);
+ safe_strcpy(strip6,_("MILLISEC"),sizeof(strip6));
+ strip_latin(strip6);
+ safe_strcpy(strip7,pgettext("duration","TIME"),sizeof(strip7));
+ strip_latin(strip7);
+
+ fprintf(fp_mail,"%-7s %-20s %-9s %-15s %%%-6s %-11s %-10s %%%-7s\n------- -------------------- -------- --------------- ------- ---------- ---------- -------\n",strip1,strip2,strip3,strip4,strip4,strip5,strip6,strip7);
+
+
+ while ((warea=longline_read(fp_top1,line))!=NULL) {
+ getword_start(&gwarea,warea);
+ if (getword(user,sizeof(user),&gwarea,'\t')<0) {
+ debuga(__FILE__,__LINE__,_("Invalid user in file \"%s\"\n"),ListFile);
+ exit(EXIT_FAILURE);
+ }
+ if (getword_atoll(&nbytes,&gwarea,'\t')<0) {
+ debuga(__FILE__,__LINE__,_("Invalid number of bytes in file \"%s\"\n"),ListFile);
+ exit(EXIT_FAILURE);
+ }
+ if (getword_atoll(&nacc,&gwarea,'\t')<0) {
+ debuga(__FILE__,__LINE__,_("Invalid number of accesses in file \"%s\"\n"),ListFile);
+ exit(EXIT_FAILURE);
+ }
+ if (getword_atoll(&elap,&gwarea,'\t')<0) {
+ debuga(__FILE__,__LINE__,_("Invalid elapsed time in file \"%s\"\n"),ListFile);
+ exit(EXIT_FAILURE);
+ }
+ if (getword_atoll(&incac,&gwarea,'\t')<0) {
+ debuga(__FILE__,__LINE__,_("Invalid in-cache size in file \"%s\"\n"),ListFile);
+ exit(EXIT_FAILURE);
+ }
+ if (getword_atoll(&oucac,&gwarea,'\n')<0) {
+ debuga(__FILE__,__LINE__,_("Invalid out-of-cache size in file \"%s\"\n"),ListFile);
+ exit(EXIT_FAILURE);
+ }
+ if (nacc < 1)
+ continue;
+ if (TopUsersNum>0 && topcount>=TopUsersNum) break;
+
+ uinfo=userinfo_find_from_id(user);
+ if (!uinfo) {
+ debuga(__FILE__,__LINE__,_("Unknown user ID %s in file \"%s\"\n"),user,ListFile);
+ exit(EXIT_FAILURE);
+ }
+ uinfo->topuser=1;
+
+ perc=(Statis->ttnbytes) ? nbytes * 100. / Statis->ttnbytes : 0;
+ perc2=(Statis->ttnelap) ? elap * 100. / Statis->ttnelap : 0;
+
+ topcount++;
+
+#if defined(__FreeBSD__)
+ fprintf(fp_mail,"%7d %20s %8lld %15s %5.2lf%% %10s %10qu %3.2lf%%\n",topcount,uinfo->label,nacc,fixnum(nbytes,1),perc,buildtime(elap),elap,perc2);
+#else
+ fprintf(fp_mail,"%7d %20s %8"PRIu64" %15s %6.2lf%% %10s %10"PRIu64" %3.2lf%%\n",topcount,uinfo->label,(uint64_t)nacc,fixnum(nbytes,1),perc,buildtime(elap),(uint64_t)elap,perc2);
+#endif
+ }
+ if (FileObject_Close(fp_top1)) {
+ debuga(__FILE__,__LINE__,_("Read error in \"%s\": %s\n"),ListFile,FileObject_GetLastCloseError());
+ exit(EXIT_FAILURE);
+ }
+ if (!KeepTempLog && unlink(ListFile)) {
+ debuga(__FILE__,__LINE__,_("Cannot delete \"%s\": %s\n"),ListFile,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+ longline_destroy(&line);
+
+ // output total
+ fputs("------- -------------------- -------- --------------- ------- ---------- ---------- -------\n",fp_mail);
+#if defined(__FreeBSD__)
+ fprintf(fp_mail,"%-7s %20s %8qu %15s %8s %9s %10qu\n",_("TOTAL")," ",Statis->ttnacc,fixnum(Statis->ttnbytes,1)," ",buildtime(Statis->ttnelap),Statis->ttnelap);
+#else
+ fprintf(fp_mail,"%-7s %20s %8"PRIu64" %15s %8s %9s %10"PRIu64"\n",_("TOTAL")," ",(uint64_t)Statis->ttnacc,fixnum(Statis->ttnbytes,1)," ",buildtime(Statis->ttnelap),(uint64_t)Statis->ttnelap);
+#endif
+
+ // compute and write average
+ if (Statis->totuser>0) {
+ tnbytes=Statis->ttnbytes / Statis->totuser;
+ avgacc=Statis->ttnacc/Statis->totuser;
+ avgelap=Statis->ttnelap/Statis->totuser;
+ } else {
+ tnbytes=0;
+ avgacc=0;
+ avgelap=0;
+ }
+
+ safe_strcpy(strip1,_("AVERAGE"),sizeof(strip1));
+ strip_latin(strip1);
+#if defined(__FreeBSD__)
+ fprintf(fp_mail,"%-7s %20s %8qu %15s %8s %9s %10qu\n",strip1," ",avgacc,fixnum(tnbytes,1)," ",buildtime(avgelap),avgelap);
+#else
+ fprintf(fp_mail,"%-7s %20s %8"PRIu64" %15s %8s %9s %10"PRIu64"\n",strip1," ",(uint64_t)avgacc,fixnum(tnbytes,1)," ",buildtime(avgelap),(uint64_t)avgelap);
+#endif
+
+ t = time(NULL);
+ local = localtime(&t);
+ fprintf(fp_mail, "\n%s\n", asctime(local));
+
+ /* TRANSLATORS: This is the e-mail subject. */
+ Subject=_("Sarg: top user report");
+ Email_Send(fp_mail,Subject);
+}
+
+/*!
+ * Produce a report with the user downloading the most data.
+ */
+void topuser(void)
+{
+ FileObject *fp_in = NULL;
+ FILE *fp_top2;
+ char wger[MAXLEN];
+ char top1[MAXLEN];
+ char top2[MAXLEN];
+ longline line;
+ long long int tnacc=0;
+ long long int tnbytes=0, tnelap=0;
+ long long int tnincache=0, tnoucache=0;
+ char *warea;
+ struct generalitemstruct item;
+ char olduser[MAX_USER_LEN], csort[MAXLEN];
+ const char *sfield="-n -k 2,2";
+ const char *order;
+ int cstatus;
+ struct TopUserStatistics Statis;
+ struct SortInfoStruct SortInfo;
+
+ if (debugz>=LogLevel_Process)
+ debuga(__FILE__,__LINE__,_("Creating top users report...\n"));
+
+ memset(&Statis,0,sizeof(Statis));
+
+ snprintf(wger,sizeof(wger),"%s/sarg-general",outdirname);
+ if ((fp_in=FileObject_Open(wger))==NULL) {
+ debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),wger,FileObject_GetLastOpenError());
+ exit(EXIT_FAILURE);
+ }
+
+ snprintf(top2,sizeof(top2),"%s/top.tmp",outdirname);
+ if ((fp_top2=fopen(top2,"w"))==NULL) {
+ debuga(__FILE__,__LINE__,_("Cannot open file \"%s\": %s\n"),top2,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+
+ olduser[0]='\0';
+
+ if ((line=longline_create())==NULL) {
+ debuga(__FILE__,__LINE__,_("Not enough memory to read file \"%s\"\n"),wger);
+ exit(EXIT_FAILURE);
+ }
+
+ while ((warea=longline_read(fp_in,line))!=NULL) {
+ ger_read(warea,&item,wger);
+ if (item.total) continue;
+ if (strcmp(olduser,item.user) != 0) {
+ Statis.totuser++;
+
+ if (olduser[0] != '\0') {
+ /*
+ This complicated printf is due to Microsoft's inability to comply with any standard. Msvcrt is unable
+ to print a long long int unless it is exactly 64-bits long.
+ */
+ fprintf(fp_top2,"%s\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n",olduser,(uint64_t)tnbytes,(uint64_t)tnacc,(uint64_t)tnelap,(uint64_t)tnincache,(uint64_t)tnoucache);
+
+ Statis.ttnbytes+=tnbytes;
+ Statis.ttnacc+=tnacc;
+ Statis.ttnelap+=tnelap;
+ Statis.ttnincache+=tnincache;
+ Statis.ttnoucache+=tnoucache;
+ }
+ safe_strcpy(olduser,item.user,sizeof(olduser));
+ tnbytes=0;
+ tnacc=0;
+ tnelap=0;
+ tnincache=0;
+ tnoucache=0;
+ }
+
+ tnbytes+=item.nbytes;
+ tnacc+=item.nacc;
+ tnelap+=item.nelap;
+ tnincache+=item.incache;
+ tnoucache+=item.oucache;
+ }
+ if (FileObject_Close(fp_in)) {
+ debuga(__FILE__,__LINE__,_("Read error in \"%s\": %s\n"),wger,FileObject_GetLastCloseError());
+ exit(EXIT_FAILURE);
+ }
+ longline_destroy(&line);
+
+ if (olduser[0] != '\0') {
+ /*
+ This complicated printf is due to Microsoft's inability to comply with any standard. Msvcrt is unable
+ to print a long long int unless it is exactly 64-bits long.
+ */
+ fprintf(fp_top2,"%s\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n",olduser,(uint64_t)tnbytes,(uint64_t)tnacc,(uint64_t)tnelap,(uint64_t)tnincache,(uint64_t)tnoucache);
+
+ Statis.ttnbytes+=tnbytes;
+ Statis.ttnacc+=tnacc;
+ Statis.ttnelap+=tnelap;
+ Statis.ttnincache+=tnincache;
+ Statis.ttnoucache+=tnoucache;
+ }
+ if (fclose(fp_top2)==EOF) {
+ debuga(__FILE__,__LINE__,_("Write error in \"%s\": %s\n"),top2,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+
+#ifdef ENABLE_DOUBLE_CHECK_DATA
+ if (Statis.ttnacc!=globstat.nacc || Statis.ttnbytes!=globstat.nbytes || Statis.ttnelap!=globstat.elap ||
+ Statis.ttnincache!=globstat.incache || Statis.ttnoucache!=globstat.oucache) {
+ debuga(__FILE__,__LINE__,_("Total statistics mismatch when reading \"%s\" to produce the top users\n"),wger);
+ exit(EXIT_FAILURE);
+ }
+#endif
+
+ set_total_users(Statis.totuser);
+
+ if((TopuserSort & TOPUSER_SORT_USER) != 0) {
+ sfield="-k 1,1";
+ SortInfo.sort_field=_("user");
+ } else if((TopuserSort & TOPUSER_SORT_CONNECT) != 0) {
+ sfield="-n -k 3,3";
+ SortInfo.sort_field=_("connect");
+ } else if((TopuserSort & TOPUSER_SORT_TIME) != 0) {
+ sfield="-n -k 4,4";
+ SortInfo.sort_field=pgettext("duration","time");
+ } else {
+ SortInfo.sort_field=_("bytes");
+ }
+
+ if((TopuserSort & TOPUSER_SORT_REVERSE) == 0) {
+ order="";
+ SortInfo.sort_order=_("normal");
+ } else {
+ order="-r";
+ SortInfo.sort_order=_("reverse");
+ }
+
+ snprintf(top1,sizeof(top1),"%s/top",outdirname);
+ if (snprintf(csort,sizeof(csort),"sort -T \"%s\" -t \"\t\" %s %s -o \"%s\" \"%s\"", tmp, order, sfield, top1, top2)>=sizeof(csort)) {
+ debuga(__FILE__,__LINE__,_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),top2,top1);
+ exit(EXIT_FAILURE);
+ }
+ cstatus=system(csort);
+ if (!WIFEXITED(cstatus) || WEXITSTATUS(cstatus)) {
+ debuga(__FILE__,__LINE__,_("sort command return status %d\n"),WEXITSTATUS(cstatus));
+ debuga(__FILE__,__LINE__,_("sort command: %s\n"),csort);
+ exit(EXIT_FAILURE);
+ }
+
+ if (!KeepTempLog && unlink(top2)) {
+ debuga(__FILE__,__LINE__,_("Cannot delete \"%s\": %s\n"),top2,strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+
+ if (email[0])
+ TopUser_TextEmail(top1,&Statis,&SortInfo);
+ else
+ TopUser_HtmlReport(top1,&Statis,&SortInfo);