Englische Übersetzung aller texte und verbesserung if else abfrage in ForgotPW.aspx

This commit is contained in:
ja
2021-10-13 14:40:24 +02:00
parent 229ed530df
commit a38184b4e1
2 changed files with 23 additions and 19 deletions

View File

@@ -86,7 +86,7 @@
</tr> </tr>
<tr style="color:#003680; height:32px;font-size:12px"> <tr style="color:#003680; height:32px;font-size:12px">
<td align="center" colspan="2" style="color:#fff;font-kerning:auto;font-weight:700;"> <td align="center" colspan="2" style="color:#fff;font-kerning:auto;font-weight:700;">
<asp:Label ID="lbl_PWvergessen" Text="Haben Sie ihr Passwort vergessen?" runat="server" style="color:#003680; margin-left:58px;font-size:17px;"></asp:Label> <asp:Label ID="lbl_PWvergessen" Text="Forgot your password?" runat="server" style="color:#003680; margin-left:92px;font-size:17px;"></asp:Label>
</td></tr> </td></tr>
<!-- <tr style=" background-color:#fff; color:#003680; height:30px;font-size:12px"> <!-- <tr style=" background-color:#fff; color:#003680; height:30px;font-size:12px">
<td align="center" colspan="2" style="color:#fff;font-kerning:auto;font-weight:700;"> <td align="center" colspan="2" style="color:#fff;font-kerning:auto;font-weight:700;">
@@ -94,7 +94,7 @@
</td></tr> --> </td></tr> -->
<tr style="color:#003680; height:30px;"> <tr style="color:#003680; height:30px;">
<td align="right" colspan="2"> <td align="right" colspan="2">
<h2 style="margin-left:24px;margin-left:98px;">Daten hier eintragen:</h2> <h2 style="margin-left:24px;margin-left:92px;">Fill in your data here:</h2>
</td></tr> </td></tr>
<!-- <tr><td> <!-- <tr><td>
<input type="email" runat="server" style="width:150px" placeholder="example@somehost.com" /> <input type="email" runat="server" style="width:150px" placeholder="example@somehost.com" />

View File

