]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Produce the time and graphs reports if users_sites is disabled
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Fri, 3 Feb 2012 18:25:04 +0000 (19:25 +0100)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Fri, 3 Feb 2012 18:25:04 +0000 (19:25 +0100)
If the topusers report is requested but not the users_sites report, the
links to the time and graphs reports are included in the topusers list but
the files were not generated. Now, they are.

html.c
report.c
topuser.c
totday.c

diff --git a/html.c b/html.c
index 84db764f4caa1d5bf654533009f0397e32671cd3..714f86c5d3776305a58e27f6e83a55e9850f1172 100644 (file)
--- a/html.c
+++ b/html.c
@@ -75,8 +75,6 @@ void htmlrel(void)
        totelap=globstat.elap;
        ntotuser=globstat.totuser;
 
-       greport_prepare();
-
        sort_labels(&sort_field,&sort_order);
 
        uscan=userinfo_startscan();
@@ -103,9 +101,6 @@ void htmlrel(void)
                }
                tmpsort(uinfo);
 
-               report_day(uinfo);
-               greport_day(uinfo);
-
                if (snprintf(arqin,sizeof(arqin),"%s/htmlrel.txt",tmp)>=sizeof(arqin)) {
                        debuga(_("Input file name too long: %s/htmlrel.txt\n"),tmp);
                        exit(EXIT_FAILURE);
@@ -596,7 +591,6 @@ void htmlrel(void)
        }
 
        userinfo_stopscan(uscan);
-       greport_cleanup();
 
        return;
 }
index f6b6af919945ac768898cc1201b71ce2fafcdaea..d6d43231d5dcf6fca03a44ff95003ddc9bfad010 100644 (file)
--- a/report.c
+++ b/report.c
@@ -437,7 +437,6 @@ static FILE *maketmp_hour(const char *user, const char *dirname)
        FILE *fp_ou;
        char wdirname[MAXLEN];
 
-       if((ReportType & REPORT_TYPE_USERS_SITES) == 0) return(NULL);
        if(datetimeby==0) return(NULL);
 
        if (snprintf(wdirname,sizeof(wdirname),"%s/%s.htmp",tmp,user)>=sizeof(wdirname)) {
index b590b5a620469d61c5845702f9dc59b30f9cce90..7a82a6ee9c41d77fb230f7fa3cb80e0a0e0e8be7 100644 (file)
--- a/topuser.c
+++ b/topuser.c
@@ -285,6 +285,8 @@ void topuser(void)
 
        fputs("</tr></thead>\n",fp_top3);
 
+       greport_prepare();
+
        ntopuser = 0;
 
        if ((line=longline_create())==NULL) {
@@ -332,6 +334,9 @@ void topuser(void)
                }
                uinfo->topuser=1;
 
+               report_day(uinfo);
+               greport_day(uinfo);
+
                fputs("<tr>",fp_top3);
 
                posicao++;
@@ -444,6 +449,7 @@ void topuser(void)
 
                fputs("</tr>\n",fp_top3);
        }
+       greport_cleanup();
 
        if(ntopuser && (TopUserFields & TOPUSERFIELDS_AVERAGE) != 0) {
                fputs("<tr>",fp_top3);
index dd2bf4a1581c7759efff95b7cde98776af9bf47e..81f1bf6b3c276803c885d626ef15f727b1f88673 100644 (file)
--- a/totday.c
+++ b/totday.c
@@ -49,7 +49,6 @@ void day_totalize(const char *tmp, const struct userinfostruct *uinfo)
        char colsep;
        struct getwordstruct gwarea;
 
-       if((ReportType & REPORT_TYPE_USERS_SITES) == 0) return;
        if (datetimeby==0) return;
 
        if (snprintf(wdirname,sizeof(wdirname),"%s/%s.htmp",tmp,uinfo->filename)>=sizeof(wdirname)) {