% ' 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("comunicati")<> 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(64) %> <% catId = replace(Request("id"),"'","''") 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 If Request("Update") <> "" Then strfunction = "Update" Elseif Request("Delete") <> "" Then strfunction = "Deletewait" Elseif Request("Deleteok") <> "" Then strfunction = "Delete" Elseif Request("Add") <> "" Then strfunction = "addcat" Elseif Request("Back") <> "" then response.redirect Session("lastpage") End If Function DeleteCat(CATID) Dim RSdel, sql Set RSdel = Server.CreateObject("ADODB.Recordset") sql= "DELETE FROM " & application("prefix") & "comunicati WHERE id = " & catid & aggiunta_sql SET RSdel=conn.execute(sql) SET RSdel=nothing Set RSdel = Server.CreateObject("ADODB.Recordset") sql= "DELETE FROM " & application("prefix") & "comunicati_allegati WHERE bandoid = " & catid & aggiunta_sql SET RSdel=conn.execute(sql) SET RSdel=nothing End Function Function UpdateCat (CATID) Dim rs, sql If (request("disp_da") = "" and Session("translator") <> true) or (request("title_" & Session("Language")) ="" and Session("translator") <> true) then UpdateCat = -1 else Set objRS2 = Server.CreateObject("ADODB.Recordset") sql = "select * FROM " & application("prefix") & "comunicati WHERE Id = " & CATID & aggiunta_sql objRS2.open sql, conn, adOpenStatic, adLockOptimistic If objRS2.EOF AND objRS2.BOF then UpdateCat = -10 else dispdatmp = split(request("disp_da"), "/") If CMS_DB = "SQL" or CMS_DB="MYSQL" then rs_disp_da = "'" & dispdatmp(2) & "/" &dispdatmp(1) & "/" & dispdatmp(0) & "'" Else rs_disp_da = "DateValue('" & request("disp_da") & "')" End If 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 if request("areaid") <> "" then rs_areaid = request("areaid") else rs_areaid = 0 end if 'ASSEGNAZIONE OFFICE_ID if request("office_id") <> "" then rs_office_id = request("office_id") else 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 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 If CMS_DB = "SQL" or CMS_DB="MYSQL" then rs_modificato = "'" & year(DataOra) & "/" & month(DataOra) & "/" & day(DataOra) & "'" Else rs_modificato = "DateValue('" & dataOra & "')" End If 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 & "content_" & lingua(j) & "='" & FixMySQL(contenuto) & "'," next rs_sm_changefreq = "'" & request("sm_changefreq") & "'" rs_sm_priority = "'" & request("sm_priority") & "'" rs_lastuserid = "'" & Session("WEBGODLogin") & "'" rs_lastlogin = strDataOra rs_lastIP = "'" & Request.ServerVariables("REMOTE_ADDR") & "'" if Session("supervisor") = true then strSQL = "UPDATE " & application("prefix") & "comunicati set " & upddescrizioni & "disp_da=" & rs_disp_da & ",proprietario=" & rs_proprietario & ",modello=" & rs_modello & ",modificato=" & rs_modificato & ",lastRevid=" & rs_lastuserid & ",lastRevlogin=" & rs_lastlogin & ",lastRevip=" & rs_lastip & ", office_id=" & rs_office_id & ", areaid=" & rs_areaid & ",sm_changefreq=" & rs_sm_changefreq & ",sm_priority=" & rs_sm_priority & " where id=" & CATID & aggiunta_sql elseif Session("reviewer") = true then strSQL = "UPDATE " & application("prefix") & "comunicati set " & upddescrizioni & "disp_da=" & rs_disp_da & ",proprietario=" & rs_proprietario & ",modello=" & rs_modello & ",modificato=" & rs_modificato & ",lastrevid=" & rs_lastuserid & ",lastrevlogin=" & rs_lastlogin & ",lastrevip=" & rs_lastip & ", office_id=" & rs_office_id & ", areaid=" & rs_areaid & ",sm_changefreq=" & rs_sm_changefreq & ",sm_priority=" & rs_sm_priority & " where id=" & CATID & aggiunta_sql else strSQL = "UPDATE " & application("prefix") & "comunicati set " & upddescrizioni & "disp_da=" & rs_disp_da & ",proprietario=" & rs_proprietario & ",modello=" & rs_modello & ",modificato=" & rs_modificato & ",lastuserid=" & rs_lastuserid & ",lastlogin=" & rs_lastlogin & ",lastip=" & rs_lastip & ", office_id=" & rs_office_id & ", areaid=" & rs_areaid & ",sm_changefreq=" & rs_sm_changefreq & ",sm_priority=" & rs_sm_priority & " where id=" & CATID & aggiunta_sql end if set rs = Conn.execute(strSQL) set rs = nothing 'GESTIONE ALLEGATI rs_bandoid = CATID For ia = 1 to 5 If Request("BanNew" & ia) = "yes" Then If Request("BanNome" & ia) <> "" AND Request("BanDesc" & ia) <> "" Then strSQL = "INSERT INTO " & application("prefix") & "comunicati_allegati (bandoid,nomefile,posizione,descrizione,tipodoc,lastuserid,lastlogin,lastip) VALUES (" & rs_bandoid & ",'" & request("BanNome" & ia) & "'," & request("BanPos" & ia) & ",'" & FixMySQL(request("BanDesc" & ia)) & "'," & request("BanType" & ia) & "," & rs_lastuserid & "," & rs_lastlogin & "," & rs_lastip & ")" set Oprs = conn.Execute (strSQL) set Oprs = nothing end if else ' se si aggiorna.... If Request("BanDel" & ia) = "yes" Then 'Elimina il riferimento all'allegato strSQL = "DELETE FROM " & application("prefix") & "comunicati_allegati WHERE Id = " & Request("BanId" & ia) & " and tipodoc=0" set Oprs = conn.Execute (strSQL) set Oprs = nothing else If Request("BanNome" & ia) <> "" AND Request("BanDesc" & ia) <> "" Then strSQL = "UPDATE " & application("prefix") & "comunicati_allegati set nomefile='" & request("BanNome" & ia) & "', posizione=" & request("BanPos" & ia) & ", descrizione='" & FixMySQL(request("BanDesc" & ia), "f") & "',lastuserid=" & rs_lastuserid & ",lastlogin=" & rs_lastlogin & ",lastip=" & rs_lastip & " where id=" & Request("BanId" & ia) set Oprs = conn.Execute (strSQL) set Oprs = nothing end if end if end if next end if objRS2.close set objrs2 = nothing End If End Function Function AddCat (CATID) Dim rs, sql If (request("disp_da") = "" and Session("translator") <> true) or (request("title_" & Session("Language")) ="" and Session("translator") <> true) then AddCat = -1 else Set objRS2 = Server.CreateObject("ADODB.Recordset") sql = "select * FROM " & application("prefix") & "comunicati WHERE title_" & Session("Language") & " = '" & FixMySQL(request("Title_" & Session("Language"))) & "'" & aggiunta_sql objRS2.open sql, conn, adOpenStatic, adLockOptimistic If objRS2.EOF AND objRS2.BOF then dispdatmp = split(request("disp_da"), "/") If CMS_DB = "SQL" or CMS_DB="MYSQL" then rs_disp_da = "'" & dispdatmp(2) & "/" &dispdatmp(1) & "/" & dispdatmp(0) & "'" Else rs_disp_da = "DateValue('" & request("disp_da") & "')" End If 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 if request("areaid") <> "" then rs_areaid = request("areaid") else rs_areaid = 0 end if 'ASSEGNAZIONE OFFICE_ID if request("office_id") <> "" then rs_office_id = request("office_id") else 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 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 If CMS_DB = "SQL" or CMS_DB="MYSQL" then rs_modificato = "'" & year(DataOra) & "/" & month(DataOra) & "/" & day(DataOra) & "'" Else rs_modificato = "DateValue('" & dataOra & "')" End If descrizioni = "" testodescrizioni = "" rs_sm_changefreq = "'" & request("sm_changefreq") & "'" rs_sm_priority = "'" & request("sm_priority") & "'" 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 & "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(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") & "comunicati (disp_da,proprietario,modello,modificato," & descrizioni & "lastuserid,lastlogin,lastip,office_id,areaid,LastRevID,LastRevLogin,LastRevIP,sm_changefreq,sm_priority) VALUES (" & rs_disp_da & "," & rs_proprietario & "," & rs_modello & "," & rs_modificato & "," & testodescrizioni & rs_lastuserid & "," & rs_lastlogin & "," & rs_lastip & "," & rs_office_id & "," & rs_areaid & "," & rs_lastuserid & "," & rs_lastlogin & "," & rs_lastip & "," & rs_sm_changefreq & "," & rs_sm_priority & ")" elseif Session("reviewer") = true then strSQL = "INSERT INTO " & application("prefix") & "comunicati (disp_da,proprietario,modello,modificato," & descrizioni & "lastrevid,lastrevlogin,lastrevip,office_id,areaid,sm_changefreq,sm_priority) VALUES (" & rs_disp_da & "," & rs_proprietario & "," & rs_modello & "," & rs_modificato & "," & testodescrizioni & rs_lastuserid & "," & rs_lastlogin & "," & rs_lastip & "," & rs_office_id & "," & rs_areaid & "," & rs_sm_changefreq & "," & rs_sm_priority & ")" else strSQL = "INSERT INTO " & application("prefix") & "comunicati (disp_da,proprietario,modello,modificato," & descrizioni & "lastuserid,lastlogin,lastip,office_id,areaid,sm_changefreq,sm_priority) VALUES (" & rs_disp_da & "," & rs_proprietario & "," & rs_modello & "," & rs_modificato & "," & testodescrizioni & rs_lastuserid & "," & rs_lastlogin & "," & rs_lastip & "," & rs_office_id & "," & rs_areaid & "," & rs_sm_changefreq & "," & rs_sm_priority & ")" end if 'response.write strsql set rs = Conn.execute(strSQL) set rs = nothing 'GESTIONE ALLEGATI sql = "select * FROM " & application("prefix") & "comunicati WHERE title_" & Session("Language") & " = '" & FixMySQL(request("title_" & Session("Language"))) & "'" & aggiunta_sql set rs = Conn.execute(SQL) rs_bandoid = rs("id") set rs = nothing For ia = 1 to 5 If Request("BanNew" & ia) = "yes" Then If Request("BanNome" & ia) <> "" AND Request("BanDesc" & ia) <> "" Then strSQL = "INSERT INTO " & application("prefix") & "comunicati_allegati (bandoid,nomefile,posizione,descrizione,tipodoc,lastuserid,lastlogin,lastip) VALUES (" & rs_bandoid & ",'" & request("BanNome" & ia) & "'," & request("BanPos" & ia) & ",'" & FixMySQL(request("BanDesc" & ia)) & "'," & request("BanType" & ia) & "," & rs_lastuserid & "," & rs_lastlogin & "," & rs_lastip &")" set Oprs = conn.Execute (strSQL) set Oprs = nothing end if end if next 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(65)%><%=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(68),"[NOTIZIA]","'" & 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(70),"[NOTIZIA]","'" & 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)%>