corrected logic in abfrage und pw change sowie abfrage

This commit is contained in:
ja
2021-10-14 16:40:39 +02:00
parent 54cf8ad651
commit 4ecb221600
5 changed files with 299 additions and 87 deletions

View File

@@ -38,6 +38,41 @@
content: '✖';
color: red;
}
#txt_Pw_WH_M:invalid {
background-color: indianred;
border-color: red;
color: red;
}
#txt_Pw_WH_M:valid {
background-color: lightgreen;
border-color: forestgreen;
color: black;
}
#txt_Pw_M:invalid + span::before {
content: '✖';
color: red;
}
#txt_Pw_M:invalid {
background-color: indianred;
border-color: red;
color: red;
}
#txt_Pw_M:valid {
background-color: lightgreen;
border-color: forestgreen;
color: black;
}
#txt_Pw_M:invalid + span::before {
content: '✖';
color: red;
}
#tbl_main {
font-family: Arial;
font-size: 11px;

View File

@@ -6,6 +6,20 @@
<head>
<%@ import Namespace="MySql.Data.MySqlClient"%>
<!-- Bootstrap -->
<html lang="en"></html>
<!-- Required meta tags -->
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" title="Verag Spedition AG AvisoTV Flex"/>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"/>
<link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.18.3/dist/bootstrap-table.min.css"/>
<!-- Bootstrap CSS -->
<!--<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">-->
<link href="bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"/>
<link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.18.3/dist/bootstrap-table.min.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>VERAG Spedition AG Passwort vergessen</title>
<link rel="stylesheet" type="text/css" href="../css/main.css"/>
@@ -63,16 +77,70 @@
}
</script>
<style>
.bg-key-icon {
background: url("../../images/Icons/service/key-icon-png-22_small.png") no-repeat 1.75% 10px white;
padding-left: 28px;
padding-right: 50px;
width: 227px;
height: 28px;
border: 1px gray solid;
border-radius: 5px 5px 0px 0px;
margin-left: -4px;
}
.bg-key-icon {
background: url("../../images/Icons/service/key-icon-png-22_small.png") no-repeat 1.75% 10px white;
padding-left: 28px;
padding-right: 50px;
width: 227px;
height: 28px;
border: 1px gray solid;
border-radius: 5px 5px 0px 0px;
margin-left: -4px;
}
@media (max-width: 558.98px) {
body {
font-family: 'Poppins', sans-serif;
background: #fafafa;
background-image: url(../../images/road.jpg);
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
background-color: #fff;
overflow-y: clip;
}
#content_container {
display: flex;
justify-content: center;
align-items: center;
width: 400px;
height: 613px;
margin: 0 auto;
margin-top: 0px;
}
.container-fluid {
width: 400px;
height: 713px;
background-color: rgba(255,255,255,0.5);
margin: 0 auto;
margin-top: 150%;
}
#tbl_main_M {
font-family: Arial;
font-size: 11px;
border: 1px solid gray;
width: 300px;
height: 713px;
}
#btn_submitpw_M{
background-color: #003680;
color: #fff;
width: 325px;
height: 32px;
margin-bottom: 0px;
margin-left:-15px;
padding-inline: 2px 2px;
padding: -10px 0px 10px 1px;
font-weight:600;
}
#lbl_Ueberschrift_M{
font-size:30px;
margin-left:15px;
}
}
</style>
</head>
<body>
@@ -80,50 +148,105 @@
<div class="container-fluid">
<form id="form1" runat="server">
<center>
<table id="tbl_main" cellpadding="0" style="margin: 2px 4px 1px 2px">
<tr style="color:#003680;height:38px;">
<td>
<asp:Label ID="lbl_Ueberschrift" runat="server" Text="Passwortwechsel:" style="margin-left:75px"></asp:Label>
</td>
</tr>
<tr style="color:#003680;height:36.67px;">
<td colspan="4">
<asp:TextBox id="txt_Pw" CssClass="bg-key-icon" runat="server" TextMode="Password" Width="250px" Font-Names="Verdana" OnTextChanged="txt_Pw_TextChanged" AutoCompleteType="Disabled" style="margin-left:22px;color:#003680" OnClick="this.value='';"></asp:TextBox>
<span></span>
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/Icons/service/hilfe.png" Height="13px" Width="13px" style="margin-left:12px" ToolTip="Das Passwort muss über mindestens 4 Stellen, ein Sonderzeichen, einen Groß- sowie einen Kleinbuchstaben bei maximal 30 Zeichen verfügen."/>
</td>
</tr>
<tr style="color:#003680;height:36.67px;">
<td>
<asp:TextBox id="txt_Pw_WH" CssClass="bg-key-icon" Width="250px" OnTextChanged="txt_Pw_WH_TextChanged" runat="server" TextMode="Password" Font-Names="Verdana" AutoCompleteType="Disabled" style="margin-left:22px;color:#003680" OnClick="this.value='';"></asp:TextBox>
<span></span>
<asp:Image ID="Image2" runat="server" ImageUrl="~/images/Icons/service/hilfe.png" Height="13px" Width="13px" style="margin-left:12px" ToolTip="Das Passwort muss mit dem vorherigen Feld übereinstimmen."/>
</td>
</tr>
<tr style="color:#003680;height:36.67px;">
<td>
<asp:Button ID="btn_submitpw" runat="server" Text="Passwort wechseln" OnClick="btn_submitpw_Click" Width="340px" style="margin-left:27px;border:none"/>
</td>
</tr>
<tr style="color:#003680;height:20px;">
<td>
<asp:CompareValidator ID="confirmPasswordReq" runat="server" ControlToCompare="txt_Pw" ControlToValidate="txt_Pw_WH" ErrorMessage="Die Passwörter stimmen nicht überein!Bitte nochmals versuchen!" Display="Dynamic"></asp:CompareValidator>
<asp:RequiredFieldValidator ID="reqPasswtxt" runat="server" ErrorMessage="Bitte Passwort wiederholen!" ControlToValidate="txt_Pw_WH" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ControlToValidate="txt_Pw_WH" runat="server" ID="regexval_txt_Pw_WH" ValidationGroup="TXT_val" ValidationExpression="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d]).{4,35}$" Display="Dynamic" ErrorMessage="Das Passwort muss mindestens den Kriterien des Info-Symbols entsprechen!" SetFocusOnError="true"></asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="reqPassw1txt" runat="server" ErrorMessage="Bitte ein Passwort eingeben!" ControlToValidate="txt_Pw" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ControlToValidate="txt_Pw" runat="server" ID="regexval_txt_Pw" ValidationGroup="TXT_val" ValidationExpression="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d]).{4,35}$" Display="Dynamic" ErrorMessage="Das Passwort muss mindestens den Kriterien des Info-Symbols entsprechen!" SetFocusOnError="true"></asp:RegularExpressionValidator>
<!-- Große Bildschirme-->
<div class="d-none d-md-block">
<table id="tbl_main" cellpadding="0" style="margin: 2px 4px 1px 2px;border:none; width:400px">
<tr style="color:#003680;height:38px;">
<td>
<asp:Label ID="lbl_Ueberschrift" runat="server" Text="Password change:" style="margin-left:55px"></asp:Label>
</td>
</tr>
<tr style="color:#003680;height:36.67px;">
<td colspan="4">
<asp:TextBox id="txt_Pw" CssClass="bg-key-icon" runat="server" TextMode="Password" Width="250px" Font-Names="Verdana" OnTextChanged="txt_Pw_TextChanged" AutoCompleteType="Disabled" style="margin-left:42px;color:#003680" OnClick="this.value='';"></asp:TextBox>
<span></span>
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/Icons/service/hilfe.png" Height="13px" Width="13px" style="margin-left:32px" ToolTip="The Password has to contain minimum 4 characters. It must have at least 1 special character, one uppercase letter and at least 1 downcase letter at an maximum of 30 characters."/>
</td>
</tr>
<tr style="color:#003680;height:36.67px;">
<td>
<asp:TextBox id="txt_Pw_WH" CssClass="bg-key-icon" Width="250px" OnTextChanged="txt_Pw_WH_TextChanged" runat="server" TextMode="Password" Font-Names="Verdana" AutoCompleteType="Disabled" style="margin-left:42px;color:#003680" OnClick="this.value='';"></asp:TextBox>
<span></span>
<asp:Image ID="Image2" runat="server" ImageUrl="~/images/Icons/service/hilfe.png" Height="13px" Width="13px" style="margin-left:32px" ToolTip="The passwords have to match with each other."/>
</td>
</tr>
</table>
</tr>
<tr style="color:#003680;height:36.67px;">
<td>
<asp:Button ID="btn_submitpw" runat="server" Text="Change the password!" OnClick="btn_submitpw_Click" Width="250px" style="margin-left:38px;border:none"/>
</td>
</tr>
<tr style="color:#003680;height:20px;">
<td>
<asp:RequiredFieldValidator ID="reqPasswtxt" style="margin-left:32px;" runat="server" ControlToValidate="txt_Pw_WH" ErrorMessage="Please repeat the password!" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="confirmPasswordReq" style="margin-left:32px;" runat="server" ControlToCompare="txt_Pw" ControlToValidate="txt_Pw_WH" ErrorMessage="Please try again! The passwords didn't match." Display="Dynamic" ForeColor="Red"></asp:CompareValidator>
<asp:RegularExpressionValidator ID="regexval_txt_Pw_WH" style="margin-left:32px;" runat="server" ControlToValidate="txt_Pw_WH" ValidationGroup="TXT_val" ValidationExpression="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d]).{4,35}$" Display="Dynamic" ForeColor="Red" ErrorMessage="The Password has to match the criterias of the info-button." SetFocusOnError="true"></asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="reqPassw1txt" runat="server" style="margin-left:32px;" ControlToValidate="txt_Pw" ErrorMessage="Please enter a password!" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regexval_txt_Pw" style="margin-left:32px;" runat="server" ControlToValidate="txt_Pw" ValidationGroup="TXT_val" ForeColor="Red" ValidationExpression="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d]).{4,35}$" Display="Dynamic" ErrorMessage="The Password has to match the criterias of the info-button." SetFocusOnError="true"></asp:RegularExpressionValidator>
</td>
</tr>
</table>
</div>
<!--Smartphone-Bildschirme-->
<div class="d-md-none">
<table id="tbl_main_M" cellpadding="0" style="margin: 2px 4px 1px 2px;border:none">
<tr style="color:#003680;height:38px;">
<td>
<asp:Label ID="lbl_Ueberschrift_M" runat="server" Text="Password change:" style="margin-left:35px;font-weight:700;color:#003681;"></asp:Label>
</td>
</tr>
<tr style="color:#003680;height:36.67px;">
<td>
<asp:TextBox id="txt_Pw_M" CssClass="bg-key-icon" runat="server" Font-Size="1.125em" ValidationGroup="TXT_val_M" TextMode="Password" Width="245px" Font-Names="Verdana" OnTextChanged="txt_Pw_TextChanged" AutoCompleteType="Disabled" style="margin-left:22px;color:#003680" OnClick="this.value='';"></asp:TextBox>
<span></span></td>
<td>
<asp:ImageButton ID="Image1_M" runat="server" ImageUrl="~/images/Icons/service/hilfe.png" Height="22px" Width="19px" style="margin-left:12px"/>
</td>
</tr >
<tr style="color:#003680;height:36.67px;">
<td>
<asp:TextBox id="txt_Pw_WH_M" CssClass="bg-key-icon" Width="245px" Font-Size="1.125em" ValidationGroup="TXT_val_WH_M" OnTextChanged="txt_Pw_WH_TextChanged" runat="server" TextMode="Password" Font-Names="Verdana" AutoCompleteType="Disabled" style="margin-left:22px;color:#003680" OnClick="this.value='';"></asp:TextBox>
<span></span></td>
<td>
<asp:ImageButton ID="Image2_M" runat="server" ImageUrl="~/images/Icons/service/hilfe.png" Height="22px" Width="19px" style="margin-left:12px;border:none;margin-top:15px" />
</td>
</tr>
<tr style="color:#003680;height:36.67px;">
<td>
<asp:Button ID="btn_submitpw_M" runat="server" Text="Change the password!" OnClick="btn_submitpw_Click" Width="290px" style="margin-left:15px;border:none;margin-top:1px"/>
</td>
</tr>
<tr style="color:#003680;height:20px;">
<td>
<asp:RequiredFieldValidator ID="reqPasswtxt_M" runat="server" ControlToValidate="txt_Pw_WH_M" ErrorMessage="Please repeat the password!" ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="confirmPasswordReq_M" runat="server" ControlToCompare="txt_Pw_M" ControlToValidate="txt_Pw_WH_M" ValidationGroup="TXT_val_WH_M" ForeColor="Red" ErrorMessage="Please try again! The passwords didn't match." Display="Dynamic"></asp:CompareValidator>
<asp:RegularExpressionValidator ID="regexval_txt_Pw_WH_M" runat="server" ControlToValidate="txt_Pw_WH_M" ValidationGroup="TXT_val_WH_M" ForeColor="Red" ValidationExpression="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d]).{4,35}$" Display="Dynamic" ErrorMessage="The Password has to match teh criterias of the info-button." SetFocusOnError="true"></asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="reqPassw1txt_M" runat="server" ControlToValidate="txt_Pw_M" ErrorMessage="Please enter a password!" ForeColor="Red" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ControlToValidate="txt_Pw_M" runat="server" ID="regexval_txt_Pw_M" ValidationGroup="TXT_val_M" ForeColor="Red" ValidationExpression="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d]).{4,35}$" Display="Dynamic" ErrorMessage="The Password has to match teh criterias of the info-button." SetFocusOnError="true"></asp:RegularExpressionValidator>
</td>
</tr>
</table>
</div>
</center>
</form>
</div>
</div>
<script type="text/javascript" src="../js/geturlofsite.js">
<script type="text/javascript" src="../js/geturlofsite.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).on("click", function (e) {
if ($(e.target).is("#Image1_M")) {
alert("The Password has to contain minimum 4 characters. It must have at least 1 special character, one uppercase letter and at least 1 downcase letter at an maximum of 30 characters");
} else if ($(e.target).is("#Image2_M")) {
alert("The passwords have to match with each other.");
}
});
</script>
</body>
</html>

