Änderung der Webconfig

This commit is contained in:
ja
2021-10-21 16:22:45 +02:00
parent d336d2d3c6
commit 51a84e3b33
5 changed files with 33 additions and 23 deletions

View File

@@ -25,7 +25,7 @@
-->
<system.web>
<authentication mode="Forms">
<forms defaultUrl="/Customers/CustomsAviso.aspx" loginUrl="login/Login_FLEX.aspx" slidingExpiration="true" timeout="2880"/>
<forms defaultUrl="/Customers/Welcome.aspx" loginUrl="login/Login_FLEX.aspx" slidingExpiration="true" timeout="2880"/>
</authentication>
<sessionState mode="InProc" timeout="1800" cookieless="false" regenerateExpiredSessionId="false" compressionEnabled="false" useHostingIdentity="true" />
<httpRuntime requestValidationMode="2.0" targetFramework="4.7"/>

View File

@@ -290,10 +290,10 @@
<td align="right" colspan="2">
<asp:Label ID="lblMessage" runat="server" />
</td></tr>
<tr style="color:#003680; height:30px;"><td>
<asp:Button ID="btn_Send" runat="server" Text="Send" Width="300px" Enabled="true" AutoPostBack="True" Font-Size="22px" style="margin-left:22px;border:none" OnClick="btn_Send_Click"/>
<tr style="color:#003680; height:32px;"><td>
<asp:Button ID="btn_Send" runat="server" Text="Send" Width="300px" Enabled="true" AutoPostBack="True" Font-Size="22px" style="margin-left:22px;border:none" OnClick="btn_Send_Click" Height="33px"/>
</td></tr>
<tr><td>
<tr><td>
</td></tr>
</table>
</div>

View File

@@ -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

View File

@@ -263,7 +263,8 @@
{
window.history.back()
}
</script>
</script>
</head>
<body onload="FocusOnInput()">
@@ -290,14 +291,14 @@
</tr>
<tr style="color:#003680; height:46px;">
<td align="left" colspan="2">
<asp:TextBox ID="UserName" runat="server" CssClass="bg-user-icon" TextMode="SingleLine" Width="320" ValidationGroup="Login" required="true" Font-Size="1.25em" style="margin-left:22px;color:#003680" Placeholder="Username" ></asp:TextBox>
<asp:TextBox ID="UserName" runat="server" CssClass="bg-user-icon" TextMode="SingleLine" Width="320" ValidationGroup="Login" Font-Size="1.25em" style="margin-left:22px;color:#003680" Placeholder="Username" ></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNamerequired" ForeColor="Red" Font-Size="17px" runat="server" ControlToValidate="UserName" SetFocusOnError="true" ErrorMessage="Please enter the Username." ToolTip="The Username is required." ValidationGroup="Login"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="check_UserName_regex" ControlToValidate="UserName" Font-Size="17px" ForeColor="Red" ValidationGroup="Login" runat="server" Display="Dynamic" SetFocusOnError="true" ErrorMessage="Username does not meet the requirements." ValidationExpression="^([a-zA-Z1-9]{4,30})$"></asp:RegularExpressionValidator>
</td>
</tr>
<tr style="color:#003680; height:46px;">
<td align="left" colspan="2">
<asp:TextBox ID="Password" runat="server" CssClass="bg-key-icon" TextMode="Password" required="true" Width="320" Font-Size="1.25em" ValidationGroup="Login" MaxLength="30" AutoCompleteType="Disabled" CausesValidation="true" style="margin-left:22px;color:#003680" Placeholder="Password"></asp:TextBox>
<asp:TextBox ID="Password" runat="server" CssClass="bg-key-icon" TextMode="Password" Width="320" Font-Size="1.25em" ValidationGroup="Login" MaxLength="30" AutoCompleteType="Disabled" CausesValidation="true" style="margin-left:22px;color:#003680" Placeholder="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="Passwordrequired" ForeColor="Red" runat="server" ControlToValidate="Password" Font-Size="17px" ToolTip="Please enter the Password." ValidationGroup="Login" SetFocusOnError="true" ErrorMessage="Password is needed to authenticate."></asp:RequiredFieldValidator>
</td>
</tr>

View File

@@ -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