%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' ASPCode CMS 1.5.6 '
' Copyright © 2001-2008 ASPCodeCMS.com '
' http://www.aspcodecms.com/ '
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
%>
<%
option explicit
dim timerStart, timerEnd, timerSpan
timerStart = timer()
response.buffer = true
%>
<%
%>
<%
' ******************************************************************************************************************************************
dim api
set api = new ASPCodeCMS
dim a1, a2, a3, a4
dim idx
if(api.IsAjaxRequest)then
Execute(IncludeFile("aspajax/aspajax.asp"))
else
call Main()
end if
set api = nothing
' ******************************************************************************************************************************************
' ******************************************************************************************************************************************
' ******************************************************************************************************************************************
function Main()
if(api.GetConfig("enable_debug"))then
session("cms" & siteID & "_debugQueryCount") = 0
session("cms" & siteID & "_debugQueryLog") = ""
end if
Server.ScriptTimeOut = api.GetConfig("server_scripttimeout")
if(isDemo)then
call api.SetConfig("templates_directory", "public/templates/")
else
if(api.GetConfig("templates_directory") = "")then
call api.SetConfig("templates_directory", "public/templates/")
end if
end if
dim rs, sql
a1 = request.querystring("a1")
a2 = request.querystring("a2")
a3 = request.querystring("a3")
a4 = request.querystring("a4")
idx = cint(request.querystring("idx"))
dim licenseStatus
licenseStatus = CheckLicense()
' licenseStatus = "ok"
if(licenseStatus = "ok")then
session("cms" & siteID & "_serialnumberok") = "true"
else
session("cms" & siteID & "_serialnumberok") = "false"
if(licenseStatus="no_serial")then
sql = "SELECT COUNT(*) AS CNT FROM [section] WHERE [ENABLED] = true"
set rs = api.ExecuteQuery(sql)
if(cint(rs("CNT")) > 10)then
response.write("
E' stato raggiunto il
numero massimo di sezioni gestibili con la versione
Personal di ASPCode CMS.
" &_
"Per continuare ad utilizzare il CMS puoi acquistare una licenza del software su
http://www.aspcodecms.com/Puoi inserire il tuo numero di licenza
accedendo come amministratore e aprendo il menu 'Licenza software'
")
if(a1 <> "admin" and a1 <> "login")then
response.end()
end if
end if
rs.close()
set rs = nothing
elseif(licenseStatus="wrong_serial")then
response.write("
")
if(a1 <> "admin" and a1 <> "login")then
response.end()
end if
end if
end if
select case a1
case "login"
call LoginByForm(request.form("username"), request.form("password"))
case "logout"
call LogOut()
end select
if len(session("cms" & siteID & "UserID"))=0 and len(request.cookies("cms" & siteID)("UserName"))>0 and len(request.cookies("cms" & siteID)("Password"))>0 then
call LoginByCookie(request.cookies("cms" & siteID)("UserName"), request.cookies("cms" & siteID)("Password"))
end if
session("cms" & siteID & "editorWriteDirPath") = GetAssetsPath()
if(not api.IsUploaderPost)then
' language section - start
if(len(request("langid"))>0)then
'api.debug request("langid")
session("cms" & siteID & "_languageID") = request("langid")
api.languageID = cint(request("langid"))
if(api.languageID > 1)then
api.languageFieldSuffix = "_LANG" & api.languageID
else
api.languageFieldSuffix = ""
end if
api.LoadLanguageAcronym()
' reload configuration
api.LoadConfiguration()
end if
api.LoadLanguageFile(api.WebSiteDirectory)
' language section - end
end if
' admin section - start
if(api.CanEditContent())then
select case a1
case "update"
if(not api.blnPreview_)then
api.UpdateObject(api.editObjectID)
dim sectionID
sectionID = api.sectionID
set api = nothing
response.redirect("default.asp?sec=" & sectionID)
end if
end select
end if
' admin section - end
if(len(session("cms" & siteID & "_cfg_template"))=0)then
session("cms" & siteID & "_cfg_template") = "default"
end if
if(len(api.urlRedirect)>0)then
dim urlRedirect
urlRedirect = api.urlRedirect
set api = nothing
response.redirect(urlRedirect)
end if
call LoadTemplate()
if(licenseStatus <> "ok" or blnShowCopyright)then
dim personalEditionTracker
if(licenseStatus <> "ok")then
personalEditionTracker = "background: url(http://www.aspcodecms.com/default.asp?sec=41&ma1=track&product_version=" & product_version & "&build=" & product_release & "&url=" & server.urlencode(api.GetUrlWithOutFileName()) & ") -1000px -1000px no-repeat; "
end if
response.write("")
end if
timerEnd = timer()
timerSpan = timerEnd - timerStart
timerSpan = FormatNumber(timerSpan, 3)
if(api.role = ROLE_SUPERADMIN or api.role = ROLE_ADMIN or (api.role = ROLE_EDITOR and not api.GetConfig("mod_users_hide_admin_panel_for_non_admin")))then
%>
<%
if(api.role = ROLE_SUPERADMIN and api.GetConfig("enable_debug"))then
%>
Tempo di esecuzione della pagina: <%=timerSpan%> sec.
<%
if(len(session("cms" & siteID & "_modulesLateralBoxLoadingTime")) > 0)then
%>
Tempo di caricamento box laterali:
<%
dim arrTmp
arrTmp = split(session("cms" & siteID & "_modulesLateralBoxLoadingTime"), "#")
dim i
for i = 0 to ubound(arrTmp)
dim arrTmp2
arrTmp2 = split(arrTmp(i), "|")
%>
<%=arrTmp2(0)%> |
<%=formatnumber(arrTmp2(1), 3)%> sec. |
<%
next
%>
<%
end if
%>
Versione script engine: <%=GetScriptEngineInfo()%>
Numero di query eseguite: <%=session("cms" & siteID & "_debugQueryCount")%>
Log query:<%=session("cms" & siteID & "_debugQueryLog")%>
Collezione ServerVariables:
<%call api.ShowServerVariables()%>
<%
session("cms" & siteID & "_debugQueryCount") = 0
end if
end if
end function
' ******************************************************************************************************************************************
' ******************************************************************************************************************************************
function CheckLicense()
dim result
dim domain, domain2
domain = Request.ServerVariables("HTTP_HOST")
domain = replace(domain, "www.", "")
dim i
for i=1 to len(domain)
if(true)then
domain2 = domain2 & mid(domain, i, 1)
end if
next
result = "no_serial"
if false then
result = "ok"
else
dim sn
if(api.FieldExists("version", "SERIAL_NUMBER"))then
dim rs, sql
sql = "SELECT [SERIAL_NUMBER] FROM [version]"
set rs = api.ExecuteQuery(sql)
sn = rs("SERIAL_NUMBER")
rs.close()
set rs = nothing
end if
if(len(sn) > 0)then
serial_number = sn
end if
if(len(serial_number)=0)then
result = "no_serial"
elseif(ucase(serial_number)=crea(domain2))then
result = "ok"
else
result = "wrong_serial"
end if
end if
CheckLicense = result
end function
' ******************************************************************************************************************************************
function reverse(str)
dim swap
swap = ""
dim i
for i=len(str) to 1 step -1
swap = swap & mid(str, i, 1)
next
reverse = swap
end function
' ******************************************************************************************************************************************
function sommaAlfabetica(primo, secondo)
dim str
str = ""
dim num
num = 0
dim f
f = 4
dim i
i = 0
for i=1 to f
dim j, num1, num2
for j=0 to ubound(lettere)
if(lettere(j)=mid(primo, i, 1))then
num1 = j
end if
next
for j=0 to ubound(lettere)
if(lettere(j)=mid(secondo, i, 1))then
num2 = j
end if
next
num = num1 + num2
if(num>=ubound(lettere)+1)then
num = num - ubound(lettere)-1
end if
str = str & lettere(num)
next
sommaAlfabetica = str
end function
' ******************************************************************************************************************************************
function sommaNumerica(primo, secondo)
dim str, swap
str = ""
swap = ""
dim num
num = 0
dim f
f = 3
dim i
i = 0
for i=f+1 to 1 step -1
dim j, num1, num2
for j=0 to ubound(lettere)
if(lettere(j)=mid(primo, i, 1))then
num1 = j
end if
next
for j=0 to ubound(lettere)
if(lettere(j)=mid(secondo, i, 1))then
num2 = j
end if
next
num = num + num1 + num2
swap = cstr(num)
str = str & mid(swap, len(swap), 1)
if(num>9)then
num = cint(mid(swap, len(swap)-1, 1))
else
num = 0
end if
next
sommaNumerica = reverse(str)
end function
' ******************************************************************************************************************************************
function crea(text)
dim str
str = text
dim sn(3)
dim swap
swap = ""
sn(0) = sommaAlfabetica(reverse(mid(str, 1, 4)), "aspc")
sn(1) = sommaAlfabetica(reverse(mid(str, len(str)-3, 4)), "acms")
sn(2) = sommaNumerica(mid(str, 1, 4), "acms")
sn(3) = sommaNumerica(mid(str, len(str)-3, 4), "aspc")
crea = ucase(sn(0)) & "-" & ucase(sn(1)) & "-" & sn(2) & "-" & sn(3)
end function
' ******************************************************************************************************************************************
' ******************************************************************************************************************************************
%>
<%
' ******************************************************************************************************************************************
' Funzione che rileva la versione di VBScript installata sul vostro server IIS
Function GetScriptEngineInfo()
' Dichiariamo la variabile stringa che conterrą tutte le info rilevate
Dim sVersione
sVersione = ""
sVersione = ScriptEngine & " ver."
sVersione = sVersione & ScriptEngineMajorVersion & "."
sVersione = sVersione & ScriptEngineMinorVersion & "."
sVersione = sVersione & ScriptEngineBuildVersion
' Restituiamo la stringa finale
GetScriptEngineInfo = sVersione
End Function
' ******************************************************************************************************************************************
%>