Änderungen Css und login logiken

This commit is contained in:
ja
2021-10-19 16:28:05 +02:00
parent 33776acc74
commit e4a82f6bb4
5 changed files with 67 additions and 65 deletions

View File

@@ -23,7 +23,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: 0 auto; margin: 0 auto;
margin-top: 0px; margin-top: 250px;
} }
.container-fluid { .container-fluid {

View File

@@ -19,7 +19,7 @@
} }
#content_container { #content_container {
position: absolute; position: absolute;
display: 690pc; display: 690px;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 100%; width: 100%;
@@ -35,7 +35,7 @@
bottom: auto; bottom: auto;
left: -20%; left: -20%;
right: 520px; right: 520px;
margin: auto; margin: 15% auto auto auto;
} }
#tbl_main { #tbl_main {
font-family: Arial; font-family: Arial;

View File

@@ -51,11 +51,14 @@ Partial Class ForgotPW
If Boolemail_desktop_notempty = True Then If Boolemail_desktop_notempty = True Then
regexval_txt_Email.Validate() regexval_txt_Email.Validate()
If regexval_txt_Email.IsValid = True Then If regexval_txt_Email.IsValid = True Then
Boolemail_desktop_regex = True
Boolemail_desktop_regexdomain = True Boolemail_desktop_regexdomain = True
Boolemail_mobile_regex = False
Boolemail_mobile_regexdomain = False Boolemail_mobile_regexdomain = False
End If End If
regexval_txt_Email_2.Validate()
If regexval_txt_Email_2.IsValid = True Then
Boolemail_desktop_regex = True
Boolemail_mobile_regex = False
End If
If Boolemail_desktop_notempty = True AndAlso Boolemail_desktop_regexdomain = True AndAlso Boolemail_desktop_regex = True Then If Boolemail_desktop_notempty = True AndAlso Boolemail_desktop_regexdomain = True AndAlso Boolemail_desktop_regex = True Then
email = txtEmail.Text email = txtEmail.Text
Else Else
@@ -99,31 +102,36 @@ Partial Class ForgotPW
If String.IsNullOrEmpty(txtEmail_M.Text) = False And String.IsNullOrEmpty(txt_Username_M.Text) = False And String.IsNullOrEmpty(txtEmail.Text) = True And String.IsNullOrEmpty(txt_Username.Text) = True Then If String.IsNullOrEmpty(txtEmail_M.Text) = False And String.IsNullOrEmpty(txt_Username_M.Text) = False And String.IsNullOrEmpty(txtEmail.Text) = True And String.IsNullOrEmpty(txt_Username.Text) = True Then
valreqtxtEmail_M.Enabled = True valreqtxtEmail_M.Enabled = True
regexval_2_txt_Email_M.Enabled = True regexval_2_txt_Email_M.Enabled = True
valreqtxtusername_M.Enabled = True
regexval_txt_Email.Enabled = False regexval_txt_Email.Enabled = False
regexval_txt_Email_2.Enabled = False regexval_txt_Email_2.Enabled = False
valreqtxtusername.Enabled = False valreqtxtusername.Enabled = False
valreqtxtusername_M.Enabled = True
valreqtxtEmail_M.Validate() valreqtxtEmail_M.Validate()
If valreqtxtEmail_M.IsValid = True Then If valreqtxtEmail_M.IsValid = True Then
Boolemail_mobile_notempty = True Boolemail_mobile_notempty = True
Boolemail_desktop_notempty = False 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 If Boolemail_mobile_regexdomain = True Then
regexval_2_txt_Email_M.Validate() regexval_2_txt_Email_M.Validate()
If regexval_2_txt_Email_M.IsValid = True Then If regexval_2_txt_Email_M.IsValid = True Then
Boolemail_mobile_regex = True Boolemail_mobile_regex = True
Boolemail_desktop_regex = False Boolemail_desktop_regex = False
End If
If Boolemail_mobile_notempty = True AndAlso Boolemail_mobile_regexdomain = True AndAlso Boolemail_mobile_regex = True Then If Boolemail_mobile_notempty = True AndAlso Boolemail_mobile_regexdomain = True AndAlso Boolemail_mobile_regex = True Then
email = txtEmail.Text email = txtEmail_M.Text
Else Else
regexval_txt_Email_2.IsValid = True regexval_txt_Email_M.IsValid = True
Boolemail_mobile_regex = True Boolemail_mobile_regex = True
Boolemail_desktop_regex = False Boolemail_desktop_regex = False
If Boolemail_mobile_regexdomain = True Then If Boolemail_mobile_regexdomain = True Then
email = txtEmail_M.Text email = txtEmail_M.Text
End If End If
End If End If
End If
ElseIf valreqtxtEmail_M.IsValid = False Then ElseIf valreqtxtEmail_M.IsValid = False Then
Boolemail_mobile_regexdomain = False Boolemail_mobile_regexdomain = False
valreqtxtEmail.ErrorMessage = "Annotation: The given Domain is not the company domain." valreqtxtEmail.ErrorMessage = "Annotation: The given Domain is not the company domain."
@@ -131,7 +139,8 @@ Partial Class ForgotPW
Boolemail_mobile_regex = True Boolemail_mobile_regex = True
If Boolemail_mobile_regex = True AndAlso Boolemail_mobile_regexdomain = False Then If Boolemail_mobile_regex = True AndAlso Boolemail_mobile_regexdomain = False Then
regexval_txt_Email_2.IsValid = True regexval_txt_Email_2.IsValid = True
email = txtEmail.Text email = txtEmail_M.Text
End If
End If End If
End If End If
End If End If
@@ -151,7 +160,7 @@ Partial Class ForgotPW
End If End If
End If End If
End If End If
End If
'Erweiterte Degub Msg-Box 'Erweiterte Degub Msg-Box
'MsgBox("Userdaten in App" + Environment.NewLine + email + Environment.NewLine + username + Environment.NewLine + "Userdaten desktop" + txt_Username.Text + Environment.NewLine + txtEmail.Text + Environment.NewLine + "Userdaten Mobil:" + Environment.NewLine + txtEmail_M.Text + Environment.NewLine + txt_Username_M.Text) 'MsgBox("Userdaten in App" + Environment.NewLine + email + Environment.NewLine + username + Environment.NewLine + "Userdaten desktop" + txt_Username.Text + Environment.NewLine + txtEmail.Text + Environment.NewLine + "Userdaten Mobil:" + Environment.NewLine + txtEmail_M.Text + Environment.NewLine + txt_Username_M.Text)
@@ -165,10 +174,10 @@ Partial Class ForgotPW
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
End If
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 Username,Password,Email,KundenNr FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username") Using cmd As New SqlCommand("SELECT Username,Password,Email,KundenNr FROM [VERAG_HOMEPAGE].[dbo].[Users] WHERE Username=@Username AND Email=@Email")
' cmd.CommandType = CommandType.StoredProcedure ' cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@Username", username) cmd.Parameters.AddWithValue("@Username", username)
cmd.Connection = con cmd.Connection = con
@@ -182,16 +191,10 @@ Partial Class ForgotPW
userID = VERAG_PROG_ALLGEMEIN.cCryptography2.Encrypt(dr("KundenNr").ToString()) userID = VERAG_PROG_ALLGEMEIN.cCryptography2.Encrypt(dr("KundenNr").ToString())
Try Try
If txt_Username.Text = dr("Username").ToString() AndAlso String.IsNullOrEmpty(txt_Username_M.Text) = True And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then If txt_Username.Text = dr("Username").ToString() AndAlso String.IsNullOrEmpty(txt_Username_M.Text) = True And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then
check_UserName_regex_M.Enabled = False
check_UserName_regex.Enabled = True
check_UserName_regex.IsValid = True
username = txt_Username.Text username = txt_Username.Text
ElseIf txt_Username_M.Text = dr("Username").ToString() AndAlso txt_Username.Text = String.Empty And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then ElseIf txt_Username_M.Text = dr("Username").ToString() AndAlso txt_Username.Text = String.Empty And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then
check_UserName_regex.Enabled = False
check_UserName_regex_M.Enabled = True
If check_UserName_regex_M.IsValid = True Then
username = txt_Username_M.Text username = txt_Username_M.Text
End If
ElseIf String.IsNullOrEmpty(txt_Username_M.Text) = True AndAlso String.IsNullOrEmpty(txtEmail.Text) = True And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then ElseIf String.IsNullOrEmpty(txt_Username_M.Text) = True AndAlso String.IsNullOrEmpty(txtEmail.Text) = True And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then
check_UserName_regex_M.MatchTimeout = 3000 check_UserName_regex_M.MatchTimeout = 3000
check_UserName_regex_M.ErrorMessage = "No valid Username found in out database!" check_UserName_regex_M.ErrorMessage = "No valid Username found in out database!"
@@ -202,14 +205,10 @@ Partial Class ForgotPW
check_UserName_regex.IsValid = False check_UserName_regex.IsValid = False
End If End If
If (txtEmail.Text = dr("Email").ToString() AndAlso String.IsNullOrEmpty(txtEmail_M.Text) = True) And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then If (txtEmail.Text = dr("Email").ToString() AndAlso String.IsNullOrEmpty(txtEmail_M.Text) = True) And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then
regexval_txt_Email_M.Enabled = False
regexval_txt_Email.Enabled = True
regexval_txt_Email.Validate()
email = txtEmail.Text email = txtEmail.Text
lblMessage.ForeColor = Color.Green lblMessage.ForeColor = Color.Green
lblMessage.Text = "The given e-mail exists in our database." lblMessage.Text = "The given e-mail exists in our database."
ElseIf (txtEmail_M.Text = dr("Email").ToString() AndAlso String.IsNullOrEmpty(txtEmail.Text) = True) And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then ElseIf (txtEmail_M.Text = dr("Email").ToString() AndAlso String.IsNullOrEmpty(txtEmail.Text) = True) And String.IsNullOrEmpty(VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(userID)) = False Then
regexval_txt_Email_M.Validate()
email = txtEmail_M.Text email = txtEmail_M.Text
lblMessage_M.ForeColor = Color.Green lblMessage_M.ForeColor = Color.Green
lblMessage_M.Text = "The given e-mail exists in our database." lblMessage_M.Text = "The given e-mail exists in our database."
@@ -286,7 +285,7 @@ Partial Class ForgotPW
lblMessage.Text = "The form has not been filled completeley." lblMessage.Text = "The form has not been filled completeley."
End If End If
Catch Exc As Exception Catch Exc As Exception
lblMessage.Text = "Error08: No iput found." lblMessage.Text = "Error08: No input found."
End Try End Try
End Sub End Sub

