fprintf(fp_ou,"<body bgcolor=%s text=%s background='%s'>\n",BgColor,TxColor,BgImage);
write_logo_image(fp_ou);
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
show_sarg(fp_ou, "../../..");
else
show_sarg(fp_ou,"..");
fprintf(fp_ou,"<body bgcolor=%s text=%s background='%s'>\n",BgColor,TxColor,BgImage);
write_logo_image(fp_ou);
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
show_sarg(fp_ou, "../../..");
else
show_sarg(fp_ou,"..");
fprintf(fp_ou,"<body bgcolor=\"%s\" text=\"%s\" background=\"%s\">\n",BgColor,TxColor,BgImage);
write_logo_image(fp_ou);
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
show_sarg(fp_ou, "../../..");
else
show_sarg(fp_ou, "..");
write_logo_image(fp_ou);
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
show_sarg(fp_ou, "../../..");
else
show_sarg(fp_ou, "..");
{"AVERAGE",USERREPORTFIELDS_AVERAGE,0},
};
+struct param_list index_values[]=
+{
+ {"yes",INDEX_YES,~INDEX_YES},
+ {"no",INDEX_NO,~INDEX_NO},
+ {"only",INDEX_ONLY,~INDEX_ONLY},
+};
+
+struct param_list index_tree_values[]=
+{
+ {"date",INDEX_TREE_DATE,~INDEX_TREE_DATE},
+ {"file",INDEX_TREE_FILE,~INDEX_TREE_FILE},
+};
+
static int is_param(const char *param,const char *buf)
{
int plen;
if (getparam_string("replace_index",buf,ReplaceIndex,sizeof(ReplaceIndex))>0) return;
- if (getparam_string("index_tree",buf,IndexTree,sizeof(IndexTree))>0) return;
+ if (getparam_list("index_tree",SET_LIST(index_tree_values),buf,&IndexTree)>0) return;
- if (getparam_string("index",buf,Index,sizeof(Index))>0) return;
+ if (getparam_list("index",SET_LIST(index_values),buf,&Index)>0) return;
if (getparam_bool("overwrite_report",buf,&OverwriteReport)>0) return;
write_logo_image(fp_ou);
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
show_sarg(fp_ou, "../../../..");
else
show_sarg(fp_ou, "../..");
if(Privacy)
sprintf(httplink,"<span style=\"color:%s;\">%s</span>",PrivacyStringColor,PrivacyString);
else {
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
sprintf(tmp6,"../%s",ImageFile);
else
strcpy(tmp6,"../../images");
#define USERREPORTFIELDS_TOTAL 0x0080UL
#define USERREPORTFIELDS_AVERAGE 0x0100UL
+#define INDEX_YES 0x0001UL
+#define INDEX_NO 0x0002UL
+#define INDEX_ONLY 0x0004UL
+
+#define INDEX_TREE_DATE 0x0001UL
+#define INDEX_TREE_FILE 0x0002UL
+
FILE *fp_tt;
char outdir[MAXLEN];
int LastLog;
int RemoveTempFiles;
char ReplaceIndex[256];
-char Index[20];
+unsigned long int Index;
int OverwriteReport;
char u2[255];
char RecordsWithoutUser[20];
char hbc8[30];
char hbc9[30];
char hbc10[30];
-char IndexTree[10];
+unsigned long int IndexTree;
int UserAuthentication;
char AuthUserFile[255];
char AuthName[512];
if(LastLog > 0) mklastlog(outdir);
- if(strcmp(Index,"no") == 0) {
+ if(Index == INDEX_NO) {
sprintf(wdir,"%sindex.html",outdir);
if(access(wdir, R_OK) == 0) unlink(wdir);
return;
dirp = opendir(outdir);
while ((direntp = readdir( dirp )) != NULL) {
if(isdigit(direntp->d_name[0]) && isdigit(direntp->d_name[1])) {
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
file_index_to_date_index(direntp->d_name);
else
date_index_to_file_index(direntp->d_name);
}
closedir(dirp);
- if(strcmp(IndexTree,"date") == 0) {
+ if(IndexTree == INDEX_TREE_DATE) {
make_date_index();
} else {
make_file_index();
OverwriteReport=0;
RemoveTempFiles=1;
strcpy(ReplaceIndex,"index.html");
- strcpy(Index,"yes");
+ Index=INDEX_YES;
strcpy(RecordsWithoutUser,"ip");
UseComma=0;
strcpy(MailUtility,"mailx");
Graphs=1;
strcpy(Ulimit,"20000");
strcpy(NtlmUserFormat,"domainname+username");
- strcpy(IndexTree,"file");
+ IndexTree=INDEX_TREE_FILE;
strcpy(RealtimeTypes,"GET,PUT,CONNECT");
strcpy(RealtimeUnauthRec,"show");
SquidguardIgnoreDate=0;
exit(0);
}
- if(strcmp(IndexTree,"file") == 0)
+ if(IndexTree == INDEX_TREE_FILE)
strcpy(ImageFile,"../images");
else
strcpy(ImageFile,"../../../images");
indexonly++;
}
if(strcmp(ExcludeUsers,"indexonly") == 0) indexonly++;
- if(strcmp(Index,"only") == 0) indexonly++;
+ if(Index == INDEX_ONLY) indexonly++;
if(MaxElapsed[0] != '\0') max_elapsed=atol(MaxElapsed);
if(strncmp(df,"e",1) == 0)
sprintf(tbuf, "%02d%s%04d", t->tm_mday, mes, t->tm_year+1900);
if(strncmp(df,"w",1) == 0) {
- strcpy(IndexTree,"file");
+ IndexTree=INDEX_TREE_FILE;
strftime(tbuf, sizeof(tbuf), "%Y.%U", t);
}
fprintf(fp_ou,"<body bgcolor=\"%s\" text=\"%s\" background=\"%s\">\n",BgColor,TxColor,BgImage);
write_logo_image(fp_ou);
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
show_sarg(fp_ou, "../../../..");
else
show_sarg(fp_ou, "../..");
fprintf(fp_tt,"<body bgcolor=\"%s\" text=\"%s\" background=\"%s\">\n",BgColor,TxColor,BgImage);
write_logo_image(fp_tt);
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
show_sarg(fp_tt, "../../../..");
else
show_sarg(fp_tt, "../..");
fprintf(fp_ou,"<body bgcolor=\"%s\" text=\"%s\" background=\"%s\">\n",BgColor,TxColor,BgImage);
write_logo_image(fp_ou);
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
show_sarg(fp_ou, "../../..");
else
show_sarg(fp_ou, "..");
fprintf(fp_ou,"<body bgcolor=%s text=%s background='%s'>\n",BgColor,TxColor,BgImage);
write_logo_image(fp_ou);
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
show_sarg(fp_ou, "../../..");
else
show_sarg(fp_ou,"..");
fprintf(fp_ou,"<body bgcolor=\"%s\" text=\"%s\" background=\"%s\">\n",BgColor,TxColor,BgImage);
write_logo_image(fp_ou);
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
show_sarg(fp_ou,"../../..");
else
show_sarg(fp_ou, "..");
fprintf(fp_top3,"</head>\n<body class=\"body\">");
write_logo_image(fp_top3);
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
show_sarg(fp_top3, "../../..");
else
show_sarg(fp_top3, "..");
fprintf(fp_ht,"<body bgcolor=\"%s\" text=\"%s\" background=\"%s\">\n",BgColor,TxColor,BgImage);
write_logo_image(fp_ht);
- if(strcmp(IndexTree,"date") == 0)
+ if(IndexTree == INDEX_TREE_DATE)
show_sarg(fp_ht, "../../..");
else
show_sarg(fp_ht,"..");
time_t curtime;
struct tm *loctm;
- if(strcmp(IndexTree,"date") == 0) {
+ if(IndexTree == INDEX_TREE_DATE) {
bzero(y1,sizeof(y1));
bzero(y2,sizeof(y2));
bzero(d1,sizeof(d1));
strcpy(dirname,wdir);
- if(strcmp(IndexTree,"date") != 0) {
+ if(IndexTree != INDEX_TREE_DATE) {
if(!OverwriteReport) {
while(num) {
if(access(wdir,R_OK) == 0) {