From: Frédéric Marchal Date: Fri, 3 Feb 2012 18:25:04 +0000 (+0100) Subject: Produce the time and graphs reports if users_sites is disabled X-Git-Tag: v2.3.3-pre1~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=58c772bb33d79c8f80e2bbdffb6713d17d10c304;p=thirdparty%2Fsarg.git Produce the time and graphs reports if users_sites is disabled 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. --- diff --git a/html.c b/html.c index 84db764..714f86c 100644 --- 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; } diff --git a/report.c b/report.c index f6b6af9..d6d4323 100644 --- 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)) { diff --git a/topuser.c b/topuser.c index b590b5a..7a82a6e 100644 --- a/topuser.c +++ b/topuser.c @@ -285,6 +285,8 @@ void topuser(void) fputs("\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("",fp_top3); posicao++; @@ -444,6 +449,7 @@ void topuser(void) fputs("\n",fp_top3); } + greport_cleanup(); if(ntopuser && (TopUserFields & TOPUSERFIELDS_AVERAGE) != 0) { fputs("",fp_top3); diff --git a/totday.c b/totday.c index dd2bf4a..81f1bf6 100644 --- 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)) {