经典的asp发布登录表单不再起作用

时间:2018-12-12 12:19:27

标签: vbscript asp-classic

classic asp网站上工作时,我注意到一种行为正在给某些用户带来很多麻烦。在以某种方式发布登录表单后,不再需要输入某些密码,而在尝试访问(104) reset connection by peer时出现错误main.asp

这是你们可以帮助我弄清楚的奇怪事情:

经过数小时的努力寻找线索后,我们只需将HTML name atributename="pwdSenha"更改为name="pwdTestSenha",然后在第二天重新开始,一切就恢复了,因此我们已经再次更改了名称,现在一切正常,但我想直到明天。

请问发生了什么吗?

这是简化的代码:

<form class="modal-content animate" id="frmLogin" name="frmLogin" method="post" action="../functions/aut_user.asp">
  <div class="container">
    <label><b>Login</b></label>
    <input type="text" placeholder="Entre com Login" name="txtLogin" maxlength="45" required>    
    <label><b>Senha</b></label>
    <input type="password" placeholder="Entre com a Senha" name="pwdSenha" maxlength="15">        
    <button id="bntLoginEntrar" type="submit">Entrar</button>
  </div>  
</form>

强化课程

<%
if funConectaBD() and Session("USER_ID") = "" then
  Dim strLogin, strSenha
  strLogin = fAspas(Request.Form("txtLogin"))
  strSenha = "IS NULL"
  if Trim(Request.Form("pwdSenha")) <> "" then
    strSenha = "= '" & Cript(Request.Form("pwdSenha")) & "'"
  end if
  if strLogin <> "" then
    'on error resume next
    Dim adoRSLogin
    Set adoRSLogin = Server.CreateObject("ADODB.Recordset")
    adoRSLogin.ActiveConnection = bdConn

    Dim strSQL
    if Session("USER_CHANGE_PASS") <> "S" then      
        strSQL = "SELECT * " &_
                 "FROM users us" &_
                 "WHERE us.login = '" & strLogin & "' AND us.senha " & strSenha & " AND us.ativo = 'S';"
    else
        strSQL = "SELECT " &_
                 "FROM usuario us " &_
                 "WHERE us.login = '" & strLogin & "' AND us.ativo = 'S';"
    end if
    'Response.Write(strSQL & "<br/>")
    'Response.End()
    adoRSLogin.Open(strSQL)
    if not adoRSLogin.EOF then
        Session("USER_ID") = adoRSLogin("numero")
        Session("FUNC_ID") = adoRSLogin("funcionario")
        Session("USER_NAME") = adoRSLogin("nome")
        Session("FUNC_NAME") = ""
        Session("USER_LOGIN") = adoRSLogin("login")
        Session("USER_EMAIL") = adoRSLogin("email")
        Session("USER_PHONE") = adoRSLogin("telefone")
        if adoRSLogin("adm") = "S" then
            Session("USER_ADM") = TRUE
        else
            Session("USER_ADM") = FALSE
        end if
        Session("UNIT_ID") = adoRSLogin("unidade_numero")
        Session("UNIT_NAME") = adoRSLogin("unidade_nome")                       
        strSQL = "CALL inclui_conexao(" & Session("UNIT_ID") & "," & Session("USER_ID") & ",NOW(),NULL);"
        'Response.Write(strSQL & "<br/>")
        'Response.End
        bdConn.execute(strSQL)
        'on error goto 0        
    end if
    strSQL = empty
    set adoRSLogin = nothing
  end if
end if
%>

0 个答案:

没有答案