Änderung der Webconfig
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
-->
|
-->
|
||||||
<system.web>
|
<system.web>
|
||||||
<authentication mode="Forms">
|
<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>
|
</authentication>
|
||||||
<sessionState mode="InProc" timeout="1800" cookieless="false" regenerateExpiredSessionId="false" compressionEnabled="false" useHostingIdentity="true" />
|
<sessionState mode="InProc" timeout="1800" cookieless="false" regenerateExpiredSessionId="false" compressionEnabled="false" useHostingIdentity="true" />
|
||||||
<httpRuntime requestValidationMode="2.0" targetFramework="4.7"/>
|
<httpRuntime requestValidationMode="2.0" targetFramework="4.7"/>
|
||||||
|
|||||||
@@ -290,8 +290,8 @@
|
|||||||
<td align="right" colspan="2">
|
<td align="right" colspan="2">
|
||||||
<asp:Label ID="lblMessage" runat="server" />
|
<asp:Label ID="lblMessage" runat="server" />
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr style="color:#003680; height:30px;"><td>
|
<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"/>
|
<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>
|
</td></tr>
|
||||||
<tr><td>
|
<tr><td>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ Partial Class ForgotPW
|
|||||||
Response.Redirect("login/login_FLEX.aspx")
|
Response.Redirect("login/login_FLEX.aspx")
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Protected Sub btn_Send_Click(sender As Object, e As EventArgs)
|
Protected Sub btn_Send_Click(sender As Object, e As EventArgs)
|
||||||
Try
|
Try
|
||||||
Dim username As String = String.Empty
|
Dim username As String = String.Empty
|
||||||
@@ -42,20 +43,20 @@ Partial Class ForgotPW
|
|||||||
If valreqtxtEmail.IsValid = True Then
|
If valreqtxtEmail.IsValid = True Then
|
||||||
regexval_txt_Email.Validate()
|
regexval_txt_Email.Validate()
|
||||||
If regexval_txt_Email.IsValid = True Then
|
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.ErrorMessage = "Annotation: The Domain does not match."
|
||||||
regexval_txt_Email_2.Validate()
|
regexval_txt_Email_2.Validate()
|
||||||
If regexval_txt_Email_2.IsValid = True Then
|
If regexval_txt_Email_2.IsValid = True Then
|
||||||
email = txtEmail.Text
|
email = txtEmail_M.Text
|
||||||
regexval_txt_Email_2.ForeColor = Drawing.Color.Lime
|
lblMessage.ForeColor = Drawing.Color.Lime
|
||||||
regexval_txt_Email_2.ErrorMessage = "E-mail Address valid."
|
lblMessage.Text = "E-mail Address valid."
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
regexval_txt_Email.Validate()
|
regexval_txt_Email.Validate()
|
||||||
If regexval_txt_Email_2.IsValid = True Then
|
If regexval_txt_Email.IsValid = True Then
|
||||||
regexval_txt_Email.ForeColor = Drawing.Color.Lime
|
lblMessage.ForeColor = Drawing.Color.Lime
|
||||||
regexval_txt_Email.ErrorMessage = "E-mail Address valid."
|
lblMessage.Text = "E-mail Address valid."
|
||||||
email = txtEmail.Text
|
email = txtEmail_M.Text
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -657,4 +658,5 @@ Partial Class ForgotPW
|
|||||||
'Next
|
'Next
|
||||||
'Return sb.ToString()
|
'Return sb.ToString()
|
||||||
'End Function
|
'End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -264,6 +264,7 @@
|
|||||||
window.history.back()
|
window.history.back()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onload="FocusOnInput()">
|
<body onload="FocusOnInput()">
|
||||||
@@ -290,14 +291,14 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr style="color:#003680; height:46px;">
|
<tr style="color:#003680; height:46px;">
|
||||||
<td align="left" colspan="2">
|
<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: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>
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr style="color:#003680; height:46px;">
|
<tr style="color:#003680; height:46px;">
|
||||||
<td align="left" colspan="2">
|
<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>
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -4,16 +4,23 @@ Imports System.Data
|
|||||||
Partial Class login_FLEX
|
Partial Class login_FLEX
|
||||||
Inherits System.Web.UI.Page
|
Inherits System.Web.UI.Page
|
||||||
Protected Sub Page_Load(sender As Object, e As EventArgs)
|
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
|
End Sub
|
||||||
Protected Sub ValidateUser(sender As Object, e As EventArgs)
|
Protected Sub ValidateUser(sender As Object, e As EventArgs)
|
||||||
Dim userId As Integer = 0
|
|
||||||
' cDBFunctions.GetNewOpenConnection()
|
' cDBFunctions.GetNewOpenConnection()
|
||||||
Dim ConnectionString = ""
|
Dim ConnectionString = ""
|
||||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
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=sa;Pwd=BmWr501956"
|
||||||
ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;"
|
ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=AppUser;Pwd=yp/THDd?xM+pZ$;"
|
||||||
Else
|
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=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;"
|
'ConnectionString = "Server=db593295684.db.1and1.com;Database=db593295684;Uid=dbo593295684;Pwd=atilla#2;"
|
||||||
End If
|
End If
|
||||||
@@ -115,7 +122,7 @@ Partial Class login_FLEX
|
|||||||
' Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
|
' Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
|
||||||
Using con As New SqlConnection(ConnectionString)
|
Using con As New SqlConnection(ConnectionString)
|
||||||
' Using cmd As New SqlCommand("Validate_User")
|
' 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.CommandType = CommandType.StoredProcedure
|
||||||
cmd.Parameters.AddWithValue("@Username", UserNaMe)
|
cmd.Parameters.AddWithValue("@Username", UserNaMe)
|
||||||
cmd.Parameters.AddWithValue("@KundenNr", Customer_ID)
|
cmd.Parameters.AddWithValue("@KundenNr", Customer_ID)
|
||||||
@@ -136,22 +143,22 @@ Partial Class login_FLEX
|
|||||||
Exit Select
|
Exit Select
|
||||||
Case Else
|
Case Else
|
||||||
If tb.Text = dr("UserId") Then
|
If tb.Text = dr("UserId") Then
|
||||||
Customer_ID = dr("UserId")
|
Customer_ID = dr("UserId").ToString
|
||||||
Else
|
Else
|
||||||
Login1.FailureText = "ID cannot be found in the database!"
|
Login1.FailureText = "ID cannot be found in the database!"
|
||||||
End If
|
End If
|
||||||
If tb2.Text = dr("Username") Then
|
If tb2.Text = dr("Username") Then
|
||||||
Customer_ID = dr("Username")
|
UserNaMe = dr("Username").ToString
|
||||||
Else
|
Else
|
||||||
Login1.FailureText = "Username is not in the database!"
|
Login1.FailureText = "Username is not in the database!"
|
||||||
End If
|
End If
|
||||||
If tb3.Text = dr("Password") Then
|
If tb3.Text = dr("Password") Then
|
||||||
Customer_ID = dr("Password")
|
passw = dr("Password").ToString
|
||||||
Else
|
Else
|
||||||
Login1.FailureText = "Password is not in the database!"
|
Login1.FailureText = "Password is not in the database!"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Login1.FailureText = "Erfolgreich validiert."
|
MsgBox("Erfolgreich validiert.")
|
||||||
Session.Add("test", UserNaMe)
|
Session.Add("test", UserNaMe)
|
||||||
Session.Add("UserID", Customer_ID)
|
Session.Add("UserID", Customer_ID)
|
||||||
Session.Add("PW", passw)
|
Session.Add("PW", passw)
|
||||||
@@ -166,7 +173,7 @@ Partial Class login_FLEX
|
|||||||
con.Close()
|
con.Close()
|
||||||
End Using
|
End Using
|
||||||
End Using
|
End Using
|
||||||
MsgBox("Wow1")
|
MsgBox("Wow1" + Environment.NewLine + Customer_ID + Environment.NewLine + UserNaMe + Environment.NewLine + passw)
|
||||||
Page.Response.Redirect("../Customers/CustomsAviso.aspx")
|
Page.Response.Redirect("../Customers/CustomsAviso.aspx")
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Reference in New Issue
Block a user