View File

@@ -284,21 +284,21 @@
<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="CustomerID" CssClass="bg-UID-icon" runat="server" required="true" ValidationGroup="Login" Width="320" Placeholder="User-ID" style="margin-left: 22px" Font-Size="1.25em"></asp:TextBox> <asp:TextBox ID="CustomerID" CssClass="bg-UID-icon" runat="server" required="true" ValidationGroup="Login" Width="320" Placeholder="User-ID" style="margin-left: 22px" Font-Size="1.25em"></asp:TextBox>
<asp:RequiredFieldValidator ID="CustomerIDrequired" runat="server" ControlToValidate="CustomerID" ForeColor="Red" style="font-size:16px" SetFocusOnError="true" ValidationGroup="Login" ErrorMessage="Please enter the User-ID."></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="CustomerIDrequired" runat="server" ControlToValidate="CustomerID" ForeColor="Red" style="font-size:17px" SetFocusOnError="true" ValidationGroup="Login" ErrorMessage="Please enter the User-ID."></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valid_getNumberInput" ControlToValidate="CustomerID" style="font-size:16px" ForeColor="Red" ValidationGroup="Login" runat="server" Display="Dynamic" SetFocusOnError="false" ErrorMessage="The User-ID is not valid." ValidationExpression="[0-9]{4,10}"></asp:RegularExpressionValidator> <asp:RegularExpressionValidator ID="valid_getNumberInput" ControlToValidate="CustomerID" style="font-size:17px" ForeColor="Red" ValidationGroup="Login" runat="server" Display="Dynamic" SetFocusOnError="false" ErrorMessage="The User-ID is not valid." ValidationExpression="[0-9]{4,10}"></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="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" required="true" Font-Size="1.25em" style="margin-left:22px;color:#003680" Placeholder="Username" ></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNamerequired" ForeColor="Red" style="font-size:19px" 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" style="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" style="font-size:16px" 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" style="font-size:16px" 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" 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:RequiredFieldValidator ID="Passwordrequired" runat="server" ControlToValidate="Password" Font-Size="16" ToolTip="Please enter the Password." ValidationGroup="Login" SetFocusOnError="true" ErrorMessage="Password is needed to authenticate."></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="Passwordrequired" 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>
<tr style="color:#003680; height:55px;"> <tr style="color:#003680; height:55px;">
@@ -311,7 +311,6 @@
<asp:CheckBox ID="RememberMe" runat="server" ValidationGroup="Login" Text="Remember me." style="margin-left:22px;"/> <asp:CheckBox ID="RememberMe" runat="server" ValidationGroup="Login" Text="Remember me." style="margin-left:22px;"/>
</td> </td>
<td align="right" colspan="4"> <td align="right" colspan="4">
<a id="LinkButton2" runat="server" target="_top" href="ForgotPW.aspx" style="margin-left:-154px;margin-right:-42px">I forgot my password</a> <a id="LinkButton2" runat="server" target="_top" href="ForgotPW.aspx" style="margin-left:-154px;margin-right:-42px">I forgot my password</a>
</td> </td>
</tr> </tr>

