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