Änderung Sicherheit erhöht

This commit is contained in:
ja
2021-11-16 11:59:05 +01:00
parent 67ed982029
commit 130a8ce620
3 changed files with 33 additions and 42 deletions

View File

@@ -34,52 +34,42 @@ Partial Class login_Change_PW
Dim dr As SqlDataReader = cmd.ExecuteReader()
If dr.HasRows Then
dr.Read()
If String.IsNullOrEmpty(usrname) = False Then
If getDateoftoken(Request.QueryString("Par1")) = True AndAlso usrname = dr("Username") AndAlso String.Equals(KundenNr, dr("KundenNr")) = True Then
Try
If IsPostBack Then
If String.IsNullOrEmpty(txt_Pw.Text) = False AndAlso String.IsNullOrEmpty(txt_Pw_WH.Text) = False Then
txt_Pw_WH.Enabled = False
reqPassw1txt_M.Enabled = False
reqPasswtxt_M.Enabled = False
reqPasswtxt.Enabled = True
reqPassw1txt.Enabled = True
reqPasswtxt.Validate()
If reqPasswtxt.IsValid = True Then
txt_Pw_WH.Enabled = True
reqPassw1txt.Validate()
End If
ElseIf String.IsNullOrEmpty(txt_Pw_M.Text) = False AndAlso String.IsNullOrEmpty(txt_Pw_WH_M.Text) = False Then
txt_Pw_WH_M.Enabled = False
reqPasswtxt.Enabled = False
reqPassw1txt.Enabled = False
reqPassw1txt_M.Enabled = True
reqPasswtxt_M.Enabled = True
reqPasswtxt_M.Validate()
If reqPasswtxt_M.IsValid = True Then
txt_Pw_WH_M.Enabled = True
reqPassw1txt_M.Validate()
End If
If getDateoftoken(Request.QueryString("Par1")) = True AndAlso usrname = dr("Username") AndAlso KundenNr = dr("KundenNr") AndAlso UsrID = dr("UserId") Then
Try
If IsPostBack Then
If String.IsNullOrEmpty(txt_Pw.Text) = False AndAlso String.IsNullOrEmpty(txt_Pw_WH.Text) = False Then
txt_Pw_WH.Enabled = False
reqPassw1txt_M.Enabled = False
reqPasswtxt_M.Enabled = False
reqPasswtxt.Enabled = True
reqPassw1txt.Enabled = True
reqPasswtxt.Validate()
If reqPasswtxt.IsValid = True Then
txt_Pw_WH.Enabled = True
reqPassw1txt.Validate()
End If
ElseIf String.IsNullOrEmpty(txt_Pw_M.Text) = False AndAlso String.IsNullOrEmpty(txt_Pw_WH_M.Text) = False Then
txt_Pw_WH_M.Enabled = False
reqPasswtxt.Enabled = False
reqPassw1txt.Enabled = False
reqPassw1txt_M.Enabled = True
reqPasswtxt_M.Enabled = True
reqPasswtxt_M.Validate()
If reqPasswtxt_M.IsValid = True Then
txt_Pw_WH_M.Enabled = True
reqPassw1txt_M.Validate()
End If
End If
Catch exc As Exception
lbl_messagetext.Text = exc.Message
End Try
Else
'btn_submitpw.Enabled = False
txt_Pw.BackColor = Drawing.Color.Gray
txt_Pw.ForeColor = Drawing.Color.DarkGray
txt_Pw_WH.Enabled = False
txt_Pw_WH.BackColor = Drawing.Color.Gray
txt_Pw_WH.ForeColor = Drawing.Color.DarkGray
txt_Pw.Enabled = False
regexval_txt_Pw_WH.Enabled = False
End If
End If
Catch exc As Exception
lbl_messagetext.Text = exc.Message
End Try
Else
VERAG_VARIABLES.initerrorcount()
VERAG_VARIABLES.seterrorcount(1)
lbl_messagetext.Text = VERAG_VARIABLES.geterrornumb + "Link ist abgelaufen. Bitte neue E-Mail senden."
Response.Redirect("ForgotPW.aspx")
'Response.Redirect("ForgotPW.aspx")
End If
dr.Close()
End If