home *** CD-ROM | disk | FTP | other *** search
/ Freelog 9 / Freelog009.iso / BAS / Internet / Abb / doans.asp < prev    next >
Text File  |  2000-03-02  |  8KB  |  249 lines

  1. <% @ LANGUAGE="VBScript" lcid="1036" %>
  2. <!--#include file="include.asp"-->
  3. <%
  4.     Nom2=Replace(request.form("Nom"), "'", "''")
  5.     Passe2=Replace(request.form("Passe"), "'", "''")
  6.     Signature2=request.form("Signature")
  7.     Topic2=request.form("Topic")
  8.     Post2=request.form("Post")
  9.     Heure2=request.form("Heure")
  10.     Date2=request.form("Date")
  11.     Message2=Replace(request.form("Message"), "'", "''")
  12.     'RΘcupΘration du formulaire prΘcΘdent
  13. %>
  14. <html>
  15. <head>
  16. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  17. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  18. <meta name="ProgId" content="FrontPage.Editor.Document">
  19. <title>ABB</title>
  20. <style type="text/css">
  21. <!--
  22. A:link{text-decoration: none; color: <% =EnvironnementRes("envlnk") %>;}
  23. A:visited{text-decoration: none; color: <% =EnvironnementRes("envlnk") %>;}
  24. A:active{text-decoration: underline; color: <% =EnvironnementRes("envvlnk") %>;}
  25. A:hover{text-decoration: underline; color: <% =EnvironnementRes("envvlnk") %>;}
  26. -->
  27. </style>
  28. </head>
  29.  
  30. <body bgcolor="<% =EnvironnementRes("envback") %>" text="<% =EnvironnementRes("envtxt") %>" link="<% =EnvironnementRes("envlnk") %>" vlink="<% =EnvironnementRes("envvlnk") %>">
  31. <p>
  32. <font face="Arial" size="2"><b>
  33. <%
  34. If len(Nom2) > 0 Then
  35.     strAutSQL = "SELECT * FROM Utilisateur WHERE usrlogin='" & Nom2 & "' "
  36.     set AutRes=ConnectionBD.Execute(strAutSQL)
  37.     
  38.     If AutRes.EOF=false Then
  39.  
  40. longeur1=Len(Nom2)
  41. longeur2=Len(Passe2)
  42.  
  43. J=1
  44. For I=1 To longeur2
  45.     char1=Mid(Nom2,J,1)
  46.     char2=Mid(Passe2,I,1)
  47.     char3=Mid(Passe2,I,1)
  48.     code1=Asc(char1)
  49.     code2=Asc(char2)
  50.     code2=code2+code1
  51.     If code2>255 Then
  52.         code2=code2-255
  53.     End If
  54.     char2=Chr(code2)
  55.     Passe2=Replace(Passe2,char3,char2,1,1)
  56.  
  57.     J=J+1
  58.     If J>longeur1 Then
  59.     J=1
  60.     End If
  61. Next
  62. 'Cryptage du mot de passe
  63.     
  64.     If AutRes("usrpass") = Passe2 Then  
  65.     If AutRes("usrfin") = false Then
  66.     If Message2<>"" Then %>
  67.  Merci, votre rΘponse α ΘtΘ ajoutΘe !
  68. </b></font>
  69. <p><font face="Arial" size="2"><b>
  70. <%
  71.     If EnvironnementRes("envhtml")=false Then
  72.         Message2=Replace(Message2, "<", "<")
  73.         Message2=Replace(Message2, ">", ">")
  74.     End If
  75.     'Si le code HTML est interdi, transformation des < et > par leur Θquivalents HTML pour bloquer le code.
  76.     
  77.     If Signature2 = "ON" Then
  78.         Message2 = Message2 & "<BR><BR>" & AutRes("usrsign")
  79.     End If
  80.     
  81.     Message2=Replace(Message2, vbcrlf, "<BR>")
  82.     'Transformation des retours charriot en <BR>
  83.     
  84.     If EnvironnementRes("envabb")=true Then
  85.         %>
  86.         <!--#include file="abbcode.asp"-->
  87.         <%
  88.     End If
  89.     'Si le code ABB est autorisΘ, effecuter les transformations adΘquates.
  90.     
  91.     Aut2=AutRes("usrid")
  92.     
  93.     lheure = Hour(now)+EnvironnementRes("envdecal")
  94.     If Hour(now)+EnvironnementRes("envdecal")<0 Then
  95.         lheure = Hour(now)+EnvironnementRes("envdecal")+24
  96.     End If
  97.     
  98.     lheure = lheure & ":" & Minute(now) & ":" & Second(now)
  99.  
  100.     SQLStmt2 = "INSERT INTO Postcn (postcnpo,postcnau,postcncn,postcndt,postcnh) "
  101.     SQLStmt2 = SQLStmt2 & "VALUES ('" & Post2 & "','" & Aut2 & "','" & Message2 & "','" & Date() & "','" & lheure & "')"
  102.     Set RS2=ConnectionBD.Execute(SQLStmt2)
  103.  
  104.     strTopicSQL = "SELECT * FROM Topic WHERE topicid=" & Topic2 & " "
  105.     set TopicRes=ConnectionBD.Execute(strTopicSQL)
  106.  
  107.     Posts2=TopicRes("topicpost")
  108.  
  109.     SQLStmt3 = "UPDATE Topic "
  110.     SQLStmt3 = SQLStmt3 & "SET topicpost = ('" & Posts2 + 1 & "') "
  111.     SQLStmt3 = SQLStmt3 & "WHERE topicid=" & Topic2 & " "
  112.     Set RS3 = ConnectionBD.Execute(SQLStmt3)
  113.     
  114.     strpopoSQL = "SELECT * FROM Post WHERE postid=" & Post2 & " "
  115.     set PopoRes=ConnectionBD.Execute(strpopoSQL)
  116.     
  117.     strautmailSQL = "SELECT usrmail FROM Utilisateur WHERE usrid=" & PopoRes("postaut") & " "
  118.     set autmailRes=ConnectionBD.Execute(strautmailSQL)
  119.     
  120.     If PopoRes("postmail")=true Then
  121.         Dim objCDO
  122.         Set objCDO = Server.CreateObject("CDONTS.NewMail")
  123.         
  124.         objCDO.To = autmailRes("usrmail")
  125.         objCDO.From = EnvironnementRes("envcontact")
  126.         
  127.         objCDO.Subject = "Forum ABB du site " & EnvironnementRes("envsite")
  128.         objCDO.Body = AutRes("usrlogin") & " a rΘpondu α votre sujet : " & PopoRes("posttitle") & " le " & Date() & " α " & lheure
  129.         objCDO.Send
  130.         
  131.         Set objCDO = Nothing
  132.     End If
  133.     
  134.     Popo=PopoRes("postans")
  135.     
  136.     SQLStmt4 = "UPDATE Post "
  137.     SQLStmt4 = SQLStmt4 & "SET postans = ('" & Popo + 1 & "'), postdt = ('" & Date() & "'), posth = ('" & lheure & "') "
  138.     SQLStmt4 = SQLStmt4 & "WHERE postid=" & Post2 & " "
  139.     Set RS4 = ConnectionBD.Execute(SQLStmt4)
  140.     
  141.     If AutRes("usrstatu")>2 Then
  142.         strStatSQL = "SELECT * FROM Statut WHERE statnbpost>" & AutRes("usrpost") & " ORDER BY statnbpost "
  143.         set StatRes=ConnectionBD.Execute(strStatSQL)
  144.         If StatRes.EOF<>True Then
  145.             If AutRes("usrpost")=StatRes("statnbpost")-1 Then
  146.                 SQLStmt4 = "UPDATE Utilisateur "
  147.                 SQLStmt4 = SQLStmt4 & "SET usrpost = ('" & AutRes("usrpost") + 1 & "'), usrstatu = ('" & StatRes("statid") & "') "
  148.                 SQLStmt4 = SQLStmt4 & "WHERE usrid=" & AutRes("usrid") & " "
  149.                 Set RS4 = ConnectionBD.Execute(SQLStmt4)
  150.             Else
  151.                 SQLStmt4 = "UPDATE Utilisateur "
  152.                 SQLStmt4 = SQLStmt4 & "SET usrpost = ('" & AutRes("usrpost") + 1 & "') "
  153.                 SQLStmt4 = SQLStmt4 & "WHERE usrid=" & AutRes("usrid") & " "
  154.                 Set RS4 = ConnectionBD.Execute(SQLStmt4)
  155.             End If
  156.         Else
  157.             SQLStmt4 = "UPDATE Utilisateur "
  158.             SQLStmt4 = SQLStmt4 & "SET usrpost = ('" & AutRes("usrpost") + 1 & "') "
  159.             SQLStmt4 = SQLStmt4 & "WHERE usrid=" & AutRes("usrid") & " "
  160.             Set RS4 = ConnectionBD.Execute(SQLStmt4)
  161.         End If
  162.     Else
  163.         SQLStmt4 = "UPDATE Utilisateur "
  164.         SQLStmt4 = SQLStmt4 & "SET usrpost = ('" & AutRes("usrpost") + 1 & "') "
  165.         SQLStmt4 = SQLStmt4 & "WHERE usrid=" & AutRes("usrid") & " "
  166.         Set RS4 = ConnectionBD.Execute(SQLStmt4)
  167.     End If
  168. %>
  169. Vous allez automatiquement Ωtre ramenΘ sur le message "<% =PopoRes("posttitle") %>",
  170. </b></font>
  171. </p>
  172. <p><font face="Arial" size="2"><b>
  173. sinon, cliquez ici : <a href="post.asp?postid=<% =Post2 %>&topicid=<% =Topic2 %>&visdt2=<% =Date2 %>&vish2=<% =Heure2 %>">Retour au message "<% =PopoRes("posttitle") %>"</a>
  174. <%
  175. temps=Now()
  176. While DateDiff("s",temps,Now())<3
  177. Wend
  178. %>
  179. <script language="javascript">
  180. document.location="post.asp?postid=<% =Post2 %>&topicid=<% =Topic2 %>&visdt2=<% =Date2 %>&vish2=<% =Heure2 %>";
  181. </script>
  182. <% Else %>
  183. <center>Entrez le corps du message...</center>
  184. <%
  185. temps=Now()
  186. While DateDiff("s",temps,Now())<3
  187. Wend
  188. %>
  189. <script language="javascript">
  190. history.back();
  191. </script>
  192. <% End If
  193. Else %>
  194. <center>Vous n'avez pas le droit de poster de nouveaux messages...</center>
  195. <%
  196. temps=Now()
  197. While DateDiff("s",temps,Now())<3
  198. Wend
  199. %>
  200. <script language="javascript">
  201. history.back();
  202. </script>
  203. <% End If
  204. Else %>
  205. <center>Ce n'est pas le bon mot de passe...</center>
  206. <%
  207. temps=Now()
  208. While DateDiff("s",temps,Now())<3
  209. Wend
  210. %>
  211. <script language="javascript">
  212. history.back();
  213. </script>
  214. <% End If
  215. Else %>
  216. <center>Entrez un nom d'utilisateur valide.</center>
  217. <br>
  218. <br>
  219. <center><a href="subscribe.asp">Si vous n'Ωtes pas encore inscrit, cliquez ici.</a></center>
  220. <%
  221. temps=Now()
  222. While DateDiff("s",temps,Now())<10
  223. Wend
  224. %>
  225. <script language="javascript">
  226. history.back();
  227. </script>
  228. <% End If
  229. Else %>
  230. <center>Entrez un nom d'utilisateur valide.</center>
  231. <br>
  232. <br>
  233. <center><a href="subscribe.asp">Si vous n'Ωtes pas encore inscrit, cliquez ici.</a></center>
  234. <%
  235. temps=Now()
  236. While DateDiff("s",temps,Now())<10
  237. Wend
  238. %>
  239. <script language="javascript">
  240. history.back();
  241. </script>
  242. <% End If %>
  243. </b></font>
  244. </p>
  245. <!--#include file="basdepage.asp"-->
  246. </body>
  247.  
  248. </html>
  249.