]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - siteuser.c
Imported sarg 2.0.9
[thirdparty/sarg.git] / siteuser.c
index 9213f04323b7e594b12ff06a50f9c8f3ed71102c..5af74ca794c80d1ecd48f0887d4e4d3faa775ce4 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * AUTHOR: Pedro Lineu Orso                          orso@brturbo.com.br
+ * AUTHOR: Pedro Lineu Orso                      orso@penguintech.com.br
  *                                                            1998, 2005
- * SARG Squid Analysis Report Generator            http://sarg-squid.org
+ * SARG Squid Analysis Report Generator      http://sarg.sourceforge.net
  *
  * SARG donations:
  *      please look at http://sarg.sourceforge.net/donations.php
@@ -63,7 +63,7 @@ void siteuser()
    fgets(periodo,sizeof(periodo),fp_in);
    fclose(fp_in);
 
-   sprintf(csort,"sort -k 4,4 -k 1,1 -o %s %s",geral2,geral);
+   sprintf(csort,"sort -k 4,4 -k 1,1 -o '%s' '%s'",geral2,geral);
    system(csort);
 
    if((fp_in=fopen(geral2,"r"))==NULL) {
@@ -94,9 +94,10 @@ void siteuser()
    fputs(url,fp_ou);
 
    if(strlen(LogoImage) > 0) {
-      fputs("<center><table cellpadding=0 cellspacing=0>\n",fp_ou);
-      sprintf(url,"<tr><th align=\"center\"><img src='%s' border=0 align=absmiddle width=%s height=%s><font color=%s>%s</font>\n",LogoImage,Width,Height,LogoTextColor,LogoText);
+      fputs("<center><table cellpadding=\"0\" cellspacing=\"0\">\n",fp_ou);
+      sprintf(url,"<tr><th class=\"logo\"><img src='%s' border=0 align=absmiddle width=%s height=%s>&nbsp;%s</th></tr>\n",LogoImage,Width,Height,LogoText);
       fputs(url,fp_ou);
+      fputs("<tr><td height=\"5\"></td></tr>\n",fp_ou);
       fputs("</table>\n",fp_ou);
    }
 
@@ -134,19 +135,24 @@ void siteuser()
       if(userip)
          fixip(user);
 
-       if(UserTabFile[0] != '\0') {
-           sprintf(warea,":%s:",user);
-           if((str=(char *) strstr(userfile,warea)) != (char *) NULL ) {
-               z1=0;
-               str2=(char *) strstr(str+1,":");
-               str2++;
-               bzero(name, MAXLEN);
-                while(str2[z1] != ':') {
-                   name[z1]=str2[z1];
-                   z1++;
-               }
-           } else strcpy(name,user);
-       } else strcpy(name,user);
+      if(UserTabFile[0] != '\0') {
+         sprintf(warea,":%s:",user);
+        if((str=(char *) strstr(userfile,warea)) != (char *) NULL ) {
+            z1=0;
+            str2=(char *) strstr(str+1,":");
+            str2++;
+            bzero(name, MAXLEN);
+            while(str2[z1] != ':') {
+               name[z1]=str2[z1];
+              z1++;
+            }
+         } else strcpy(name,user);
+      } else strcpy(name,user);
+
+      if(dotinuser && strstr(name,"_")) {
+         str2=(char *)subs(name,"_",".");
+         strcpy(name,str2);
+      }
 
       if(strcmp(Ip2Name,"yes") == 0)
          ip2name(user);