Änderungen Token-System
This commit is contained in:
@@ -13,7 +13,7 @@ Partial Class login_ForgotPW
|
||||
End Sub
|
||||
|
||||
Protected Sub btn_Send_Click(sender As Object, e As EventArgs)
|
||||
Dim username As String = String.Empty
|
||||
Dim username As String = txt_Username.Text
|
||||
Dim password As String = String.Empty
|
||||
Dim email As String = String.Empty
|
||||
Dim tokenname As String = String.Empty
|
||||
@@ -26,13 +26,8 @@ Partial Class login_ForgotPW
|
||||
regexval_txt_Email.Validate()
|
||||
valreqtxtEmail.IsValid = True
|
||||
End If
|
||||
If check_UserName_regex.IsValid = True Then
|
||||
username = txt_Username.Text
|
||||
Else
|
||||
check_UserName_regex.ErrorMessage = "No valid Username found!"
|
||||
End If
|
||||
|
||||
If String.IsNullOrEmpty(email) = False AndAlso String.IsNullOrEmpty(tokenname) = True AndAlso String.IsNullOrEmpty(password) = True AndAlso String.IsNullOrEmpty(username) = False Then
|
||||
'cDBFunctions.GetNewOpenConnection()
|
||||
Dim ConnectionString = String.Empty
|
||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
'ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=sa;Pwd=BmWr501956"
|
||||
@@ -41,7 +36,7 @@ Partial Class login_ForgotPW
|
||||
ConnectionString = "Server=DEVELOPER.verag.ost.dmn\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;"
|
||||
'ConnectionString = "Server=db593295684.db.1and1.com;Database=db593295684;Uid=dbo593295684;Pwd=atilla#2;"
|
||||
End If
|
||||
' Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
|
||||
|
||||
Using con As New SqlConnection(ConnectionString)
|
||||
' Using cmd As New SqlCommand("Validate_User")
|
||||
Using cmd As New SqlCommand("SELECT Username,Password FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username")
|
||||
@@ -55,6 +50,13 @@ Partial Class login_ForgotPW
|
||||
username = dr("Username").ToString()
|
||||
password = dr("Password").ToString()
|
||||
Try
|
||||
If txt_Username.Text = dr("Username").ToString() Then
|
||||
|
||||
check_UserName_regex.IsValid = True
|
||||
Else
|
||||
check_UserName_regex.ErrorMessage = "No valid Username found!"
|
||||
check_UserName_regex.IsValid = False
|
||||
End If
|
||||
regexval_txt_Email.Validate()
|
||||
Catch ex As Exception
|
||||
Dim Msg, Style, Title As String
|
||||
@@ -147,7 +149,9 @@ Partial Class login_ForgotPW
|
||||
Betreff = "Passwort reset"
|
||||
htmlbody = String.Format("Dear, {0},<br /><br /> Please follow the Link to reset your password:<br /><br />" + Environment.NewLine + "<a runat=" + "server" + " href=http://" + getdomianenvironment + "/login/ChangePW.aspx?Par1=" + VERAG_PROG_ALLGEMEIN.cCryptography.Encrypt(tokenname) + ">Link</a>" + Environment.NewLine + "<br />Kind regards, <br />VERAG | EDV Support<br />support@verag.ag,", username, password)
|
||||
ElseIf String.IsNullOrWhiteSpace(HttpContext.Current.Request.ServerVariables("SERVER_NAME")) = True Then
|
||||
MsgBox("Error09:" + Environment.NewLine + " The Domain could not be vaildated. Check Link please or contact the Administrator of the program.")
|
||||
'MsgBox("Error09:" + Environment.NewLine + "The Domain could not be vaildated. Check Link please or contact the Administrator of the program.")
|
||||
lblMessage.ForeColor = Color.OrangeRed
|
||||
lblMessage.Text = "Error09:" + Environment.NewLine + "The Domain could not be vaildated. Check the Link please or contact the Administrator of the program."
|
||||
End If
|
||||
'Dim pg As String = Request.ServerVariables("URL")
|
||||
'MsgBox("/" + ServPort + Request.ServerVariables("URL"))
|
||||
@@ -165,7 +169,9 @@ Partial Class login_ForgotPW
|
||||
lblMessage.ForeColor = Color.OrangeRed
|
||||
lblMessage.Text = "Error07: Die Paramter wurden nicht alle gesetzt. Bitte Felder überprüfen!"
|
||||
End If
|
||||
MsgBox("SENT")
|
||||
lblMessage.ForeColor = Color.OrangeRed
|
||||
lblMessage.Text = "Success" + Environment.NewLine + " Mail sent. Please check your inbox."
|
||||
'MsgBox("SENT")
|
||||
Return True
|
||||
Else
|
||||
lblMessage.ForeColor = Color.Red
|
||||
|
||||
Reference in New Issue
Block a user