]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - siteuser.c
Use boolean to enable all the options instead of string compares.
[thirdparty/sarg.git] / siteuser.c
index be36d9a3452224a7944d8d8abb2fd19f0383e3f9..931082001c51718c2cdc9389432bddd2f158ee87 100644 (file)
@@ -51,7 +51,7 @@ void siteuser(void)
    int cstatus;
    struct getwordstruct gwarea;
 
-   if(strcmp(Privacy,"yes") == 0)
+   if(Privacy)
       return;
 
    nsitesusers = 0;
@@ -112,7 +112,7 @@ void siteuser(void)
 
    fputs("<div align=\"center\"><table cellpadding=\"0\" cellspacing=\"2\">\n",fp_ou);
    fputs("<tr><td></td></tr>\n",fp_ou);
-   if(strncmp(strlow(BytesInSitesUsersReport),"yes",3) == 0)
+   if(BytesInSitesUsersReport)
       fprintf(fp_ou,"<tr><th class=\"header\">%s</th><th class=\"header\">%s</th><th class=\"header\">%s</th><th class=\"header\">%s</th></tr>\n",text[100],text[91],text[93],text[103]);
    else
       fprintf(fp_ou,"<tr><th class=\"header\">%s</th><th class=\"header\">%s</th><th class=\"header\">%s</th></tr>\n",text[100],text[91],text[103]);
@@ -146,7 +146,7 @@ void siteuser(void)
 
       /*
       In fact, even the first call is unecessary as the resolved user variable is never used.
-      if(strcmp(Ip2Name,"yes") == 0)
+      if(Ip2Name)
          ip2name(user,sizeof(user));
       */
 
@@ -155,7 +155,7 @@ void siteuser(void)
       if the first ip2name succeed because it will try to resolve a name which is not an IP but if
       the first ip2name failed, the second attempt may find the expected address which was resolved
       in the mean time by the DNS server.
-      if(strcmp(Ip2Name,"yes") == 0)
+      if(Ip2Name)
          ip2name(user,sizeof(user));
       */
 
@@ -200,7 +200,7 @@ void siteuser(void)
       else BlockImage[0]='\0';
 
       if(strcmp(url,ourl) != 0 && nsitesusers) {
-         if(strncmp(strlow(BytesInSitesUsersReport),"yes",3) == 0) {
+         if(BytesInSitesUsersReport) {
             sprintf(wwork2,"%s",fixnum(obytes,1));
             fprintf(fp_ou,"<tr><td class=\"data\">%d</td><td class=\"data2\">%s<a href=\"http://%s\">%s</a></td><td class=\"data\">%s</td><td class=\"data2\">%s</td></tr>\n",regs,BlockImage,ourl,ourl,wwork2,users);
          } else