View File

@@ -124,6 +124,7 @@ Partial Class login_FLEX
Protected Sub LoginButton_Click(sender As Object, e As EventArgs) Protected Sub LoginButton_Click(sender As Object, e As EventArgs)
Validate("Login") Validate("Login")
If Page.IsValid() Then If Page.IsValid() Then
MsgBox("Wow1")
Dim cb As CheckBox = Page.FindControl("RememberMe") Dim cb As CheckBox = Page.FindControl("RememberMe")
If cb.Checked = True Then If cb.Checked = True Then
FormsAuthentication.SetAuthCookie(Login1.UserName, True) FormsAuthentication.SetAuthCookie(Login1.UserName, True)
@@ -132,12 +133,14 @@ Partial Class login_FLEX
End If End If
Response.Redirect("../Customers/CustomsAviso.aspx") Response.Redirect("../Customers/CustomsAviso.aspx")
Else Else
MsgBox("Error1")
Response.Redirect("login_FLEX.aspx") Response.Redirect("login_FLEX.aspx")
End If End If
End Sub End Sub
Protected Sub LoginButton_M_Click(sender As Object, e As EventArgs) Protected Sub LoginButton_M_Click(sender As Object, e As EventArgs)
Validate("Login_M") Validate("Login_M")
If Page.IsValid() Then If Page.IsValid() Then
MsgBox("Wow2")
Dim cb As CheckBox = Page.FindControl("RememberMe_M") Dim cb As CheckBox = Page.FindControl("RememberMe_M")
If cb.Checked = True Then If cb.Checked = True Then
FormsAuthentication.SetAuthCookie(Login1.UserName, True) FormsAuthentication.SetAuthCookie(Login1.UserName, True)
@@ -146,6 +149,7 @@ Partial Class login_FLEX
End If End If
Response.Redirect("../Customers/CustomsAviso.aspx") Response.Redirect("../Customers/CustomsAviso.aspx")
Else Else
MsgBox("Error2")
Response.Redirect("login_FLEX.aspx") Response.Redirect("login_FLEX.aspx")
End If End If
End Sub End Sub