diff --git a/login/ForgotPW.aspx b/login/ForgotPW.aspx index 1063db0..5d43406 100644 --- a/login/ForgotPW.aspx +++ b/login/ForgotPW.aspx @@ -322,7 +322,7 @@ - + diff --git a/login/ForgotPW.aspx.vb b/login/ForgotPW.aspx.vb index 9df4442..98bf563 100644 --- a/login/ForgotPW.aspx.vb +++ b/login/ForgotPW.aspx.vb @@ -137,74 +137,38 @@ Partial Class ForgotPW valid_getNumber_M_Input.Enabled = True valreqtxtEmail_M.Validate() - If valreqtxtEmail_M.IsValid = True Then - Boolemail_mobile_notempty = True - Boolemail_desktop_notempty = False - If Boolemail_mobile_notempty = True Then - regexval_2_txt_Email_M.Validate() - Boolemail_mobile_regexdomain = True - Boolemail_desktop_regexdomain = False - If Boolemail_mobile_regexdomain = True Then - regexval_2_txt_Email_M.Validate() - If regexval_2_txt_Email_M.IsValid = True Then - Boolemail_mobile_regex = True - Boolemail_desktop_regex = False - If Boolemail_mobile_notempty = True AndAlso Boolemail_mobile_regexdomain = True AndAlso Boolemail_mobile_regex = True Then - email = txtEmail_M.Text - Else - regexval_txt_Email_M.IsValid = True - Boolemail_mobile_regex = True - Boolemail_desktop_regex = False - If Boolemail_mobile_regexdomain = True Then - email = txtEmail_M.Text - End If - End If - End If - ElseIf valreqtxtEmail_M.IsValid = False Then - Boolemail_mobile_regexdomain = False - valreqtxtEmail.ErrorMessage = "Annotation: The given Domain is not the company domain." - regexval_txt_Email.Validate() - Boolemail_mobile_regex = True - If Boolemail_mobile_regex = True AndAlso Boolemail_mobile_regexdomain = False Then - regexval_txt_Email_2.IsValid = True - email = txtEmail_M.Text - End If + regexval_txt_Email_M.Validate() + If regexval_txt_Email_M.IsValid = False Then + regexval_txt_Email_M.ErrorMessage = "Annotation: The Domain does not match." + regexval_txt_Email.Validate() + If regexval_2_txt_Email_M.IsValid = True Then + email = txtEmail_M.Text End If - End If - End If - valreqtxtusername_M.Validate() - If valreqtxtusername_M.IsValid = True Then - Booluser_mobile_notempty = True - Booluser_desktop_notempty = False - check_UserName_regex_M.Validate() - If check_UserName_regex_M.IsValid = False Then - check_UserName_regex_M.ErrorMessage = "Annotation: The Username does not match the requirements." Else - Booluser_desktop_regex = False - Booluser_mobile_regex = True - check_UserName_regex_M.Validate() - If check_UserName_regex_M.IsValid = True AndAlso Booluser_mobile_regex = True AndAlso Booluser_desktop_regex = False Then - username = txt_Username_M.Text + regexval_txt_Email.Validate() + If regexval_2_txt_Email_M.IsValid = True Then + email = txtEmail_M.Text End If End If End If + CustomerID_M_required.Validate() - If CustomerID_M_required.IsValid = True Then - valid_getNumber_M_Input.Validate() - If valid_getNumber_M_Input.IsValid = True Then - customerID = txt_CustomerID.Text + If CustomerID_M_required.IsValid = True Then + valid_getNumber_M_Input.Validate() + If valid_getNumber_M_Input.IsValid = True Then + customerID = txt_CustomerID.Text + Else + valid_getNumber_M_Input.ForeColor = Drawing.Color.Red + valid_getNumber_M_Input.ErrorMessage = "Customer-ID is not numeric or too long." + End If Else valid_getNumber_M_Input.ForeColor = Drawing.Color.Red - valid_getNumber_M_Input.ErrorMessage = "Customer-ID is not numeric or too long." + valid_getNumber_M_Input.ErrorMessage = "Customer-ID is not given." End If Else - valid_getNumber_M_Input.ForeColor = Drawing.Color.Red - valid_getNumber_M_Input.ErrorMessage = "Customer-ID is not given." - End If - Else - 'MsgBox("The form has not been filled completeley.", MsgBoxStyle.Critical, "Error08") - lblMessage.ForeColor = Color.Red + 'MsgBox("The form has not been filled completeley.", MsgBoxStyle.Critical, "Error08") + lblMessage.ForeColor = Color.Red lblMessage.Text = "The form has not been filled completeley." End If @@ -234,8 +198,9 @@ Partial Class ForgotPW username = dr("Username").ToString() password = dr("Password").ToString() email = dr("Email").ToString() - customerID = VERAG_PROG_ALLGEMEIN.cCryptography2.Encrypt(dr("KundenNr").ToString()) - Try + customerID = dr("UserId").ToString() + + Try If txt_Username.Text = dr("Username").ToString() AndAlso String.IsNullOrEmpty(txt_Username_M.Text) = True And String.IsNullOrEmpty(customerID) = False Then username = txt_Username.Text diff --git a/login/login_FLEX.aspx b/login/login_FLEX.aspx index 3cd3152..96b56ec 100644 --- a/login/login_FLEX.aspx +++ b/login/login_FLEX.aspx @@ -269,13 +269,12 @@
-
- - - -
+
+ + +
@@ -321,9 +320,15 @@
+
+
+
+ + +
@@ -371,8 +376,8 @@
@@ -339,15 +344,15 @@
- - - + + +
- - + +
-
-
+ +
diff --git a/login/login_FLEX.aspx.vb b/login/login_FLEX.aspx.vb index df81137..8585c8f 100644 --- a/login/login_FLEX.aspx.vb +++ b/login/login_FLEX.aspx.vb @@ -19,23 +19,23 @@ Partial Class login_FLEX End If Dim tb As TextBox = Login1.FindControl("txt_CustomerID") - Dim tb_M As TextBox = Login1.FindControl("txt_CustomerID_M") - Dim tb2 As TextBox = Login1.FindControl("UserName") - Dim tb2_M As TextBox = Login1.FindControl("UserName_M") + Dim tb_M As TextBox = Login2.FindControl("txt_CustomerID_M") + Dim tb2 As TextBox = Login1.FindControl("Username") + Dim tb2_M As TextBox = Login2.FindControl("Username") Dim tb3 As TextBox = Login1.FindControl("Password") - Dim tb3_M As TextBox = Login1.FindControl("Password_M") + Dim tb3_M As TextBox = Login2.FindControl("Password") Dim reqfieldvaluserID As RequiredFieldValidator = Login1.FindControl("CustomerIDrequired") - Dim reqfieldvaluserID_M As RequiredFieldValidator = Login1.FindControl("CustomerID_M_required") + Dim reqfieldvaluserID_M As RequiredFieldValidator = Login2.FindControl("CustomerID_M_required") Dim reqfieldvaluserName As RequiredFieldValidator = Login1.FindControl("UserNamerequired") - Dim reqfieldvaluserName_M As RequiredFieldValidator = Login1.FindControl("UserName_M_required") + Dim reqfieldvaluserName_M As RequiredFieldValidator = Login2.FindControl("UserName_M_required") Dim reqfieldvalpassw As RequiredFieldValidator = Login1.FindControl("Passwordrequired") - Dim reqfieldvalpassw_M As RequiredFieldValidator = Login1.FindControl("Passwordrequired_M") + Dim reqfieldvalpassw_M As RequiredFieldValidator = Login2.FindControl("Passwordrequired_M") Dim regexuserID As RegularExpressionValidator = Login1.FindControl("valid_getNumberInput") - Dim regexuserID_M As RegularExpressionValidator = Login1.FindControl("valid_getNumber_M_Input") + Dim regexuserID_M As RegularExpressionValidator = Login2.FindControl("valid_getNumber_M_Input") Dim regexusername As RegularExpressionValidator = Login1.FindControl("check_UserName_regex") - Dim regexusername_M As RegularExpressionValidator = Login1.FindControl("check_UserName_M_regex") + Dim regexusername_M As RegularExpressionValidator = Login2.FindControl("check_UserName_M_regex") Dim Customer_ID As String = String.Empty Dim UserNaMe As String = String.Empty @@ -115,10 +115,10 @@ Partial Class login_FLEX ' 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 COUNT(*), UserId,Username, Password FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username AND Password=@Password AND Kundennr=@Kundennr") + Using cmd As New SqlCommand("SELECT UserId,Username, Password FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username AND Password=@Password AND UserId=@KundenNr") ' cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.AddWithValue("@Username", UserNaMe) - cmd.Parameters.AddWithValue("UserID", Customer_ID) + cmd.Parameters.AddWithValue("@KundenNr", Customer_ID) cmd.Parameters.AddWithValue("@Password", passw) cmd.Connection = con con.Open() @@ -166,6 +166,9 @@ Partial Class login_FLEX con.Close() End Using End Using + MsgBox("Wow1") + Page.Response.Redirect("../Customers/CustomsAviso.aspx") + End Sub Protected Sub LoginButton_Click(sender As Object, e As EventArgs)