% sDBExtraPath = "../" Dim dicTables Set dicTables = Server.CreateObject("Scripting.Dictionary") %> <% IF Request("CONTENT_LENGTH") > 0 THEN Dim strOldUserName Dim strOldPwd Dim strUserName Dim strPwd Dim i strOldUserName = StringEncrypt(Trim(Request.Form("txtOldUsername")), 1) strOldPwd = StringEncrypt(Trim(Request.Form("txtOldPassword")), 1) sSQL = "SELECT Count(*) FROM BackEndUsers WHERE UserName = " & Chr(34) & Trim(strOldUserName) & chr(34) & " AND UserPassword= " & Chr(34) & Trim(strOldPwd) & chr(34) i = conDB.Execute(sSQL).Fields(0) If i = 0 Then sErrors = langMgr.GetContent("ADMINUSER_ERROR_CURRENTINFO_INVALID", "BackEndMessages", iInterfaceLang) Else strUserName = StringEncrypt(Trim(Request.Form("txtNewUsername")), 1) strPwd = StringEncrypt(Trim(Request.Form("txtNewPassword")), 1) sSQL = "UPDATE BackEndUsers SET UserName = '" & Trim(strUserName) & "', UserPassword= '" & Trim(strPwd) & "'" conDB.Execute(sSQL) sMessages = langMgr.GetContent("MSG_TITLE_CHANGES_BEEN_SAVED", "BackEndMessages", iInterfaceLang) End If END IF Function IIf( condition, valTrue, valFalse ) If ( condition ) Then IIf = valTrue Else IIf = valFalse End If End Function Function StringEncrypt(strSecret, iAccion) Dim i Dim iLongitudCadena Dim strAuxiliar Dim sin 'numeros aleatorios Dim sinInicializaRND Dim iSigno sinInicializaRND = Rnd(-0.345) If iAccion = 0 Then 'Encriptar iSigno = -1 Else 'Desencriptat iSigno = 1 End If For i = 1 To Len(Trim(strSecret)) strAuxiliar = strAuxiliar & Chr(Asc(Mid(strSecret, i, 1)) + Int((3 * Rnd) + 1) * iSigno) iSigno = iSigno * -1 Next StringEncrypt = strAuxiliar End Function %>
<%=langMgr.GetContent("ADMINUSER_TEXT", "BackEndMessages", iInterfaceLang)%>
<%If Len(sErrors) > 0 Then%><%=sErrors%>
<%ElseIf Len(sMessages) > 0 Then%>><%=sMessages%>
<%End If%>