]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
No links in the denied page if the user is not on the topusers list
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Tue, 7 Feb 2012 18:23:46 +0000 (19:23 +0100)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Tue, 7 Feb 2012 18:23:46 +0000 (19:23 +0100)
The report with the denied accesses contains links to the user report page
but the user report page is not generated if the user is not on the
topusers list.

This patch hide the link if the user's page doesn't exists.

denied.c

index b92642d5cd7a29a29b6c6317af701543ab3764a1..2ca16279210f7b6d284db53c69c9572fcb2191cb 100644 (file)
--- a/denied.c
+++ b/denied.c
@@ -148,9 +148,12 @@ void gen_denied_report(void)
                }
 
                fputs("<tr>",fp_ou);
-               if (new_user)
-                       fprintf(fp_ou,"<td class=\"data\"><a href=\"%s/%s.html\">%s</a></td><td class=\"data\">%s</td>",uinfo->filename,uinfo->filename,uinfo->label,ip);
-               else
+               if (new_user) {
+                       if (uinfo->topuser)
+                               fprintf(fp_ou,"<td class=\"data\"><a href=\"%s/%s.html\">%s</a></td><td class=\"data\">%s</td>",uinfo->filename,uinfo->filename,uinfo->label,ip);
+                       else
+                               fprintf(fp_ou,"<td class=\"data\">%s</td><td class=\"data\">%s</td>",uinfo->label,ip);
+               } else
                        fputs("<td class=\"data\"></td><td class=\"data\"></td>",fp_ou);
                fprintf(fp_ou,"<td class=\"data\">%s-%s</td><td class=\"data2\">",data,hora);
                if(BlockIt[0] != '\0' && url[0]!=ALIAS_PREFIX) {