@@ -22,7 +22,7 @@ Partial Class login_ForgotPW
If valreqtxtEmail.IsValid = True Then If valreqtxtEmail.IsValid = True Then
email = txtEmail.Text email = txtEmail.Text
ElseIf valreqtxtEmail.IsValid = False Then ElseIf valreqtxtEmail.IsValid = False Then
valreqtxtEmail.ErrorMessage = "ANnotation: The given Domain is not the company domain." valreqtxtEmail.ErrorMessage = "Annotation: The given Domain is not the company domain."
regexval_txt_Email.Validate() regexval_txt_Email.Validate()
valreqtxtEmail.IsValid = True valreqtxtEmail.IsValid = True
End If End If
@@ -58,9 +58,9 @@ Partial Class login_ForgotPW
regexval_txt_Email.Validate() regexval_txt_Email.Validate()
Catch ex As Exception Catch ex As Exception
Dim Msg, Style, Title As String Dim Msg, Style, Title As String
Msg = "E-Mail Prüfung fehlgeschlagen!" & vbCrLf + "Bitte erneut versuchen!" Msg = "E-Mail validation failed!" & vbCrLf + "Please try again!"
Style = vbRetry + vbExclamation + vbDefaultButton1 Style = vbRetry + vbExclamation + vbDefaultButton1
Title = "Fehler bei E-Mail Authentifizierung!" Title = "Authentication error!"
MsgBox(Msg, Style, Title) MsgBox(Msg, Style, Title)
If MsgBox(Msg, Style, Title).Yes Then If MsgBox(Msg, Style, Title).Yes Then
txtEmail.Text = String.Empty txtEmail.Text = String.Empty
@@ -80,22 +80,24 @@ Partial Class login_ForgotPW
If (getDateoftoken(tokenname) = True) Then If (getDateoftoken(tokenname) = True) Then
Dim msgboxstyle = vbDefaultButton1 + vbOK Dim msgboxstyle = vbDefaultButton1 + vbOK
'MsgBox(tokenname, msgboxstyle) 'MsgBox(tokenname, msgboxstyle)
MsgBox("Token erfolgreich generiert.") MsgBox("Token generated successfully.")
Else Else
MsgBox("Token ist nicht mehr gültig! Es wird ein neuer generiert!") MsgBox("Token is not valid anymore. Please generate a new one by sending a new e-mail!")
tokenname = genToken(username, password, email) tokenname = genToken(username, password, email)
End If End If
'SendEmail(username, password, email) 'SendEmail(username, password, email)
'MsgBox("Mail would be sent successfully!") 'MsgBox("Mail would be sent successfully!")
lblMessage.ForeColor = Color.Green lblMessage.ForeColor = Color.Green
lblMessage.Text = "Passwort wurde erfolgreich an die angegebene E-Mail Adresse gesendet." lblMessage.Text = "The password has been sent sucessfully on the given valid e-mail address."
ElseIf SendEmail(username, password, email, tokenname) = False Then ElseIf SendEmail(username, password, email, tokenname) = False Then
'MsgBox("Mail would not be sent successfully!") 'MsgBox("Mail would not be sent successfully!")
lblMessage.ForeColor = Color.Red lblMessage.ForeColor = Color.Red
lblMessage.Text = "Diese E-Mail ist nicht in unserer Datenbank vorhanden." lblMessage.Text = "The given e-mail does not exist in our database."
End If End If
Else Else
MsgBox("Die Felder sind nicht alle befüllt worden.", MsgBoxStyle.Critical, "Error08") MsgBox("The form has not been filled completeley.", MsgBoxStyle.Critical, "Error08")
lblMessage.ForeColor = Color.Red
lblMessage.Text = "The form has not been filled completeley."
End If End If
End Sub End Sub
@@ -124,14 +126,16 @@ Partial Class login_ForgotPW
'pagename = Request.ServerVariables("SCRIPT_NAME") 'pagename = Request.ServerVariables("SCRIPT_NAME")
mailto = email mailto = email
Betreff = "Passwort reset" Betreff = "Passwort reset"
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 <br />VERAG | EDV Support<br />support@verag.ag,", username, password) htmlbody = String.Format("Dear, {0},<br /><br /> Please follow the Link to reset your password:<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 />Kind regards, <br />VERAG | EDV Support<br />support@verag.ag,", username, password)
ElseIf String.IsNullOrWhiteSpace(HttpContext.Current.Request.ServerVariables("SERVER_NAME")) = False Then ElseIf String.IsNullOrWhiteSpace(HttpContext.Current.Request.ServerVariables("SERVER_NAME")) = False Then
getdomianenvironment = HttpContext.Current.Request.ServerVariables("SERVER_NAME") getdomianenvironment = HttpContext.Current.Request.ServerVariables("SERVER_NAME")
ServPort = String.Empty ServPort = String.Empty
'pagename = Request.ServerVariables("SCRIPT_NAME") 'pagename = Request.ServerVariables("SCRIPT_NAME")
mailto = email mailto = email
Betreff = "Passwort reset" Betreff = "Passwort reset"
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 + "/login/ChangePW.aspx?Par1=" + VERAG_PROG_ALLGEMEIN.cCryptography.Encrypt(tokenname) + ">Link</a>" + Environment.NewLine + "<br />Mit freundlichen Grüßen <br />VERAG | EDV Support<br />support@verag.ag,", username, password) htmlbody = String.Format("Dear, {0},<br /><br /> Please follow the Link to reset your password:<br /><br /><br />.<br />" + Environment.NewLine + "<a runat=" + "server" + " href=http://" + getdomianenvironment + "/login/ChangePW.aspx?Par1=" + VERAG_PROG_ALLGEMEIN.cCryptography.Encrypt(tokenname) + ">Link</a>" + Environment.NewLine + "<br />Kind regards, <br />VERAG | EDV Support<br />support@verag.ag,", username, password)
ElseIf String.IsNullOrWhiteSpace(HttpContext.Current.Request.ServerVariables("SERVER_NAME")) = True Then
MsgBox("Error09:" + Environment.NewLine + " The Domain could not be vaildated. Check Link please or contact the Administrator of the program.")
End If End If
'Dim pg As String = Request.ServerVariables("URL") 'Dim pg As String = Request.ServerVariables("URL")
'MsgBox("/" + ServPort + Request.ServerVariables("URL")) 'MsgBox("/" + ServPort + Request.ServerVariables("URL"))
@@ -150,7 +154,7 @@ Partial Class login_ForgotPW
MsgBox("SENT") MsgBox("SENT")
Return True Return True
Else Else
MsgBox("Error02: Mail not delivered!" & vbCrLf & "Neuer Token wird generiert.") MsgBox("Error02: Mail not delivered!" & vbCrLf & "New Token has been generated.")
tokennametemp = genToken(username, password, email) tokennametemp = genToken(username, password, email)
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(mailto, Betreff, htmlbody, tokenname) VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(mailto, Betreff, htmlbody, tokenname)
Return False Return False
@@ -170,20 +174,20 @@ Partial Class login_ForgotPW
Return token Return token
Catch Ex As Exception Catch Ex As Exception
Dim Msg, Style, Title As String Dim Msg, Style, Title As String
Msg = "Tokengenerierung fehlgeschlagen!" & vbCrLf & "Eine E-Mail wurde erneut an " + email + " zugesendet." Msg = "Token Generation failed" & vbCrLf & "A new E-mail has been sent to the intern e-mail given."
Style = vbRetry + vbExclamation + vbDefaultButton1 Style = vbRetry + vbExclamation + vbDefaultButton1
Title = "Fehler bei Token-Generierung" Title = "Error05: Token-Generierung"
MsgBox(Msg, Style, Title) MsgBox(Msg, Style, Title)
If MsgBox(Msg, Style, Title).Retry Then If MsgBox(Msg, Style, Title).Retry Then
genToken(username, password, email) genToken(username, password, email)
If SendEmail(username, password, email, token) = False Then If SendEmail(username, password, email, token) = False Then
MsgBox("Email konnte wegen eines internen Verschlüsselungsfehlers nicht gesendet werden.", vbOK + vbInformation + vbDefaultButton1, "Tokengenerierung-Fehler") MsgBox("Email could not been sent because of an internal encryption error.", vbOK + vbInformation + vbDefaultButton1, "Token-Generation Error")
Else Else
MsgBox("Email wurde erfolgreich gesendet." & vbCr & "Bitte Postfach überprüfen!", vbOK + vbInformation + vbDefaultButton1, "Tokengenerierung erfolgreich!") MsgBox("Email has been sent successful." & vbCr & "Please check your E-Mails!", vbOK + vbInformation + vbDefaultButton1, "Token-Generation successful!")
End If End If
Else Else
MsgBox("Tokengenerierung nicht erfolgreich." & vbCrLf & "In 5 Sekunden nochmal versuchen!") MsgBox("Token-Generation has not been successful." & vbCrLf & "Please try again in five seconds!")
Dim jetzt As DateTime = DateTime.UtcNow Dim jetzt As DateTime = DateTime.UtcNow
Dim wenn As DateTime = DateTime.UtcNow.AddSeconds(-5) Dim wenn As DateTime = DateTime.UtcNow.AddSeconds(-5)
@@ -202,7 +206,7 @@ Partial Class login_ForgotPW
Dim wenn As DateTime = DateTime.FromBinary(BitConverter.ToInt64(data, 0)) Dim wenn As DateTime = DateTime.FromBinary(BitConverter.ToInt64(data, 0))
If wenn < DateTime.UtcNow.AddMinutes(-30) Then If wenn < DateTime.UtcNow.AddMinutes(-30) Then
tokenname = String.Empty tokenname = String.Empty
MsgBox("Token nicht gefunden oder zu alt!" + Environment.NewLine + "Bitte erneut Mail senden!") MsgBox("Token has not been found or is too old!" + Environment.NewLine + "Please send a new E-mail!")
Return False Return False
ElseIf tokenname = "NotYet" Then ElseIf tokenname = "NotYet" Then
Return False Return False