View File

@@ -53,39 +53,67 @@ Partial Class login_ChangePW
Protected Sub btn_submitpw_Click(sender As Object, e As EventArgs)
Dim tempstr As String = ""
Dim Msg, Style, Title As String
reqPasswtxt.Validate()
reqPassw1txt.Validate()
If confirmPasswordReq.IsValid = True Then
If String.IsNullOrEmpty(txt_Pw.Text) = Not True AndAlso String.IsNullOrEmpty(txt_Pw_WH.Text) = Not True AndAlso String.IsNullOrEmpty(txt_Pw_M.Text) = True AndAlso String.IsNullOrEmpty(txt_Pw_WH_M.Text) = True Then
reqPasswtxt.Validate()
reqPassw1txt.Validate()
reqPassw1txt_M.Enabled = False
reqPasswtxt.Enabled = False
tempstr = txt_Pw.Text
ElseIf String.IsNullOrEmpty(txt_Pw.Text) = True AndAlso String.IsNullOrEmpty(txt_Pw_WH.Text) = True AndAlso String.IsNullOrEmpty(txt_Pw_M.Text) = Not True AndAlso String.IsNullOrEmpty(txt_Pw_WH_M.Text) = Not True Then
reqPasswtxt.Enabled = False
reqPassw1txt.Enabled = False
reqPasswtxt_M.Validate()
reqPassw1txt_M.Validate()
tempstr = txt_Pw_M.Text
Else
tempstr = "Error01"
End If
If txt_Pw.Text = tempstr Then
Msg = "PW erfolgreich geändert!"
Style = vbOKOnly + vbInformation + vbDefaultButton1
Title = "Information"
MsgBox(Msg, Style, Title)
If MsgBox(Msg, Style, Title).Ok Then
Response.Redirect("login_FLEX.aspx")
End If
ElseIf tempstr = "Error01" Then
Msg = "PW nicht erfolgreich geändert!"
Style = vbAbortRetryIgnore + vbCritical + vbDefaultButton1
Title = "Error"
MsgBox(Msg, Style, Title)
If MsgBox(Msg, Style, Title).Retry Then
Response.Redirect(Request.RawUrl)
ElseIf MsgBox(Msg, Style, Title).Abort Then
Response.Redirect("../newPageJulius_Sidebar.aspx")
ElseIf MsgBox(Msg, Style, Title).Ignore Then
Try
Catch ex As Exception
End Try
If txt_Pw.Text = tempstr And txt_Pw_WH.Text = tempstr AndAlso txt_Pw_M.Text = String.Empty And txt_Pw_WH_M.Text = String.Empty Then
Msg = "PW erfolgreich geändert!"
Style = vbOKOnly + vbInformation + vbDefaultButton1
Title = "Information"
regexval_txt_Pw.ForeColor = Drawing.Color.Green
regexval_txt_Pw.Text = "Password has been changed successfully!"
'MsgBox(Msg, Style, Title)
' If MsgBox(Msg, Style, Title).Ok Then
'Response.Redirect("login_FLEX.aspx")
'End If
ElseIf txt_Pw_M.Text = tempstr And txt_Pw_WH_M.Text = tempstr AndAlso txt_Pw.Text = String.Empty And txt_Pw_M.Text = String.Empty Then
Msg = "PW erfolgreich geändert!"
Style = vbOKOnly + vbInformation + vbDefaultButton1
Title = "Information"
regexval_txt_Pw.ForeColor = Drawing.Color.Green
regexval_txt_Pw.Text = "Password has been changed successfully!"
'MsgBox(Msg, Style, Title)
' If MsgBox(Msg, Style, Title).Ok Then
'Response.Redirect("login_FLEX.aspx")
'End If
ElseIf tempstr = "Error01" Then
regexval_txt_Pw.ForeColor = Drawing.Color.MediumVioletRed
regexval_txt_Pw.Text = "Password has not been changed successfully!"
' Msg = "PW nicht erfolgreich geändert!"
' Style = vbAbortRetryIgnore + vbCritical + vbDefaultButton1
' Title = "Error"
'MsgBox(Msg, Style, Title)
'If MsgBox(Msg, Style, Title).Retry Then
'Response.Redirect(Request.RawUrl)
'ElseIf MsgBox(Msg, Style, Title).Abort Then
' Response.Redirect("../newPageJulius_Sidebar.aspx")
'ElseIf MsgBox(Msg, Style, Title).Ignore Then
' Try
' Catch ex As Exception
' End Try
End If
End If
End Sub
Protected Sub txt_Pw_TextChanged(sender As Object, e As EventArgs)
@@ -119,4 +147,8 @@ Partial Class login_ChangePW
End If
End Function
Protected Sub Image1_M_Click(sender As Object, e As ImageClickEventArgs)
MsgBox("")
End Sub
End Class

