diff --git a/css/login/loginFLEX.css b/css/login/loginFLEX.css index 89ece48..a5b42b1 100644 --- a/css/login/loginFLEX.css +++ b/css/login/loginFLEX.css @@ -21,7 +21,7 @@ #content_container { position: absolute; - display: flex; + display: 690pc; justify-content: center; align-items: center; width: 100%; @@ -32,7 +32,7 @@ .container-fluid { width: 400px; - height: 274px; + height: 450px; background-color: rgba(255,255,255,0.5); top: 40%; bottom: auto; @@ -76,15 +76,12 @@ width: 140px; height: 25px; } - #Password { margin-right: -20px; } - #UserName { font-size: 17px; } - #CustomerID { color: #003680; font-size: 1.125em; diff --git a/login/ChangePW.aspx.vb b/login/ChangePW.aspx.vb index 2e7a672..da8fe7b 100644 --- a/login/ChangePW.aspx.vb +++ b/login/ChangePW.aspx.vb @@ -45,16 +45,7 @@ Partial Class ChangePW btn_submitpw.Enabled = False End If End Sub - Public Function geturlofpage() As String - Dim url = Request.Url.Authority + HttpContext.Current.Request.RawUrl.ToString() - If Request.ServerVariables("HTTPS") = "on" Then - url = "https://" + url - Else - url = "http://" + url - End If - Return url - End Function Protected Sub btn_submitpw_Click(sender As Object, e As EventArgs) Dim tempstr As String = "" diff --git a/login/login_FLEX.aspx b/login/login_FLEX.aspx index 720da63..1401f05 100644 --- a/login/login_FLEX.aspx +++ b/login/login_FLEX.aspx @@ -115,7 +115,7 @@ width: 400px; height: 613px; margin: 0 auto; - margin-top: 250px; + margin-top: 0px; } .container-fluid { diff --git a/login/login_FLEX.aspx.vb b/login/login_FLEX.aspx.vb index c0e325a..4e0e15c 100644 --- a/login/login_FLEX.aspx.vb +++ b/login/login_FLEX.aspx.vb @@ -64,10 +64,11 @@ Partial Class login_FLEX ElseIf reqfieldvaluserName_M.IsValid Then passw = tb2_M.Text 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 COUNT(*) FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username AND Password=@Password AND Kundennr=@UserID") + Using cmd As New SqlCommand("SELECT COUNT(*), UserId,Username, Password FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username AND Password=@Password AND Kundennr=@Kundennr") ' cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.AddWithValue("@Username", UserNaMe) cmd.Parameters.AddWithValue("UserID", user_ID) @@ -87,11 +88,26 @@ Partial Class login_FLEX Login1.FailureText = "Account ist nicht freigeschaltet." Exit Select Case Else + If tb.Text = dr("UserId") Then + user_ID = dr("UserID") + Else + Login1.FailureText = "ID cannot be found in the database!" + End If + If tb2.Text = dr("Username") Then + user_ID = dr("Username") + Else + Login1.FailureText = "Username is not in the database!" + End If + If tb3.Text = dr("Password") Then + user_ID = dr("Password") + Else + Login1.FailureText = "Password is not in the database!" + End If + Login1.FailureText = "Erfolgreich validiert." Session.Add("test", UserNaMe) Session.Add("UserID", user_ID) Session.Add("PW", passw) - FormsAuthentication.RedirectFromLoginPage(UserNaMe, True) 'FormsAuthentication.SetAuthCookie(Login1.UserName, True) @@ -108,6 +124,12 @@ Partial Class login_FLEX Protected Sub LoginButton_Click(sender As Object, e As EventArgs) Validate("Login") If Page.IsValid() Then + Dim cb As CheckBox = Page.FindControl("RememberMe") + If cb.Checked = True Then + FormsAuthentication.SetAuthCookie(Login1.UserName, True) + Else + FormsAuthentication.SetAuthCookie(Login1.UserName, False) + End If Response.Redirect("../Customers/CustomsAviso.aspx") Else Response.Redirect("login_FLEX.aspx") @@ -116,6 +138,12 @@ Partial Class login_FLEX Protected Sub LoginButton_M_Click(sender As Object, e As EventArgs) Validate("Login_M") If Page.IsValid() Then + Dim cb As CheckBox = Page.FindControl("RememberMe_M") + If cb.Checked = True Then + FormsAuthentication.SetAuthCookie(Login1.UserName, True) + Else + FormsAuthentication.SetAuthCookie(Login1.UserName, False) + End If Response.Redirect("../Customers/CustomsAviso.aspx") Else Response.Redirect("login_FLEX.aspx")