Änderungen auf neueres Design
@@ -11,7 +11,7 @@ Public Class RegexSammlung_VERAG
|
||||
Return strtemp
|
||||
End Function
|
||||
Function getregPassword() As String
|
||||
Dim strtemp As String = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d]).{4,30}$"
|
||||
Dim strtemp As String = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z\d]).{4,35}$"
|
||||
Return strtemp
|
||||
End Function
|
||||
Function getUsername() As String
|
||||
|
||||
@@ -72,3 +72,24 @@
|
||||
width: 200px;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
.bg-user-icon {
|
||||
background: url("../../images/Icons/service/username-icon-png-5.png") no-repeat 1.75% 10px white;
|
||||
padding-left: 28px;
|
||||
padding-right: 50px;
|
||||
margin-left: -4px;
|
||||
width: 207px;
|
||||
height: 20px;
|
||||
border: 1px gray solid;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
}
|
||||
.bg-email-icon {
|
||||
background: url("../../images/Icons/service/mail-icon.gif") no-repeat 1.75% 10px white;
|
||||
padding-left: 28px;
|
||||
padding-right: 50px;
|
||||
margin-left: -4px;
|
||||
width: 207px;
|
||||
height: 20px;
|
||||
border: 1px gray solid;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
}
|
||||
BIN
images/Icons/main/icon0-vector-493-01.png
Normal file
|
After Width: | Height: | Size: 746 B |
BIN
images/Icons/service/key-icon-png-22.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
images/Icons/service/key-icon-png-22_small.png
Normal file
|
After Width: | Height: | Size: 378 B |
BIN
images/Icons/service/mail-icon.gif
Normal file
|
After Width: | Height: | Size: 893 B |
BIN
images/Icons/service/mail-icon.png
Normal file
|
After Width: | Height: | Size: 305 B |
BIN
images/Icons/service/username-icon-png-5.png
Normal file
|
After Width: | Height: | Size: 711 B |
BIN
images/Icons/service/zahlen.png
Normal file
|
After Width: | Height: | Size: 425 B |
@@ -104,19 +104,13 @@
|
||||
<input type="email" runat="server" style="width:150px" placeholder="example@somehost.com" />
|
||||
</td></tr> -->
|
||||
<tr style="color:#003680; height:30px;">
|
||||
<td align="left" colspan="2">
|
||||
<asp:Label ID="lbl_Email" runat="server" Text="Email Address:" CssClass="txt_design2"></asp:Label>
|
||||
</td>
|
||||
<td align="left" colspan="2">
|
||||
<asp:TextBox ID="txtEmail" runat="server" Width = "207" Font-Size="1.125em" OnTextChanged="txtEmail_TextChanged" style="margin-left:-4px"/>
|
||||
<asp:TextBox ID="txtEmail" runat="server" Width="207px" Font-Size="1.125em" OnTextChanged="txtEmail_TextChanged" Text="E-Mail" CssClass="bg-email-icon" style="margin-left:-4px;color:#003680" OnClick="this.value='';"/>
|
||||
<asp:RegularExpressionValidator ID="regexval_txt_Email" ControlToValidate="txtEmail" runat="server" ValidationExpression="<%=regexemail %>" Display="Dynamic"></asp:RegularExpressionValidator>
|
||||
</td></tr>
|
||||
<tr style="color:#003680; height:30px;">
|
||||
<td align="left" colspan="2">
|
||||
<asp:Label ID="lbl_Username" runat="server" Text="Username:" CssClass="txt_design2"></asp:Label>
|
||||
</td>
|
||||
<td align="left" colspan="2">
|
||||
<asp:TextBox ID="txt_Username" runat="server" Width = "207" Font-Size="1.125em" style="margin-left:-4px" />
|
||||
<asp:TextBox ID="txt_Username" runat="server" CssClass="bg-user-icon" Text="Username" Font-Size="1.125em" Width="207px" style="margin-left:-4px;color:#003680" OnClick="this.value='';" />
|
||||
</td></tr>
|
||||
<tr style="color:#003680; height:30px;">
|
||||
<td align="right" colspan="2">
|
||||
|
||||
@@ -8,13 +8,6 @@ Imports System.Data
|
||||
Partial Class login_ForgotPW
|
||||
Inherits System.Web.UI.Page
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs)
|
||||
If txt_Username.Text = "" Then
|
||||
Try
|
||||
txt_Username.Text = Request.QueryString.Item("urlofchangepwpage")
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub btn_Back_Click(sender As Object, e As EventArgs)
|
||||
Response.Redirect("login/login_FLEX.aspx")
|
||||
@@ -25,9 +18,9 @@ Partial Class login_ForgotPW
|
||||
Dim password As String = String.Empty
|
||||
Dim email As String = txtEmail.Text
|
||||
Dim tokenname As String = ""
|
||||
' cDBFunctions.GetNewOpenConnection()
|
||||
Dim ConnectionString = ""
|
||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
'cDBFunctions.GetNewOpenConnection()
|
||||
Dim ConnectionString = String.Empty
|
||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
'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
|
||||
@@ -47,26 +40,21 @@ Partial Class login_ForgotPW
|
||||
If dr.Read() Then
|
||||
username = dr("Username").ToString()
|
||||
password = dr("Password").ToString()
|
||||
Try
|
||||
|
||||
email = txtEmail.Text
|
||||
|
||||
Catch ex As Exception
|
||||
Dim Msg, Style, Title As String
|
||||
Msg = "E-mail Prüfung fehlgeschlagen!" & vbCrLf + "Bitte erneut versuchen!"
|
||||
Style = vbRetry + vbExclamation + vbDefaultButton1
|
||||
Title = "Fehler bei E-mail Authentifizierung!"
|
||||
MsgBox(Msg, Style, Title)
|
||||
|
||||
If MsgBox(Msg, Style, Title).Yes Then
|
||||
txtEmail.Text = ""
|
||||
txtEmail.Focus()
|
||||
ElseIf MsgBox(Msg, Style, Title).No Then
|
||||
|
||||
End If
|
||||
End Try
|
||||
|
||||
End If
|
||||
Try
|
||||
email = txtEmail.Text
|
||||
Catch ex As Exception
|
||||
Dim Msg, Style, Title As String
|
||||
Msg = "E-mail Prüfung fehlgeschlagen!" & vbCrLf + "Bitte erneut versuchen!"
|
||||
Style = vbRetry + vbExclamation + vbDefaultButton1
|
||||
Title = "Fehler bei E-Mail Authentifizierung!"
|
||||
MsgBox(Msg, Style, Title)
|
||||
If MsgBox(Msg, Style, Title).Yes Then
|
||||
txtEmail.Text = String.Empty
|
||||
txtEmail.Focus()
|
||||
ElseIf MsgBox(Msg, Style, Title).No Then
|
||||
End If
|
||||
End Try
|
||||
End If
|
||||
End Using
|
||||
con.Close()
|
||||
End Using
|
||||
@@ -74,9 +62,8 @@ Partial Class login_ForgotPW
|
||||
If SendEmail(username, password, email, tokenname) = True Then
|
||||
'password = RandomString(New Random, 10)
|
||||
If (getDateoftoken(tokenname) = True) Then
|
||||
Dim msgboxstyle = vbDefaultButton1 + vbOK
|
||||
|
||||
MsgBox(tokenname, msgboxstyle)
|
||||
Dim msgboxstyle = vbDefaultButton1 + vbOK
|
||||
MsgBox(tokenname, msgboxstyle)
|
||||
Else
|
||||
MsgBox("token nicht mehr Gültig! Neuer wird generiert!")
|
||||
tokenname = genToken(username, password, email)
|
||||
@@ -104,20 +91,20 @@ Partial Class login_ForgotPW
|
||||
'End Function
|
||||
|
||||
Function SendEmail(username As String, password As String, email As String, tokenname As String) As Boolean
|
||||
Dim getdomianenvironment As String = ""
|
||||
Dim pagename As String = ""
|
||||
Dim ServPort As String = ""
|
||||
Dim getdomianenvironment As String = String.Empty
|
||||
Dim pagename As String = String.Empty
|
||||
Dim ServPort As String = String.Empty
|
||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
getdomianenvironment = HttpContext.Current.Request.ServerVariables("SERVER_NAME")
|
||||
ServPort = ":" + Request.ServerVariables("SERVER_PORT")
|
||||
pagename = Request.ServerVariables("SCRIPT_NAME")
|
||||
'pagename = Request.ServerVariables("SCRIPT_NAME")
|
||||
ElseIf HttpContext.Current.Request.ServerVariables("SERVER_NAME") = Not "localhost" Then
|
||||
getdomianenvironment = HttpContext.Current.Request.ServerVariables("SERVER_NAME")
|
||||
ServPort = ":" + Request.ServerVariables("SERVER_PORT")
|
||||
pagename = Request.ServerVariables("SCRIPT_NAME")
|
||||
ServPort = String.Empty
|
||||
'pagename = Request.ServerVariables("SCRIPT_NAME")
|
||||
End If
|
||||
'Dim pg As String = Request.ServerVariables("URL")
|
||||
MsgBox("/" + ServPort + Request.ServerVariables("URL"))
|
||||
'MsgBox("/" + ServPort + Request.ServerVariables("URL"))
|
||||
Dim mailto As String = email
|
||||
Dim Betreff As String = "Passwort reset"
|
||||
Dim htmlbody = String.Format("Sehr geehrte/r {0},<br /><br /> Bitte dem Link zum Zurücksetzen des Passwortes folgen:<br /><br /><br />.<br />" + Environment.NewLine + "<a runat=" + "server" + " href=http://" + getdomianenvironment + ServPort + "/login/ChangePW.aspx?Par1=" + VERAG_PROG_ALLGEMEIN.cCryptography.Encrypt(tokenname) + ">Link</a>" + Environment.NewLine + "<br />Mit freundlichen Grüßen,", username, password)
|
||||
@@ -125,13 +112,13 @@ Partial Class login_ForgotPW
|
||||
Dim tokennametemp = genToken(username, password, email)
|
||||
'Dim Strtemp = Session.Keys.Item("urltochangepw")
|
||||
If getDateoftoken(tokennametemp) = True Then
|
||||
' Dim attachment As Attachment = New Attachment(File.OpenRead(excel), "Kundenliste.xlsx")
|
||||
' Msg.Attachments.Add(attachment)
|
||||
' Dim attachment As Attachment = New Attachment(File.OpenRead(excel), "Kundenliste.xlsx")
|
||||
' Msg.Attachments.Add(attachment)
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(mailto, Betreff, htmlbody)
|
||||
MsgBox("SENT")
|
||||
Return True
|
||||
Else
|
||||
MsgBox("Error02: Mail not delivered!")
|
||||
MsgBox("Error02: Mail not delivered!" & vbCrLf & "Neuer Token wird generiert.")
|
||||
tokennametemp = genToken(username, password, email)
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(mailto, Betreff, htmlbody, tokenname)
|
||||
Return False
|
||||
@@ -146,13 +133,12 @@ Partial Class login_ForgotPW
|
||||
Dim time() As Byte = BitConverter.GetBytes(DateTime.UtcNow.ToBinary())
|
||||
Dim Key() As Byte = Guid.NewGuid().ToByteArray()
|
||||
Dim token As String
|
||||
|
||||
Try
|
||||
token = Convert.ToBase64String(time.Concat(Key).ToArray())
|
||||
Return token
|
||||
Catch Ex As Exception
|
||||
Dim Msg, Style, Title As String
|
||||
Msg = "Tokengenerierung fehlgeschlagen!" & vbCrLf & "Eine E-Mail wurde erneut an " + email + " zugesedet."
|
||||
Msg = "Tokengenerierung fehlgeschlagen!" & vbCrLf & "Eine E-Mail wurde erneut an " + email + " zugesendet."
|
||||
Style = vbRetry + vbExclamation + vbDefaultButton1
|
||||
Title = "Fehler bei Token-Generierung"
|
||||
MsgBox(Msg, Style, Title)
|
||||
@@ -160,16 +146,15 @@ Partial Class login_ForgotPW
|
||||
If MsgBox(Msg, Style, Title).Retry Then
|
||||
genToken(username, password, email)
|
||||
If SendEmail(username, password, email, token) = False Then
|
||||
MsgBox("Email konnte wegen eines internen Verschlüsselungsfehlers nicht gesendet werden.", vbOK + vbInformation + vbDefaultButton1, "TokengenerierungsFehler")
|
||||
MsgBox("Email konnte wegen eines internen Verschlüsselungsfehlers nicht gesendet werden.", vbOK + vbInformation + vbDefaultButton1, "Tokengenerierung-Fehler")
|
||||
Else
|
||||
MsgBox("Email wurde erfolgreich gesendet." & vbCr & "Bitte Postfach überprüfen!", vbOK + vbInformation + vbDefaultButton1, "Tokengenerierungs erfolgreich!")
|
||||
MsgBox("Email wurde erfolgreich gesendet." & vbCr & "Bitte Postfach überprüfen!", vbOK + vbInformation + vbDefaultButton1, "Tokengenerierung erfolgreich!")
|
||||
End If
|
||||
Else
|
||||
MsgBox("Tokengenerierung nicht erfolgreich." & vbCrLf & "In 5 Sekunden nochmal versuchen!")
|
||||
Dim jetzt As DateTime = DateTime.UtcNow
|
||||
Dim wenn As DateTime = DateTime.UtcNow.AddSeconds(-5)
|
||||
|
||||
|
||||
If jetzt < wenn Then
|
||||
Return "NotYet"
|
||||
Else
|
||||
@@ -180,12 +165,11 @@ Partial Class login_ForgotPW
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
Function getDateoftoken(tokenname As String) As Boolean
|
||||
Dim data() As Byte = Convert.FromBase64String(tokenname)
|
||||
Dim wenn As DateTime = DateTime.FromBinary(BitConverter.ToInt64(data, 0))
|
||||
If wenn < DateTime.UtcNow.AddMinutes(-30) Then
|
||||
tokenname = ""
|
||||
tokenname = String.Empty
|
||||
MsgBox("Token nicht gefunden oder zu alt!" + Environment.NewLine + "Bitte erneut Mail senden!")
|
||||
Return False
|
||||
ElseIf tokenname = "NotYet" Then
|
||||
@@ -200,8 +184,4 @@ Partial Class login_ForgotPW
|
||||
Protected Sub txtEmail_TextChanged(sender As Object, e As EventArgs)
|
||||
regexval_txt_Email.Validate()
|
||||
End Sub
|
||||
|
||||
Protected Sub Token_tmr_Tick(sender As Object, e As EventArgs)
|
||||
btn_Send.Enabled = False
|
||||
End Sub
|
||||
End Class
|
||||
@@ -39,6 +39,48 @@
|
||||
.txt_design2 {
|
||||
color: #003680;
|
||||
font-size: 1.725em;
|
||||
}
|
||||
.bg-email-icon {
|
||||
background: url("../../images/Icons/service/mail-icon.gif") no-repeat 1.75% 10px white;
|
||||
padding-left: 28px;
|
||||
padding-right: 50px;
|
||||
margin-left: -4px;
|
||||
width: 207px;
|
||||
height: 20px;
|
||||
border: 1px gray solid;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
}
|
||||
|
||||
.bg-user-icon {
|
||||
background: url("../../images/Icons/service/username-icon-png-5.png") no-repeat 1.75% 10px white;
|
||||
padding-left: 28px;
|
||||
padding-right: 50px;
|
||||
width: 207px;
|
||||
height: 20px;
|
||||
border: 1px gray solid;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
}
|
||||
|
||||
.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: 207px;
|
||||
height: 20px;
|
||||
border: 1px gray solid;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
margin-left: -4px;
|
||||
}
|
||||
|
||||
.bg-UID-icon {
|
||||
background: url("../../images/Icons/main/icon0-vector-493-01.png") no-repeat 1.75% 10px white;
|
||||
padding-left: 28px;
|
||||
padding-right: 50px;
|
||||
margin-left: -4px;
|
||||
width: 207px;
|
||||
height: 20px;
|
||||
border: 1px gray solid;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
}
|
||||
</style>
|
||||
<!-- <script type="text/javascript" src="../js/toptions/top_up-min.js"></script> -->
|
||||
@@ -87,26 +129,23 @@
|
||||
</tr>
|
||||
<tr style="color:#003680; height:46px;">
|
||||
<td align="left">
|
||||
<asp:Label ID="CustomerIDLabel" runat="server" AssociatedControlID="CustomerID" CssClass="txt_design2">Kundennummer</asp:Label>
|
||||
<asp:TextBox ID="CustomerID" runat="server" required="true" Width = "207" ValidationGroup="txt_checkUID" OnTextChanged="CustomerID_TextChanged1" Font-Size="1.125em" style="margin-left:-4px"></asp:TextBox>
|
||||
<asp:TextBox ID="CustomerID" CssClass="bg-UID-icon" runat="server" required="true" Width = "207" ValidationGroup="txt_checkUID" OnTextChanged="CustomerID_TextChanged" Text="User-ID / E-Mail" Font-Size="1.125em" style="margin-left:-4px;color:#003680" OnClick="this.value='';"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="CustomerIDrequired" runat="server" ControlToValidate="CustomerID" SetFocusOnError="true" ValidationGroup="txt_checkUID" ErrorMessage="Die Kundennummer ist erforderlich"></asp:RequiredFieldValidator>
|
||||
<asp:RegularExpressionValidator ID="valid_getNumberInput" ControlToValidate="CustomerID" ValidationGroup="txt_checkUID" runat="server" Display="Dynamic" SetFocusOnError="true" ValidationExpression="<%=regexUID %>"></asp:RegularExpressionValidator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="color:#003680; height:46px;">
|
||||
<td align="left" colspan="2">
|
||||
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" CssClass="txt_design2">Benutzername</asp:Label>
|
||||
<asp:TextBox ID="UserName" runat="server" TextMode="SingleLine" Width = "207" ValidationGroup="txt_Username" required="true" Font-Size="1.125em" style="margin-right:-14px"></asp:TextBox>
|
||||
<asp:TextBox ID="UserName" runat="server" CssClass="bg-user-icon" TextMode="SingleLine" Width = "207" ValidationGroup="txt_Username" required="true" Font-Size="1.125em" style="margin-left:-4px;color:#003680" OnClick="this.value='';" Text="Username"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="UserNamerequired" runat="server" ControlToValidate="UserName" ErrorMessage="Der Benutzername ist erforderlich." ToolTip="Der Benutzername ist erforderlich." ValidationGroup="txt_Username"></asp:RequiredFieldValidator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="color:#003680; height:46px;">
|
||||
<td align="left" colspan="2">
|
||||
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" CssClass="txt_design2">Kennwort</asp:Label>
|
||||
<asp:TextBox ID="Password" runat="server" TextMode="Password" required="true" Width = "207" Font-Size="1.125em" ValidationGroup="chk_PWField" MaxLength="30" AutoCompleteType="Enabled" CausesValidation="true" style="margin-left:56px"></asp:TextBox>
|
||||
<asp:TextBox ID="Password" runat="server" CssClass="bg-key-icon" TextMode="Password" required="true" Width = "207" Font-Size="1.125em" ValidationGroup="chk_PWField" MaxLength="30" AutoCompleteType="Enabled" CausesValidation="true" style="margin-left:-4px;color:#003680" OnClick="this.value='';" Text="Kennwort"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="Passwordrequired" runat="server" ControlToValidate="Password" ErrorMessage="Bitte Passwort angeben" ToolTip="Das Kennwort ist erforderlich." ValidationGroup="chk_PWField"></asp:RequiredFieldValidator>
|
||||
<asp:RegularExpressionValidator ID="checkpwdREGEX" ControlToValidate="Password" ValidationGroup="chk_PWField" runat="server" Display="Dynamic" SetFocusOnError="true" ValidationExpression="<%=regexPWVal %>"></asp:RegularExpressionValidator>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="color:#003680; height:23px;">
|
||||
<td align="left" colspan="2">
|
||||
@@ -123,11 +162,7 @@
|
||||
<asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="color:#003680; height:23px;">
|
||||
<td align="left" colspan="2">
|
||||
<asp:LinkButton ID="LinkButton1" runat="server" target="_top" OnClientClick="bust2()">Admin-Login</asp:LinkButton>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr style="color:#003680; height:23px;">
|
||||
<td align="left" colspan="4">
|
||||
|
||||
@@ -152,11 +187,12 @@
|
||||
alert("send:" + zipphone2_1)
|
||||
alert("send:" + zipphone2_2)
|
||||
alert("send:" + zipphone2_3)
|
||||
//parent.location.replace('../Customers/Welcome.aspx');
|
||||
top.location = '../Customers/Welcome.aspx';
|
||||
var val = document.getElementById("CustomerID").value;
|
||||
//parent.location.replace('../Customers/Welcome.aspx');
|
||||
top.location = '../Customers/Welcome.aspx';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function bust1() {
|
||||
if (top.location != self) {
|
||||
@@ -176,5 +212,6 @@
|
||||
window.parent.location.reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -65,10 +65,12 @@ Partial Class login_login_TEST
|
||||
End Sub
|
||||
|
||||
Protected Sub CustomerID_TextChanged(sender As Object, e As EventArgs)
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub CustomerID_TextChanged1(sender As Object, e As EventArgs)
|
||||
' valid_getNumberInput.Validate()
|
||||
Dim var As TextBox = sender
|
||||
If var.Text.Contains("@verag.ag") = True Then
|
||||
var.CssClass = "bg-email-icon"
|
||||
Else
|
||||
var.CssClass = "bg-UID-icon"
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||