View File

@@ -318,7 +318,7 @@
<asp:TextBox ID="txtEmail_M" runat="server" Width="325px" ValidationGroup="Valtxtemail_M" Font-Size="2.025em" Text="E-Mail" CssClass="bg-email-icon" style="margin-left:25px;color:#003680;" OnClick="this.value='';"/>
<asp:RequiredFieldValidator ID="valreqtxtEmail_M" ControlToValidate="txtEmail" ValidationGroup="Valtxtemail_M" runat="server" Text="Require E-Mail Address" ></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ControlToValidate="txtEmail_M" Font-Size="24px" runat="server" ID="regexval_txt_Email_M" ValidationGroup="Valtxtemail_M" ValidationExpression="[\w\.]+\@(\bverag.ag\b)" Display="Dynamic" ErrorMessage="The E-Mail has not the correct domain!" SetFocusOnError="true"></asp:RegularExpressionValidator>
<asp:RegularExpressionValidator ControlToValidate="txtEmail_M" Font-Size="24px" runat="server" ID="regexval_2_txt_Email" ValidationGroup="Valtxtemail_M" ValidationExpression="[\w\.]+\@[\w]+(?:\.[\w]{3}|\.[\w]{2}\.[\w]{2}|\.[\w]{2})\b" Display="Dynamic" ErrorMessage="The E-Mail has not the correct domain!" SetFocusOnError="true"></asp:RegularExpressionValidator>
<asp:RegularExpressionValidator ControlToValidate="txtEmail_M" Font-Size="24px" runat="server" ID="regexval_2_txt_Email_M" ValidationGroup="Valtxtemail_M" ValidationExpression="[\w\.]+\@[\w]+(?:\.[\w]{3}|\.[\w]{2}\.[\w]{2}|\.[\w]{2})\b" Display="Dynamic" ErrorMessage="The E-Mail has not the correct domain!" SetFocusOnError="true"></asp:RegularExpressionValidator>
</td></tr>
<tr style="color:#003680; height:80px;">
<td align="left" colspan="2">

