long long int totelap=0, totelap2=0, nnelap=0, unelap=0, tnelap=0;
long long int incache=0, oucache=0, tnincache=0, tnoucache=0, twork=0;
long long int ltemp;
- long long int ntotuser=1;
+ long long int ntotuser;
long long int userbytes, userelap;
char *buf;
- char arqin[MAXLEN], arqou[MAXLEN], arqper[MAXLEN], arqip[MAXLEN];
+ char arqin[MAXLEN], arqou[MAXLEN], arqip[MAXLEN];
char *url, tmsg[50], csort[MAXLEN];
char duser[MAXLEN];
char user_ip[MAXLEN], olduserip[MAXLEN], tmp2[MAXLEN], tmp3[MAXLEN];
char warea[MAXLEN];
- char totuser[8];
char tmp6[MAXLEN];
char *user_url;
long long int tnacc=0, ttnacc=0, unacc=0;
int have_denied_report;
const char *sort_field;
const char *sort_order;
- const char *user;
char siteind[MAX_TRUNCATED_URL];
struct getwordstruct gwarea;
longline line,line1;
tnacc=globstat.nacc;
totbytes=globstat.nbytes;
totelap=globstat.elap;
-
- if ((ReportType & REPORT_TYPE_TOPUSERS) != 0) {
- snprintf(arqper,sizeof(arqper),"%s/sarg-users",outdirname);
- if ((fp_in = fopen(arqper, "r")) == 0){
- debuga(_("(html11) Cannot open file %s - %s\n"),arqper,strerror(errno));
- exit(EXIT_FAILURE);
- }
- if (!fgets(totuser,sizeof(totuser),fp_in)) {
- debuga(_("(html11) read error in %s\n"),arqper);
- exit(EXIT_FAILURE);
- }
- fclose(fp_in);
- ntotuser=my_atoll(totuser);
- if (ntotuser<=0) ntotuser=1;
- }
+ ntotuser=globstat.totuser;
greport_prepare();
exit(EXIT_FAILURE);
}
while ( (uinfo = userinfo_advancescan(uscan)) != NULL ) {
- user=uinfo->filename;
+ if (!uinfo->topuser) {
+ continue;
+ }
+ tmpsort(uinfo);
- if (snprintf(warea,sizeof(warea),"%s/%s",outdirname,user)>=sizeof(warea)) {
- debuga(_("Destination directory too long: %s/%s\n"),outdirname,user);
+ if (snprintf(warea,sizeof(warea),"%s/%s",outdirname,uinfo->filename)>=sizeof(warea)) {
+ debuga(_("Destination directory too long: %s/%s\n"),outdirname,uinfo->filename);
exit(EXIT_FAILURE);
}
if (access(warea, R_OK) != 0) {
report_day(uinfo);
greport_day(uinfo);
- if (snprintf(arqin,sizeof(arqin),"%s/%s.txt",tmp,uinfo->filename)>=sizeof(arqin)) {
- debuga(_("Input file name too long: %s/%s.txt\n"),tmp,uinfo->filename);
+ 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);
}
if ((fp_in = fopen(arqin, "r")) == 0){