]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Properly adjust the links on the top users report page
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 15 Feb 2010 13:46:24 +0000 (13:46 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Mon, 15 Feb 2010 13:46:24 +0000 (13:46 +0000)
topuser.c

index 83c1f0c4d8cda4c74d5f5874999ebd4909758316..b23cc796ffb74ac7a82bb2ed575b35cd50fb41e6 100644 (file)
--- a/topuser.c
+++ b/topuser.c
@@ -112,18 +112,18 @@ void topuser(void)
    while((warea=longline_read(fp_in,&line))!=NULL) {
       getword_start(&gwarea,warea);
       if (getword(user,sizeof(user),&gwarea,'\t')<0) {
-         printf("SARG: Maybe you have a broken user in your %s file.\n",wger);
+         debuga(_("Maybe you have a broken user in your %s file"),wger);
          exit(1);
       }
       if(strcmp(user,"TOTAL") == 0) {
          continue;
       }
       if (getword_atoll(&nacc,&gwarea,'\t')<0) {
-         printf("SARG: Maybe you have a broken number of access in your %s file.\n",wger);
+         debuga(_("Maybe you have a broken number of access in your %s file"),wger);
          exit(1);
       }
       if (getword_atoll(&nbytes,&gwarea,'\t')<0) {
-         printf("SARG: Maybe you have a broken number of bytes in your %s file.\n",wger);
+         debuga(_("Maybe you have a broken number of bytes in your %s file"),wger);
          exit(1);
       }
       if (getword_ptr(NULL,NULL,&gwarea,'\t')<0) {
@@ -131,27 +131,27 @@ void topuser(void)
          exit(1);
       }
       if (getword(ip,sizeof(ip),&gwarea,'\t')<0) {
-         printf("SARG: Maybe you have a broken user's IP in your %s file.\n",wger);
+         debuga(_("Maybe you have a broken user's IP in your %s file"),wger);
          exit(1);
       }
       if (getword(time,sizeof(time),&gwarea,'\t')<0) {
-         printf("SARG: Maybe you have a broken time in your %s file.\n",wger);
+         debuga(_("Maybe you have a broken time in your %s file"),wger);
          exit(1);
       }
       if (getword(date,sizeof(date),&gwarea,'\t')<0) {
-         printf("SARG: Maybe you have a broken date in your %s file.\n",wger);
+         debuga(_("Maybe you have a broken date in your %s file"),wger);
          exit(1);
       }
       if (getword_atoll(&elap,&gwarea,'\t')<0) {
-         printf("SARG: Maybe you have a broken download duration in your %s file.\n",wger);
+         debuga(_("Maybe you have a broken download duration in your %s file"),wger);
          exit(1);
       }
       if (getword_atoll(&incac,&gwarea,'\t')<0) {
-         printf("SARG: Maybe you have a broken in cache download in your %s file.\n",wger);
+         debuga(_("Maybe you have a broken in cache download in your %s file"),wger);
          exit(1);
       }
       if (getword_atoll(&oucac,&gwarea,'\n')<0) {
-         printf("SARG: Maybe you have a broken not in cache download in your %s file.\n",wger);
+         debuga(_("Maybe you have a broken not in cache download in your %s file"),wger);
          exit(1);
       }
       if(strcmp(olduser,user) != 0) {
@@ -248,7 +248,7 @@ void topuser(void)
    if ((ReportType & REPORT_TYPE_AUTH_FAILURES) != 0 && authfail_count && !Privacy) fprintf(fp_top3,"<tr><td class=\"link\" colspan=\"0\"><a href=\"authfail.html\">%s</a></td></tr>\n",text[117]);
    if(smartfilter) fprintf(fp_top3,"<tr><td class=\"link\" colspan=\"0\"><a href=\"smartfilter.html\">%s</a></td></tr>\n",text[116]);
    if(UserAgentLog[0] != '\0' && useragent_count) fprintf(fp_top3,"<tr><td class=\"link\" colspan=\"0\"><a href=\"useragent.html\">%s</a></td></tr>\n",_("Useragent"));
-   fputs("<tr><td></td></tr>\n",fp_top3);
+   fputs("<tr><td></td></tr>\n</table></div>\n",fp_top3);
 
    if ((ReportType & REPORT_TYPE_TOPUSERS) == 0) {
       fputs("</body>\n</html>\n",fp_top3);
@@ -256,6 +256,7 @@ void topuser(void)
       return;
    }
 
+   fputs("<div class=\"report\"><table cellpadding=\"1\" cellspacing=\"2\">\n",fp_top3);
    fputs("<tr>",fp_top3);
 
    if((TopUserFields & TOPUSERFIELDS_NUM) != 0)