View File

@@ -17,17 +17,21 @@ Partial Class login_ForgotPW
Dim password As String = String.Empty
Dim email As String = String.Empty
Dim tokenname As String = String.Empty
If txtEmail_M.Text = String.Empty And txt_Username_M.Text = String.Empty Then
If txtEmail.Text = String.Empty And txt_Username_M.Text = String.Empty Then
valreqtxtEmail_M.Enabled = False
valreqtxtEmail.Enabled = True
regexval_txt_Email_2.Enabled = True
regexval_txt_Email.Enabled = True
regexval_2_txt_Email_M.Enabled = False
valreqtxtEmail.Validate()
check_UserName_regex.Validate()
If valreqtxtEmail.IsValid = True AndAlso check_UserName_regex.IsValid = True Then
email = txtEmail.Text
username = txt_Username.Text
username = txt_Username_M.Text
ElseIf valreqtxtEmail.IsValid = False Then
valreqtxtEmail.ErrorMessage = "Annotation: The given Domain is not the company domain."
regexval_txt_Email.Validate()
valreqtxtEmail.IsValid = True
regexval_txt_Email_2.IsValid = True
If check_UserName_regex.IsValid = False Then
check_UserName_regex.ErrorMessage = "Annotation: The Username does not match the requirements."
Else
@@ -36,7 +40,9 @@ Partial Class login_ForgotPW
End If
Else
valreqtxtEmail_M.Enabled = True
valreqtxtEmail.Enabled = False
regexval_txt_Email.Enabled = False
regexval_txt_Email_2.Enabled = False
regexval_2_txt_Email_M.Enabled = True
valreqtxtEmail_M.Validate()
check_UserName_regex_M.Validate()
If valreqtxtEmail_M.IsValid = True AndAlso check_UserName_regex_M.IsValid = True Then
@@ -44,7 +50,7 @@ Partial Class login_ForgotPW
username = txt_Username_M.Text
ElseIf valreqtxtEmail_M.IsValid = False Then
valreqtxtEmail_M.ErrorMessage = "Annotation: The given Domain is not the company domain."
regexval_txt_Email_M.Validate()
regexval_2_txt_Email_M.Validate()
valreqtxtEmail_M.IsValid = True
If check_UserName_regex_M.IsValid = False Then
check_UserName_regex_M.ErrorMessage = "Annotation: The Username does not match the requirements."
@@ -77,24 +83,40 @@ Partial Class login_ForgotPW
password = dr("Password").ToString()
email = dr("Email").ToString()
Try
If txt_Username.Text = dr("Username").ToString() Then
If txt_Username.Text = dr("Username").ToString() And String.IsNullOrEmpty(txt_Username_M.Text) = True Then
check_UserName_regex_M.Enabled = False
check_UserName_regex.Enabled = True
check_UserName_regex.IsValid = True
username = txt_Username.Text
Else
ElseIf txt_Username_M.Text = dr("Username").ToString() And String.IsNullOrEmpty(txt_Username.Text) = True Then
check_UserName_regex.Enabled = False
check_UserName_regex_M.Enabled = True
check_UserName_regex_M.IsValid = True
username = txt_Username_M.Text
ElseIf String.IsNullOrEmpty(txt_Username_M.Text) = True AndAlso String.IsNullOrEmpty(txtEmail_M.Text) = True Then
check_UserName_regex_M.MatchTimeout = 3000
check_UserName_regex_M.ErrorMessage = "No valid Username found in out database!"
check_UserName_regex_M.IsValid = False
ElseIf String.IsNullOrEmpty(txt_Username.Text) = False Then
check_UserName_regex.MatchTimeout = 3000
check_UserName_regex.ErrorMessage = "No valid Username found in out database!"
check_UserName_regex.IsValid = False
End If
If txtEmail.Text = dr("Email").ToString() Then
If (txtEmail.Text = dr("Email").ToString() And txtEmail_M.Text = String.Empty) Then
regexval_txt_Email_M.Enabled = False
regexval_txt_Email.Enabled = True
regexval_txt_Email.Validate()
email = txtEmail.Text
lblMessage.ForeColor = Color.Green
lblMessage.Text = "The given e-mail exists in our database."
ElseIf (txtEmail_M.Text = dr("Email").ToString() And txtEmail.Text = String.Empty) Then
regexval_txt_Email_M.Validate()
email = txtEmail_M.Text
lblMessage_M.ForeColor = Color.Green
lblMessage_M.Text = "The given e-mail exists in our database."
Else
lblMessage.ForeColor = Color.Red
lblMessage.Text = "The given e-mail does not exist in our database."
lblMessage_M.ForeColor = Color.Red
lblMessage_M.Text = "The given e-mail does not exist in our database."
End If
Catch ex As Exception