% ' Fruibile - L'elemento CMS Open Source che mancava ' Copyright (C) 2002-2006 Roberto Scano ' ' Licensed under the terms of the GNU Lesser General Public License: ' http://www.opensource.org/licenses/lgpl-license.php ' ' For further information visit: ' http://www.fruibile.it/ ' ' File Author: ' Roberto Scano (mail@robertoscano.info) %> <% 'controllo sicurezza -------------- if Session("WEBGODLogin") <> "W3C_VALIDATOR" then If session("testi")<> 1 Then response.Redirect "/backoffice/noentry.asp" end if end if '---------------------------------- 'Prevent your website from cross website attacks --------- refererUrl = Cstr(Request.ServerVariables("HTTP_REFERER")) serverName = Cstr(Request.ServerVariables("SERVER_NAME")) refererName = mid(refererUrl,8,len(serverName)) if refererName <> serverName then response.Redirect "/backoffice/noentry.asp" response.end end if '--------------------------------------------------------- %> <% percorso = " " & DICLanguage(182) %> <% ManuId = Trim(replace(Request("CatId"),"'","''")) lingua = split(Session("editlanguage"),",") if request("lastpage") <> "" then Session("lastpage") = request("lastpage") else Session("lastpage") = Request.ServerVariables("HTTP_REFERER") end if if Session("supervisor") = true then aggiunta_sql = "" aggiunta_where_sql = "" else aggiunta_sql = " and office_id=" & Session("Office_ID") aggiunta_where_sql = " where office_id=" & Session("Office_ID") end if 'Imposta la funzione da utilizzare If Request("Update") <> "" Then strfunction = "Update" Elseif Request("Delete") <> "" Then strfunction = "Deletewait" Elseif Request("Deleteok") <> "" Then strfunction = "Delete" Elseif Request("Add") <> "" Then strfunction = "addmanu" Elseif Request("Back") <> "" then response.redirect Session("lastpage") End If Function DeleteManu (ManuID) Set RSdel = Server.CreateObject("ADODB.Recordset") sql = "DELETE FROM " & application("prefix") & "testi WHERE Id = " & ManuID & aggiunta_sql SET RSdel = conn.execute(sql) SET RSdel = nothing End Function Function UpdateManu (ManuID) Dim strSQL, rs If Request("title_" & Session("Language")) = "" and Session("translator") <> true Then UpdateManu = -1 Else Set objRS2 = Server.CreateObject("ADODB.Recordset") sql = "select * FROM " & application("prefix") & "testi WHERE Id = " & ManuID & aggiunta_sql objRS2.open sql, conn, adOpenStatic, adLockOptimistic If objRS2.EOF AND objRS2.BOF then UpdateManu = -10 else if Session("supervisor") = true or Session("reviewer") = true or Session("poweruser") = true then if request("proprietario") <> "" then rs_proprietario = request("proprietario") else rs_proprietario = 1 end if else rs_proprietario = Session("ID_UTENTE") end if 'ASSEGNAZIONE OFFICE_ID if rs_proprietario <> 0 then sql = "Select struttura from " & application("prefix") & "utenti where id=" & rs_proprietario SET RS2 = conn.execute(sql) rs_office_id = rs2("struttura") rs2.close set rs2 = nothing else rs_office_id = 0 end if if rs_office_id = "" then rs_office_id = 0 end if if request("modello") <> "" then rs_modello = request("modello") else rs_modello = 1 end if rs_modificato = strDataOra rs_sm_changefreq = "'" & request("sm_changefreq") & "'" rs_sm_priority = "'" & request("sm_priority") & "'" upddescrizioni = "" for j=LBound(lingua) to UBound(lingua) if Session("supervisor") = true or Session("reviewer") = true or Session("poweruser") = true then If lcase(Request("visibile_" & lingua(j))) = "on" Then rs_visibile = 1 else rs_visibile = 0 End If upddescrizioni = upddescrizioni & "visibile_" & lingua(j) & "=" & rs_visibile & "," end if contenuto = null if len (Request("content_" & lingua(j))) > 0 then contenuto = FixMySQL((Request("content_" & lingua(j)))) else contenuto = Request("content_" & lingua(j) & "_alt") if len(contenuto) > 0 then Set Tidy = Server.CreateObject("TidyCOM.TidyObject.2") Tidy.Options.Item("output-xhtml") = "yes" Tidy.Options.Item("xhtml-version") = "1.1" Tidy.Options.Item("show-body-only") = "yes" contenuto = Tidy.TidyMemToMem(contenuto) set Tidy = nothing end if end if upddescrizioni = upddescrizioni & "title_" & lingua(j) & "='" & FixMySQL((Request("title_" & lingua(j)))) & "'," upddescrizioni = upddescrizioni & "tagtitle_" & lingua(j) & "='" & FixMySQL((Request("tagtitle_" & lingua(j)))) & "'," upddescrizioni = upddescrizioni & "descrizione_" & lingua(j) & "='" & FixMySQL((Request("descrizione_" & lingua(j)))) & "'," upddescrizioni = upddescrizioni & "keywords_" & lingua(j) & "='" & FixMySQL((Request("keywords_" & lingua(j)))) & "'," upddescrizioni = upddescrizioni & "rss_url_" & lingua(j) & "='" & FixMySQL((Request("rss_url_" & lingua(j)))) & "'," upddescrizioni = upddescrizioni & "rss_title_" & lingua(j) & "='" & FixMySQL((Request("rss_title_" & lingua(j)))) & "'," upddescrizioni = upddescrizioni & "content_" & lingua(j) & "='" & contenuto & "'," next rs_lastuserid = "'" & Session("WEBGODLogin") & "'" rs_lastlogin = strDataOra rs_lastIP = "'" & Request.ServerVariables("REMOTE_ADDR") & "'" if Session("supervisor") = true then strSQL = "UPDATE " & application("prefix") & "testi set " & upddescrizioni & "proprietario=" & rs_proprietario & ",modello=" & rs_modello & ",modificato=" & rs_modificato & ",lastRevid=" & rs_lastuserid & ",lastRevlogin=" & rs_lastlogin & ",lastRevip=" & rs_lastip & ",office_id=" & rs_office_id & ",sm_changefreq=" & rs_sm_changefreq & ",sm_priority=" & rs_sm_priority & " where id=" & ManuID elseif Session("reviewer") = true then strSQL = "UPDATE " & application("prefix") & "testi set " & upddescrizioni & "proprietario=" & rs_proprietario & ",modello=" & rs_modello & ",modificato=" & rs_modificato & ",lastRevid=" & rs_lastuserid & ",lastrevlogin=" & rs_lastlogin & ",lastrevip=" & rs_lastip & ",office_id=" & rs_office_id & ",sm_changefreq=" & rs_sm_changefreq & ",sm_priority=" & rs_sm_priority & " where id=" & ManuID else strSQL = "UPDATE " & application("prefix") & "testi set " & upddescrizioni & "proprietario=" & rs_proprietario & ",modello=" & rs_modello & ",modificato=" & rs_modificato & ",lastuserid=" & rs_lastuserid & ",lastlogin=" & rs_lastlogin & ",lastip=" & rs_lastip & ",office_id=" & rs_office_id & ",sm_changefreq=" & rs_sm_changefreq & ",sm_priority=" & rs_sm_priority & " where id=" & ManuID end if set rs = Conn.execute(strSQL) set rs = nothing end if objRS2.close set objrs2 = nothing End If End Function Function AddManu (ManuID) If Request("title_" & Session("Language")) = "" Then AddManu = -1 Else Set objRS2 = Server.CreateObject("ADODB.Recordset") sql = "select * FROM " & application("prefix") & "testi WHERE title_" & Session("Language") & " = '" & FixMySQL(request("Title_" & Session("Language"))) & "'" objRS2.open sql, conn, adOpenStatic, adLockOptimistic If objRS2.EOF AND objRS2.BOF then if Session("supervisor") = true then if request("proprietario") <> "" then rs_proprietario = request("proprietario") else rs_proprietario = 1 end if else rs_proprietario = Session("ID_UTENTE") end if 'ASSEGNAZIONE OFFICE_ID if rs_proprietario <> 0 then sql = "Select struttura from " & application("prefix") & "utenti where id=" & rs_proprietario SET RS2 = conn.execute(sql) rs_office_id = rs2("struttura") rs2.close set rs2 = nothing else rs_office_id = 0 end if if rs_office_id = "" then rs_office_id = 0 end if if request("modello") <> "" then rs_modello = request("modello") else rs_modello = 1 end if rs_modificato = strDataOra rs_sm_changefreq = "'" & request("sm_changefreq") & "'" rs_sm_priority = "'" & request("sm_priority") & "'" descrizioni = "" testodescrizioni = "" for j=LBound(lingua) to UBound(lingua) if Session("supervisor") = true or Session("reviewer") = true or Session("poweruser") = true then descrizioni = descrizioni & "visibile_" & lingua(j) & "," end if descrizioni = descrizioni & "title_" & lingua(j) & "," descrizioni = descrizioni & "tagtitle_" & lingua(j) & "," descrizioni = descrizioni & "descrizione_" & lingua(j) & "," descrizioni = descrizioni & "keywords_" & lingua(j) & "," descrizioni = descrizioni & "rss_url_" & lingua(j) & "," descrizioni = descrizioni & "rss_title_" & lingua(j) & "," descrizioni = descrizioni & "content_" & lingua(j) & "," if Session("supervisor") = true or Session("reviewer") = true or Session("poweruser") = true then If lcase(Request("visibile_" & lingua(j))) = "on" Then rs_visibile = 1 else rs_visibile = 0 End If testodescrizioni = testodescrizioni & rs_visibile & "," end if contenuto = null if len (Request("content_" & lingua(j))) > 0 then contenuto = FixMySQL((Request("content_" & lingua(j)))) else contenuto = Request("content_" & lingua(j) & "_alt") if len(contenuto) > 0 then Set Tidy = Server.CreateObject("TidyCOM.TidyObject.2") Tidy.Options.Item("output-xhtml") = "yes" Tidy.Options.Item("xhtml-version") = "1.1" Tidy.Options.Item("show-body-only") = "yes" contenuto = Tidy.TidyMemToMem(contenuto) set Tidy = nothing end if end if testodescrizioni = testodescrizioni & "'" & FixMySQL((Request("title_" & lingua(j)))) & "'," testodescrizioni = testodescrizioni & "'" & FixMySQL((Request("tagtitle_" & lingua(j)))) & "'," testodescrizioni = testodescrizioni & "'" & FixMySQL((Request("descrizione_" & lingua(j)))) & "'," testodescrizioni = testodescrizioni & "'" & FixMySQL((Request("keywords_" & lingua(j)))) & "'," testodescrizioni = testodescrizioni & "'" & FixMySQL((Request("rss_url_" & lingua(j)))) & "'," testodescrizioni = testodescrizioni & "'" & FixMySQL((Request("rss_title_" & lingua(j)))) & "'," testodescrizioni = testodescrizioni & "'" & contenuto & "'," next rs_lastuserid = "'" & Session("WEBGODLogin") & "'" rs_lastlogin = strDataOra rs_lastIP = "'" & Request.ServerVariables("REMOTE_ADDR") & "'" if Session("supervisor") = true then strSQL = "INSERT INTO " & application("prefix") & "testi (proprietario,modello,modificato," & descrizioni & "lastuserid,lastlogin,lastip,office_id,LastRevID,LastRevLogin,LastRevIP,sm_changefreq,sm_priority) VALUES (" & rs_proprietario & "," & rs_modello & "," & rs_modificato & "," & testodescrizioni & rs_lastuserid & "," & rs_lastlogin & "," & rs_lastip & "," & rs_office_id & "," & rs_lastuserid & "," & rs_lastlogin & "," & rs_lastip & "," & rs_sm_changefreq & "," & rs_sm_priority & ")" elseif Session("reviewer") = true then strSQL = "INSERT INTO " & application("prefix") & "testi (proprietario,modello,modificato," & descrizioni & "lastrevid,lastrevlogin,lastrevip,office_id,sm_changefreq,sm_priority) VALUES (" & rs_proprietario & "," & rs_modello & "," & rs_modificato & "," & testodescrizioni & rs_lastuserid & "," & rs_lastlogin & "," & rs_lastip & "," & rs_office_id & "," & rs_sm_changefreq & "," & rs_sm_priority & ")" else strSQL = "INSERT INTO " & application("prefix") & "testi (proprietario,modello,modificato," & descrizioni & "lastuserid,lastlogin,lastip,office_id,sm_changefreq,sm_priority) VALUES (" & rs_proprietario & "," & rs_modello & "," & rs_modificato & "," & testodescrizioni & rs_lastuserid & "," & rs_lastlogin & "," & rs_lastip & "," & rs_office_id & "," & rs_sm_changefreq & "," & rs_sm_priority & ")" end if set rs = Conn.execute(strSQL) set rs = nothing else addmanu = -10 end if objrs2.close Set objRS2 = nothing end if End Function %>
<%=replace(DICLanguage(311),"[TESTO]","'" & Request("title_" & Session("Language")) & "'")%><%=DICLanguage(0)%> <%=DICLanguage(312)%>
<%=DICLanguage(194)%><%=DICLanguage(0)%>
<%=DICLanguage(7)%>
" & DICLanguage(11) & DICLanguage(0) & " " & DICLanguage(2) & "" & DICLanguage(0) & "
" If rescode = -10 Then strError = "" & DICLanguage(12) & DICLanguage(0) & "
" & DICLanguage(2) & "" & DICLanguage(0) & "
" %><%=replace(DICLanguage(197),"[TESTO]","'" & Request("title_" & Session("Language")) & "'")%><%=DICLanguage(0)%>
<%=DICLanguage(7)%>
" & DICLanguage(15) & DICLanguage(0) & "
" & DICLanguage(2) & "" & DICLanguage(0) & "
" If rescode = -1 Then strError = "" & DICLanguage(12) & DICLanguage(0) & " " & DICLanguage(2) & "" & DICLanguage(0) & "
" %><%=replace(DICLanguage(199),"[TESTO]","'" & Request("title_" & Session("Language")) & "'")%><%=DICLanguage(0)%>
<% If Request.Form("addmore")<>"" Then %> <% Else %><%=DICLanguage(7)%>
<%=DICLanguage(4)%> &submnu=<%=request("submnu")%>" title="<%=DICLanguage(10)%>"><%=DICLanguage(5)%><%=DICLanguage(0)%>
" onclick="history.back()" onkeypress="history.back()"><%=DICLanguage(2)%><%=DICLanguage(0)%>