home *** CD-ROM | disk | FTP | other *** search
/ Freelog 9 / Freelog009.iso / BAS / Internet / Abb / maj / cryptpass.asp < prev   
Encoding:
Text File  |  2000-03-02  |  2.1 KB  |  79 lines

  1. <% @ LANGUAGE="VBScript" lcid="1036" %>
  2. <!--#include file="../include.asp"-->
  3. <%
  4.     strUserSQL = "SELECT * FROM Utilisateur"
  5.     set UserRes=ConnectionBD.Execute(strUserSQL)
  6. %>
  7. <html>
  8.  
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  11. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  12. <meta name="ProgId" content="FrontPage.Editor.Document">
  13. <title>ABB</title>
  14. </head>
  15.  
  16. <body bgcolor="<% =EnvironnementRes("envback") %>" text="<% =EnvironnementRes("envtxt") %>" link="<% =EnvironnementRes("envlnk") %>" vlink="<% =EnvironnementRes("envvlnk") %>">
  17. <p align="center"><font face="Arial" size="4"><b>Cryptage des mots de passes de tous les
  18. utilisateurs</b></font></p>
  19.  
  20. <p align="center"> </p>
  21.  
  22. <p align="center"><font face="Arial" size="4"><b>ATTENTION, ne l'utiliser qu'une
  23. fois !!!</b></font></p>
  24.  
  25. <p align="center"><font face="Arial" size="4"><b>Effacez le fichier "cryptpass.asp"
  26. du serveur aprΦs utilisation !!!</b></font></p>
  27.  
  28.  
  29. <p><font face="Arial" size="2">
  30.  
  31. <% Do Until UserRes.EOF = True %>
  32. Cryptage du mot de passe de l'utilisateur "<b><% =UserRes("usrlogin") %></b>".</font></p>
  33. <p><font face="Arial" size="2">
  34. <%
  35. Nom2=UserRes("usrlogin")
  36. Passe2=UserRes("usrpass")
  37. Id2=UserRes("usrid")
  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. SQLStmt = "UPDATE Utilisateur "
  63. SQLStmt = SQLStmt & "SET usrpass = ('" & Passe2 & "') "
  64. SQLStmt = SQLStmt & "WHERE usrid=" & Id2 & " "
  65. Set RS = ConnectionBD.Execute(SQLStmt)
  66. %>
  67. </font></p>
  68. <p><font face="Arial" size="2">Fait !
  69. </font></p>
  70. <hr width="50%" noshade size="1" color="#000000">
  71. <p><font face="Arial" size="2"> 
  72. <% UserRes.MoveNext %>
  73. <% Loop %>
  74. <!--#include file="../basdepage.asp"-->
  75. </font></p>
  76. </body>
  77.  
  78. </html>
  79.