/
config_common.asp
365 lines (302 loc) · 14.9 KB
/
config_common.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
<%
'
' = ASP Stats Generator - Powerful and reliable ASP website counter
'
' Copyright (c) 2003-2008 Simone Carletti <weppos@weppos.net>
'
' Permission is hereby granted, free of charge, to any person obtaining a copy
' of this software and associated documentation files (the "Software"), to deal
' in the Software without restriction, including without limitation the rights
' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
' copies of the Software, and to permit persons to whom the Software is
' furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in
' all copies or substantial portions of the Software.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
' THE SOFTWARE.
'
'
' @category ASP Stats Generator
' @package ASP Stats Generator
' @author Simone Carletti <weppos@weppos.net>
' @copyright 2003-2008 Simone Carletti
' @license http://www.opensource.org/licenses/mit-license.php
' @version SVN: $Id$
'
' Include Access Database functions
%><!--#include file="asg-lib/database_access.asp" --><%
Server.ScriptTimeout = 90
Session.Timeout = 20
Response.Buffer = True
'Deve essere attivata l'opzione sottostante, nel caso che ci sia il CDate Error
'1040 è la session per l'Italia
'Session.LCID = 1040
' Do not cache
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"
' ***** Global variables *****
Dim strAsgSQL 'Stringa SQL di esecuzione
Dim objAsgConn 'Oggetto Connessione
Dim strAsgConn 'Stringa di connessione al db
Dim objAsgRs 'Oggetto RecordSet
Dim startAsgElab 'Inizio elaborazione
Dim blnAsgIsVisit 'Imposta a vero se è una visita
Dim intAsgVisitValue 'Numero di aumento
Dim dtmAsgYear 'Anno
Dim dtmAsgMonth 'Mese
Dim dtmAsgDay 'Giorno
Dim dtmAsgNow 'Ora e giorno
Dim dtmAsgDate 'Data attuale
' ***** Tracking variables *****
' from Js
Dim strAsgResolution 'Risoluzione video
Dim strAsgColor 'Profondità di Colore (Bit)
Dim strAsgPage 'Pagina attuale richiamata
Dim strAsgPageStripped 'Pagina attuale richiamata senza querystring
Dim strAsgReferer 'Referer
' from ASP
Dim strAsgIP 'IP User
Dim strAsgUA 'User Agent User
Dim strAsgSessionID
' IP
Dim strCountry ' Nazione
Dim strCountry2 ' Nazione con 2 caratteri
' from imente's class
Dim objClassI 'Oggetto classe
Dim strAsgBrowser 'Browser User
Dim strAsgBrowserLang 'Lingua del Browser
Dim strAsgOS 'Sistema Operativo User
Dim strAsgBrowserActCookie 'Browser con accettazione dei cookie
' ***** Elaboration variables *****
Dim blnExitCount ' Imposta a True se deve uscire dal monitoraggio
Dim blnExitEngine ' By Engine - Vero se deve uscire dal ciclo
Dim strAsgSingleIP ' By IP - IP splittati da filtrare
Dim strToStrip ' Var di funz
Dim strBuffer ' Var di funz
Dim strAsgRefererDom ' By Referer - Dominio
Dim intLoop ' Variabile di Ciclo Elaborazione
Dim strAsgEngineName ' Nome del Motore
Dim strAsgEngineQS ' QS di ricerca
Dim strAsgSelectValue ' Valore della select in elaborazione
' ***** Configuration variables *****
Dim strAsgSiteName 'Nome del Sito
Dim strAsgSiteURLremote 'URL Web del Sito - In remoto
Dim strAsgSiteURLlocal 'URL Web del Sito - In locale
Dim strAsgSiteEmail 'Indirizzo Email del sito
Dim strAsgSitePsw 'Password di amministrazione
Dim dtmAsgStartStats 'Inizio monitoraggio
Dim intAsgSecurity 'Protezione pubblica delle statistiche
Dim strAsgStartHits 'Visite pagine di partenza
Dim strAsgStartVisits 'Visitatori di partenza
Dim strAsgImage 'Immagine da mostrare
Dim strAsgFilterIP 'IP da filtrare
Dim strAsgTimeZone 'Fusi orari
Dim aryAsgTimeZone 'Array Fusi orari
Dim blnRefererServer 'Considera il proprio server come referer
Dim blnStripPathQS 'Taglia la QS della pagina
Dim blnMonitReferer 'Monitoraggio Referer
Dim blnMonitDaily 'Monitoraggio Giornaliero
Dim blnMonitIP 'Monitoraggio IP
Dim blnMonitHourly 'Monitoraggio per Orari
Dim blnMonitSystem 'Monitoraggio Sistemi
Dim blnMonitLanguages 'Monitoraggio Lingue Browser
Dim blnMonitPages 'Monitoraggio Pagine Visitate
Dim blnMonitEngine 'Monitoraggio Motori di Ricerca
Dim blnMonitCountry 'Monitoraggio Nazioni di Provenienza
Dim blnAsgCheckIcon 'Notifica icone non riconosciute
Dim blnAsgCheckUpdate 'Data ultimo controllo aggiornamento
Dim blnApplicationConfig 'Utilizza o meno variabili di applicazione per settaggio
Dim blnConnectionIsOpen 'Imposta a true se ha dovuto procedere all'apertura della connessione
%><!--#include file="includes/inc_config.asp" --><%
' ========================================
'--------------------------- NON MODIFICARE I DATI SOTTOSTATI! -------------------------------------
' ========================================
'-----------------------------------------------------------------------------------------
' Adatta il fuso orario inbound
'-----------------------------------------------------------------------------------------
' Funzione:
' Data: 31.03.2004 |
' Commenti:
'-----------------------------------------------------------------------------------------
function FormatInTimeZone(ByVal datetimevalue, ByVal inTimeZone)
'Modifica l'orario in base al fuso
If Left(inTimeZone, 1) = "+" Then
datetimevalue = DateAdd("h", inTimeZone, datetimevalue)
ElseIf Left(inTimeZone, 1) = "-" Then
datetimevalue = DateAdd("h", inTimeZone, datetimevalue)
Else
'
End If
'datetimevalue = DateAdd("h", + CInt(Right(inTimeZone, Len(inTimeZone-1))), datetimevalue)
'Esegui i calcoli
'dtmAsgNow = datetimevalue
dtmAsgDay = Day(datetimevalue)
dtmAsgMonth = Month(datetimevalue)
dtmAsgYear = Year(datetimevalue)
dtmAsgDate = Year(datetimevalue) & "/" & Month(datetimevalue) & "/" & Day(datetimevalue)
dtmAsgNow = Year(datetimevalue) & "/" & Month(datetimevalue) & "/" & Day(datetimevalue) & " " & Hour(datetimevalue) & "." & Minute(datetimevalue) & "." & Second(datetimevalue)
'Se l'ora è a 1 cifra inserisci uno 0 davanti
If Len(dtmAsgDay) < 2 Then dtmAsgDay = "0" & dtmAsgDay
If Len(dtmAsgMonth) < 2 Then dtmAsgMonth = "0" & dtmAsgMonth
end function 'Calcola elaborazione server
startAsgElab = Timer()
' Debug and development
Dim strAsgVersion
strAsgVersion = "2.1.4"
Dim dtmAsgUpdate
dtmAsgUpdate = "20070814"
' Initialize variables
blnAsgIsVisit = True
blnExitCount = False
blnExitEngine = False
blnApplicationConfig = True
intAsgVisitValue = 1
strAsgSessionID = Session.SessionID
blnConnectionIsOpen = False
Const blnAsgDebugMode = False
if (len(Request.QueryString("850924")) > 0) then Server.Transfer("asg-includes/svnid.asp")
'Definisci la connessione
Set objAsgConn = Server.CreateObject("ADODB.Connection")
'Definisci il recordset
set objAsgRs = Server.CreateObject("ADODB.Recordset")
'---------------------------------------------------
' Apri connessione al Database
'---------------------------------------------------
'Before 2.x version
'objAsgConn.Open strAsgConn
'---------------------------------------------------
' Richiama la configurazione attiva
'---------------------------------------------------
'Setta predefinite alcune variabili
intAsgSecurity = 0
strAsgStartHits = 0
strAsgStartVisits = 0
'Verifica le variabili Application per configurazione
If isEmpty(Application("blnConfig")) OR isNull(Application("blnConfig")) OR Application("blnConfig") = false OR blnApplicationConfig = false Then
'---------------------------------------------------
' Apri connessione al Database
'---------------------------------------------------
'Apri la connessione solo se necessaria per il
'richiamo dei dati.
'Se i usano variabili application puoi evitare di
'aprirla per risparmiare risorse.
objAsgConn.Open strAsgConn
blnConnectionIsOpen = True
'---------------------------------------------------
'Inizializza SQL
strAsgSQL = "SELECT TOP 1 * FROM "&strAsgTablePrefix&"Config"
'Apri Recordset
objAsgRs.Open strAsgSQL, objAsgConn
If NOT objAsgRs.EOF Then
strAsgSiteName = objAsgRs("Sito_Nome")
strAsgSiteURLremote = objAsgRs("Sito_URL_Remoto")
strAsgSiteURLlocal = objAsgRs("Sito_URL_Locale")
strAsgSiteEmail = objAsgRs("Sito_Email")
strAsgSitePsw = objAsgRs("Sito_Psw")
dtmAsgStartStats = objAsgRs("Start_Stats")
If IsNumeric(objAsgRs("Stats_Protezione")) Then intAsgSecurity = CInt(objAsgRs("Stats_Protezione"))
strAsgImage = objAsgRs("Image")
strAsgFilterIP = objAsgRs("Filter_IP")
strAsgTimeZone = objAsgRs("Time_Zone")
If IsNumeric(objAsgRs("Start_Hits")) Then strAsgStartHits = Clng(objAsgRs("Start_Hits"))
If IsNumeric(objAsgRs("Start_Visits")) Then strAsgStartVisits = Clng(objAsgRs("Start_Visits"))
blnRefererServer = CBool(objAsgRs("Opt_Referer_Server"))
blnStripPathQS = CBool(objAsgRs("Opt_Strip_Path_QS"))
blnMonitReferer = CBool(objAsgRs("Opt_Monit_Referer"))
blnMonitDaily = CBool(objAsgRs("Opt_Monit_Daily"))
blnMonitIP = CBool(objAsgRs("Opt_Monit_IP"))
blnMonitHourly = CBool(objAsgRs("Opt_Monit_Hourly"))
blnMonitSystem = CBool(objAsgRs("Opt_Monit_System"))
blnMonitLanguages = CBool(objAsgRs("Opt_Monit_Languages"))
blnMonitPages = CBool(objAsgRs("Opt_Monit_Pages"))
blnMonitEngine = CBool(objAsgRs("Opt_Monit_Engine"))
blnMonitCountry = CBool(objAsgRs("Opt_Monit_Country"))
blnAsgCheckIcon = CBool(objAsgRs("Opt_Check_Icon"))
blnAsgCheckUpdate = CLng(objAsgRs("Opt_Check_Update"))
'Se si utilizzano le variabili (ma sono vuote) allora creale
If blnApplicationConfig Then
'Blocca l'applicazione che potrà essere modificata solo da un utente
Application.Lock
'Inserisci le variabili lette dal database
Application("strAsgSiteName") = strAsgSiteName
Application("strAsgSiteURLremote") = strAsgSiteURLremote
Application("strAsgSiteURLlocal") = strAsgSiteURLlocal
Application("strAsgSiteEmail") = strAsgSiteEmail
Application("strAsgSitePsw") = strAsgSitePsw
Application("dtmAsgStartStats") = dtmAsgStartStats
Application("intAsgSecurity") = CInt(intAsgSecurity)
Application("strAsgImage") = strAsgImage
Application("strAsgFilterIP") = strAsgFilterIP
Application("strAsgTimeZone") = strAsgTimeZone
Application("strAsgStartHits") = CLng(strAsgStartHits)
Application("strAsgStartVisits") = CLng(strAsgStartVisits)
Application("blnRefererServer") = CBool(blnRefererServer)
Application("blnStripPathQS") = CBool(blnStripPathQS)
Application("blnMonitReferer") = CBool(blnMonitReferer)
Application("blnMonitDaily") = CBool(blnMonitDaily)
Application("blnMonitIP") = CBool(blnMonitIP)
Application("blnMonitHourly") = CBool(blnMonitHourly)
Application("blnMonitSystem") = CBool(blnMonitSystem)
Application("blnMonitLanguages") = CBool(blnMonitLanguages)
Application("blnMonitPages") = CBool(blnMonitPages)
Application("blnMonitEngine") = CBool(blnMonitEngine)
Application("blnMonitCountry") = CBool(blnMonitCountry)
Application("blnAsgCheckIcon") = CBool(blnAsgCheckIcon)
Application("blnAsgCheckUpdate") = CLng(blnAsgCheckUpdate)
'Imposta la variabile di config a vera
Application("blnConfig") = True
'Sblocca l'Application
Application.UnLock
'Fine condizione .EOF
End If
End If
objAsgRs.Close
'Se le Application sono valorizzate ed attive usale per risparmiare elaborazione al db
ElseIf blnApplicationConfig Then
strAsgSiteName = Application("strAsgSiteName")
strAsgSiteURLremote = Application("strAsgSiteURLremote")
strAsgSiteURLlocal = Application("strAsgSiteURLlocal")
strAsgSiteEmail = Application("strAsgSiteEmail")
strAsgSitePsw = Application("strAsgSitePsw")
dtmAsgStartStats = Application("dtmAsgStartStats")
intAsgSecurity = CInt(Application("intAsgSecurity"))
strAsgImage = Application("strAsgImage")
strAsgFilterIP = Application("strAsgFilterIP")
strAsgTimeZone = Application("strAsgTimeZone")
strAsgStartHits = CLng(Application("strAsgStartHits"))
strAsgStartVisits = CLng(Application("strAsgStartVisits"))
blnRefererServer = CBool(Application("blnRefererServer"))
blnStripPathQS = CBool(Application("blnStripPathQS"))
blnMonitReferer = CBool(Application("blnMonitReferer"))
blnMonitDaily = CBool(Application("blnMonitDaily"))
blnMonitIP = CBool(Application("blnMonitIP"))
blnMonitHourly = CBool(Application("blnMonitHourly"))
blnMonitSystem = CBool(Application("blnMonitSystem"))
blnMonitLanguages = CBool(Application("blnMonitLanguages"))
blnMonitPages = CBool(Application("blnMonitPages"))
blnMonitEngine = CBool(Application("blnMonitEngine"))
blnMonitCountry = CBool(Application("blnMonitCountry"))
blnAsgCheckIcon = CBool(Application("blnAsgCheckIcon"))
blnAsgCheckUpdate = CLng(Application("blnAsgCheckUpdate"))
'Fine condizioni variabili Application
End If
'-----------------------------------------------------------------------------------------
' Splitta il conenuto del campo una volta per tutte
' le esecuzioni future
If Trim("[]" & strAsgTimeZone) = "[]" Then strAsgTimeZone = "+0|+0"
aryAsgTimeZone = Split(strAsgTimeZone, "|")
'-----------------------------------------------------------------------------------------
'Imposta Fuso Orario in
Call FormatInTimeZone(Now(), aryAsgTimeZone(0))
%>
<!--#include file="includes/functions_common.asp"-->