diff --git a/Web.config b/Web.config index e8be221..67a4d1d 100644 --- a/Web.config +++ b/Web.config @@ -25,7 +25,7 @@ --> - + diff --git a/login/ForgotPW.aspx b/login/ForgotPW.aspx index 08fbcda..3427755 100644 --- a/login/ForgotPW.aspx +++ b/login/ForgotPW.aspx @@ -290,10 +290,10 @@ - - + + - + diff --git a/login/ForgotPW.aspx.vb b/login/ForgotPW.aspx.vb index 00996b1..beb1af5 100644 --- a/login/ForgotPW.aspx.vb +++ b/login/ForgotPW.aspx.vb @@ -13,6 +13,7 @@ Partial Class ForgotPW Response.Redirect("login/login_FLEX.aspx") End Sub + Protected Sub btn_Send_Click(sender As Object, e As EventArgs) Try Dim username As String = String.Empty @@ -42,20 +43,20 @@ Partial Class ForgotPW If valreqtxtEmail.IsValid = True Then regexval_txt_Email.Validate() If regexval_txt_Email.IsValid = True Then - valreqtxtEmail.ForeColor = Drawing.Color.OrangeRed + regexval_txt_Email.ForeColor = Drawing.Color.OrangeRed regexval_txt_Email.ErrorMessage = "Annotation: The Domain does not match." regexval_txt_Email_2.Validate() If regexval_txt_Email_2.IsValid = True Then - email = txtEmail.Text - regexval_txt_Email_2.ForeColor = Drawing.Color.Lime - regexval_txt_Email_2.ErrorMessage = "E-mail Address valid." + email = txtEmail_M.Text + lblMessage.ForeColor = Drawing.Color.Lime + lblMessage.Text = "E-mail Address valid." End If Else regexval_txt_Email.Validate() - If regexval_txt_Email_2.IsValid = True Then - regexval_txt_Email.ForeColor = Drawing.Color.Lime - regexval_txt_Email.ErrorMessage = "E-mail Address valid." - email = txtEmail.Text + If regexval_txt_Email.IsValid = True Then + lblMessage.ForeColor = Drawing.Color.Lime + lblMessage.Text = "E-mail Address valid." + email = txtEmail_M.Text End If End If End If @@ -657,4 +658,5 @@ Partial Class ForgotPW 'Next 'Return sb.ToString() 'End Function + End Class \ No newline at end of file diff --git a/login/login_FLEX.aspx b/login/login_FLEX.aspx index ae5d67a..3e2802d 100644 --- a/login/login_FLEX.aspx +++ b/login/login_FLEX.aspx @@ -263,7 +263,8 @@ { window.history.back() } - + + @@ -290,14 +291,14 @@ - + - + diff --git a/login/login_FLEX.aspx.vb b/login/login_FLEX.aspx.vb index 8585c8f..9afe316 100644 --- a/login/login_FLEX.aspx.vb +++ b/login/login_FLEX.aspx.vb @@ -4,16 +4,23 @@ Imports System.Data Partial Class login_FLEX Inherits System.Web.UI.Page Protected Sub Page_Load(sender As Object, e As EventArgs) - + If Me.Page.User.Identity.IsAuthenticated Then + Response.Redirect("../Customers/Welcome.aspx") + End If + If Not Me.Page.User.Identity.IsAuthenticated Then + FormsAuthentication.RedirectToLoginPage() + End If End Sub Protected Sub ValidateUser(sender As Object, e As EventArgs) - Dim userId As Integer = 0 + ' cDBFunctions.GetNewOpenConnection() Dim ConnectionString = "" If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then + VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True 'ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=sa;Pwd=BmWr501956" ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;" Else + VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False 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 @@ -115,7 +122,7 @@ 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 UserId,Username, Password FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username AND Password=@Password AND UserId=@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("@KundenNr", Customer_ID) @@ -136,22 +143,22 @@ Partial Class login_FLEX Exit Select Case Else If tb.Text = dr("UserId") Then - Customer_ID = dr("UserId") + Customer_ID = dr("UserId").ToString Else Login1.FailureText = "ID cannot be found in the database!" End If If tb2.Text = dr("Username") Then - Customer_ID = dr("Username") + UserNaMe = dr("Username").ToString Else Login1.FailureText = "Username is not in the database!" End If If tb3.Text = dr("Password") Then - Customer_ID = dr("Password") + passw = dr("Password").ToString Else Login1.FailureText = "Password is not in the database!" End If - Login1.FailureText = "Erfolgreich validiert." + MsgBox("Erfolgreich validiert.") Session.Add("test", UserNaMe) Session.Add("UserID", Customer_ID) Session.Add("PW", passw) @@ -166,7 +173,7 @@ Partial Class login_FLEX con.Close() End Using End Using - MsgBox("Wow1") + MsgBox("Wow1" + Environment.NewLine + Customer_ID + Environment.NewLine + UserNaMe + Environment.NewLine + passw) Page.Response.Redirect("../Customers/CustomsAviso.aspx") End Sub