]>
Commit | Line | Data |
---|---|---|
1 | #include "config.h" | |
2 | #include "info.h" | |
3 | ||
4 | #ifdef HAVE_WINDOWS_H | |
5 | #include <windows.h> | |
6 | #endif | |
7 | #ifdef HAVE_STDIO_H | |
8 | #include <stdio.h> | |
9 | #endif | |
10 | #ifdef HAVE_STDLIB_H | |
11 | #include <stdlib.h> | |
12 | #endif | |
13 | #ifdef HAVE_STRING_H | |
14 | #include <string.h> | |
15 | #endif | |
16 | #ifdef HAVE_STRINGS_H | |
17 | #include <strings.h> | |
18 | #endif | |
19 | #ifdef HAVE_SYS_TIME_H | |
20 | #include <sys/time.h> | |
21 | #endif | |
22 | #ifdef HAVE_TIME_H | |
23 | #include <time.h> | |
24 | #endif | |
25 | #ifdef HAVE_SYS_RESOURCE_H | |
26 | #include <sys/resource.h> | |
27 | #endif | |
28 | #ifdef HAVE_UNISTD_H | |
29 | #include <unistd.h> | |
30 | #endif | |
31 | #if defined(HAVE_SYS_DIRENT_H) && !defined(HAVE_DIRENT_H) | |
32 | #include <sys/dirent.h> | |
33 | #endif | |
34 | #ifdef HAVE_DIRENT_H | |
35 | #include <dirent.h> | |
36 | #endif | |
37 | #ifdef HAVE_SYS_SOCKET_H | |
38 | #include <sys/socket.h> | |
39 | #endif | |
40 | #ifdef HAVE_NETDB_H | |
41 | #include <netdb.h> | |
42 | #endif | |
43 | #ifdef HAVE_TYPES_H | |
44 | #include <types.h> | |
45 | #endif | |
46 | #ifdef HAVE_NETINET_IN_H | |
47 | #include <netinet/in.h> | |
48 | #endif | |
49 | #ifdef HAVE_ARPA_INET_H | |
50 | #include <arpa/inet.h> | |
51 | #endif | |
52 | #ifdef HAVE_SYS_STAT_H | |
53 | #include <sys/stat.h> | |
54 | #endif | |
55 | #ifdef HAVE_CTYPE_H | |
56 | #include <ctype.h> | |
57 | #endif | |
58 | #ifdef HAVE_ERRNO_H | |
59 | #include <errno.h> | |
60 | #endif | |
61 | #ifdef HAVE_SYS_WAIT_H | |
62 | #include <sys/wait.h> | |
63 | #endif | |
64 | #ifdef HAVE_GD_H | |
65 | #include <gd.h> | |
66 | #define HAVE_GD | |
67 | gdImagePtr im; | |
68 | gdPoint points[4]; | |
69 | #endif | |
70 | #ifdef HAVE_GDFONTL_H | |
71 | #include <gdfontl.h> | |
72 | #endif | |
73 | #ifdef HAVE_GDFONTT_H | |
74 | #include <gdfontt.h> | |
75 | #endif | |
76 | #ifdef HAVE_GDFONTS_H | |
77 | #include <gdfonts.h> | |
78 | #endif | |
79 | #ifdef HAVE_GDFONTMB_H | |
80 | #include <gdfontmb.h> | |
81 | #endif | |
82 | #ifdef HAVE_GDFONTG_H | |
83 | #include <gdfontg.h> | |
84 | #endif | |
85 | #ifdef HAVE_STDARG_H | |
86 | #include <stdarg.h> | |
87 | #endif | |
88 | #ifdef HAVE_INTTYPES_H | |
89 | #include <inttypes.h> | |
90 | #endif | |
91 | #ifdef HAVE_LIMITS_H | |
92 | #include <limits.h> | |
93 | #endif | |
94 | #ifdef HAVE_WINSOCK_H | |
95 | #include <winsock.h> | |
96 | #endif | |
97 | #ifdef HAVE_LOCALE_H | |
98 | #include <locale.h> | |
99 | #endif | |
100 | ||
101 | #if defined(HAVE_FOPEN64) | |
102 | #define _FILE_OFFSET_BITS 64 | |
103 | #define MY_FOPEN fopen64 | |
104 | #else | |
105 | #define MY_FOPEN fopen | |
106 | #endif | |
107 | ||
108 | #if !defined(HAVE_BZERO) | |
109 | #define bzero(mem,size) memset(mem,0,size) | |
110 | #endif | |
111 | ||
112 | #if defined(IBERTY_LIB) && !defined(HAVE_MKSTEMP) | |
113 | int mkstemps(char *template, int suffixlen); | |
114 | #define mkstemp(template) mkstemps(template,0) | |
115 | #endif | |
116 | ||
117 | #if defined(__MINGW32__) | |
118 | #define mkdir(p,m) _mkdir(p) | |
119 | ||
120 | #ifndef WIFEXITED | |
121 | #define WIFEXITED(S) 1 | |
122 | #endif | |
123 | ||
124 | #ifndef WEXITSTATUS | |
125 | #define WEXITSTATUS(S) (S) | |
126 | #endif | |
127 | ||
128 | #endif /*__MINGW32__*/ | |
129 | ||
130 | #define MAXLEN 20000 | |
131 | #define MAXLOGS 255 | |
132 | ||
133 | long long int my_atoll (const char *nptr); | |
134 | ||
135 | FILE *fp_tt; | |
136 | ||
137 | char outdir[MAXLEN]; | |
138 | char dirname[MAXLEN]; | |
139 | char buf[MAXLEN]; | |
140 | char url[MAXLEN]; | |
141 | char urly[MAXLEN]; | |
142 | char user[MAXLEN]; | |
143 | char period[MAXLEN]; | |
144 | char msg[1024]; | |
145 | char per_hour[128]; | |
146 | char code[MAXLEN]; | |
147 | char code2[MAXLEN]; | |
148 | char tmp[MAXLEN]; | |
149 | char tmp2[MAXLEN]; | |
150 | char tmp3[MAXLEN]; | |
151 | char tmp4[MAXLEN]; | |
152 | char tmp5[MAXLEN]; | |
153 | char tmp6[MAXLEN]; | |
154 | char tmp7[MAXLEN]; | |
155 | char parse_out[MAXLEN]; | |
156 | char arqtt[MAXLEN]; | |
157 | char html[MAXLEN]; | |
158 | char datestimes[MAXLEN]; | |
159 | char ConfigFile[MAXLEN]; | |
160 | char href[MAXLEN]; | |
161 | char href2[MAXLEN]; | |
162 | char href3[MAXLEN]; | |
163 | char df[20]; | |
164 | char day[3], month[4], year[5]; | |
165 | char nmonth[30]; | |
166 | char ltext110[50]; | |
167 | char cdfrom[30]; | |
168 | char cduntil[30]; | |
169 | char LastLog[5]; | |
170 | char RemoveTempFiles[4]; | |
171 | char ReplaceIndex[256]; | |
172 | char Index[20]; | |
173 | char OverwriteReport[4]; | |
174 | char u2[255]; | |
175 | char RecordsWithoutUser[20]; | |
176 | char UseComma[4]; | |
177 | char MailUtility[PATH_MAX]; | |
178 | char TopSitesNum[20]; | |
179 | int TopUsersNum; | |
180 | char ExcludeCodes[256]; | |
181 | char TopsitesSortField[15]; | |
182 | char TopsitesSortType[20]; | |
183 | char ReportType[255]; | |
184 | char UserTabFile[255]; | |
185 | char warea[MAXLEN]; | |
186 | char name[MAXLEN]; | |
187 | int LongUrl; | |
188 | int Ip2Name; | |
189 | char language[255]; | |
190 | char bufy[MAXLEN]; | |
191 | int NAccessLog; | |
192 | char AccessLog[MAXLOGS][MAXLEN]; | |
193 | int AccessLogFromCmdLine; | |
194 | char Title[MAXLEN]; | |
195 | char BgColor[MAXLEN]; | |
196 | char BgImage[MAXLEN]; | |
197 | char TxColor[MAXLEN]; | |
198 | char TxBgColor[MAXLEN]; | |
199 | char TiColor[MAXLEN]; | |
200 | char LogoImage[MAXLEN]; | |
201 | char LogoText[MAXLEN]; | |
202 | char LogoTextColor[MAXLEN]; | |
203 | char Width[MAXLEN]; | |
204 | char Height[MAXLEN]; | |
205 | char FontFace[MAXLEN]; | |
206 | char HeaderColor[MAXLEN]; | |
207 | char HeaderBgColor[MAXLEN]; | |
208 | char FontSize[MAXLEN]; | |
209 | char PasswdFile[MAXLEN]; | |
210 | char TempDir[MAXLEN]; | |
211 | char OutputDir[MAXLEN]; | |
212 | char OutputEmail[MAXLEN]; | |
213 | char TopuserSortField[30]; | |
214 | char UserSortField[30]; | |
215 | char TopuserSortOrder[10]; | |
216 | char UserSortOrder[10]; | |
217 | char UserAgentLog[255]; | |
218 | char module[255]; | |
219 | char ExcludeHosts[255]; | |
220 | char ExcludeUsers[255]; | |
221 | char DateFormat[2]; | |
222 | char PerUserLimitFile[255]; | |
223 | char PerUserLimit[20]; | |
224 | int UserIp; | |
225 | char MaxElapsed[255]; | |
226 | char datetimeby[10]; | |
227 | char csort[255]; | |
228 | char CharSet[255]; | |
229 | char UserInvalidChar[255]; | |
230 | char Graphs[5]; | |
231 | char GraphDaysBytesBarColor[255]; | |
232 | char Privacy[10]; | |
233 | char PrivacyString[255]; | |
234 | char PrivacyStringColor[30]; | |
235 | char IncludeUsers[MAXLEN]; | |
236 | char ExcludeString[MAXLEN]; | |
237 | char SuccessfulMsg[5]; | |
238 | char TopUserFields[255]; | |
239 | char UserReportFields[255]; | |
240 | char DataFile[MAXLEN]; | |
241 | char DataFileDelimiter[3]; | |
242 | char DataFileFields[MAXLEN]; | |
243 | char DataFileUrl[20]; | |
244 | char SiteUserTimeDateType[10]; | |
245 | char ShowReadStatistics[5]; | |
246 | char IndexSortOrder[5]; | |
247 | char DansGuardianConf[MAXLEN]; | |
248 | char DansguardianIgnoreDate[10]; | |
249 | char SquidGuardConf[MAXLEN]; | |
250 | char SquidGuarddbHome[255]; | |
251 | char SquidGuardLogFormat[MAXLEN]; | |
252 | char SquidGuardLogAlternate[MAXLEN]; | |
253 | char SquidguardIgnoreDate[10]; | |
254 | char ShowSargInfo[5]; | |
255 | char BytesInSitesUsersReport[10]; | |
256 | char ShowSargLogo[5]; | |
257 | char ParsedOutputLog[MAXLEN]; | |
258 | char ParsedOutputLogCompress[255]; | |
259 | char DisplayedValues[20]; | |
260 | char HeaderFontSize[5]; | |
261 | char TitleFontSize[5]; | |
262 | char wwwDocumentRoot[MAXLEN]; | |
263 | char ExternalCSSFile[MAXLEN]; | |
264 | char BlockIt[255]; | |
265 | char BlockImage[512]; | |
266 | char NtlmUserFormat[30]; | |
267 | char hbc1[30]; | |
268 | char hbc2[255]; | |
269 | char hbc3[30]; | |
270 | char hbc4[30]; | |
271 | char hbc5[30]; | |
272 | char hbc6[30]; | |
273 | char hbc7[30]; | |
274 | char hbc8[30]; | |
275 | char hbc9[30]; | |
276 | char hbc10[30]; | |
277 | char IndexTree[10]; | |
278 | char UserAuthentication[10]; | |
279 | char AuthUserFile[255]; | |
280 | char AuthName[512]; | |
281 | char AuthType[255]; | |
282 | char Require[512]; | |
283 | char *userfile; | |
284 | char *str; | |
285 | char *str2; | |
286 | char text[200][255]; | |
287 | char val1[MAXLEN]; | |
288 | char val2[MAXLEN]; | |
289 | char val3[MAXLEN]; | |
290 | char val4[MAXLEN]; | |
291 | char val5[MAXLEN]; | |
292 | char val6[MAXLEN]; | |
293 | char val7[MAXLEN]; | |
294 | char val8[MAXLEN]; | |
295 | char val9[MAXLEN]; | |
296 | char val10[MAXLEN]; | |
297 | char val11[MAXLEN]; | |
298 | char wwork1[MAXLEN]; | |
299 | char wwork2[MAXLEN]; | |
300 | char wwork3[MAXLEN]; | |
301 | char mask[MAXLEN]; | |
302 | char httplink[MAXLEN]; | |
303 | char html_old[MAXLEN]; | |
304 | char site[MAXLEN]; | |
305 | char us[50]; | |
306 | char email[MAXLEN]; | |
307 | char test[1]; | |
308 | char ouser2[255]; | |
309 | char user2[MAXLEN]; | |
310 | char wentp[512]; | |
311 | char addr[MAXLEN]; | |
312 | char Ulimit[6]; | |
313 | char RealtimeTypes[1024]; | |
314 | char cmd[255]; | |
315 | char ImageFile[255]; | |
316 | char tbuf[128]; | |
317 | char ip[25]; | |
318 | char RealtimeUnauthRec[15]; | |
319 | ||
320 | int idate; | |
321 | int smartfilter; | |
322 | int denied_count; | |
323 | int download_count; | |
324 | int authfail_count; | |
325 | int dansguardian_count; | |
326 | int squidguard_count; | |
327 | int limit_flag; | |
328 | int color1; | |
329 | int color2; | |
330 | int color3; | |
331 | int z1, z2, z3; | |
332 | int ttopen; | |
333 | int ind2; | |
334 | int sarglog; | |
335 | int isalog; | |
336 | int dfrom; | |
337 | int duntil; | |
338 | int dataonly; | |
339 | int indexonly; | |
340 | int iprel; | |
341 | int userip; | |
342 | int langcode; | |
343 | int debug; | |
344 | int debugz; | |
345 | int debugm; | |
346 | int AuthfailReportLimit; | |
347 | int DeniedReportLimit; | |
348 | int DownloadReportLimit; | |
349 | int SiteUsersReportLimit; | |
350 | int DansGuardianReportLimit; | |
351 | int SquidGuardReportLimit; | |
352 | int UserReportLimit; | |
353 | int dotinuser; | |
354 | int realtime_refresh; | |
355 | int realtime_access_log_lines; | |
356 | int realt; | |
357 | int rc; | |
358 | int ntopsites; | |
359 | int nsitesusers; | |
360 | int nrepday; | |
361 | int ndownload; | |
362 | int ntopuser; | |
363 | int squid24; | |
364 | float perc; | |
365 | ||
366 | long long int nocost; | |
367 | float cost; | |
368 | ||
369 | typedef struct | |
370 | { int list[ 24 ]; | |
371 | int len; | |
372 | } numlist; | |
373 | ||
374 | DIR *dirp; | |
375 | struct dirent *direntp; |