Anpassungen Variablen/Logik
This commit is contained in:
@@ -9,18 +9,92 @@ Partial Class login_FLEX
|
||||
Private USERID As String = String.Empty
|
||||
Private salt As Byte()
|
||||
Private intzahl As Integer
|
||||
Private intzahliterats As Integer
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
Public intzahliterats As Integer = -1
|
||||
Protected Async Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
VERAG_VARIABLES.initerrorcount()
|
||||
|
||||
If Page.IsPostBack = True Then
|
||||
Page.MaintainScrollPositionOnPostBack = True
|
||||
|
||||
intzahliterats = VERAG_VARIABLES.getiterationnumber
|
||||
Else
|
||||
Try
|
||||
Dim teststr = String.Empty
|
||||
intzahliterats = 4
|
||||
teststr = Await TestPerformance.TestHashrateServerAsync(VERAG_VARIABLES.RandomInteger(2, Math.Pow(2, 2)))
|
||||
If String.Equals(teststr, String.Empty) = False Then
|
||||
intzahliterats = VERAG_VARIABLES.getiterationnumber
|
||||
End If
|
||||
Catch Ex As SettingsPropertyNotFoundException
|
||||
VERAG_VARIABLES.seterrorcount(4534)
|
||||
intzahliterats = 0
|
||||
Response.Write(VERAG_VARIABLES.geterrornumb() + "Error on Tests for login! Try again!")
|
||||
VERAG_VARIABLES.seterrorcount(4232)
|
||||
|
||||
sendmail("ja@verag.ag", Session.IsNewSession, VERAG_VARIABLES.geterrornumb)
|
||||
End Try
|
||||
Page.MaintainScrollPositionOnPostBack = False
|
||||
End If
|
||||
End Sub
|
||||
Protected Sub ValidateUser(sender As Object, e As EventArgs)
|
||||
|
||||
Public Shared Sub sendmail(emailTo As String, sessionright As Boolean, errornumb As String)
|
||||
Dim getdomianenvironment As String = String.Empty
|
||||
Dim pagename As String = String.Empty
|
||||
Dim ServPort As String = String.Empty
|
||||
Dim mailto As String = String.Empty
|
||||
Dim Betreff As String = String.Empty
|
||||
Dim htmlbody As String = String.Empty
|
||||
Dim emailnr = VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA_ID.ToString
|
||||
|
||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
'MsgBox(getdomianenvironment)
|
||||
getdomianenvironment = HttpContext.Current.Request.ServerVariables("SERVER_NAME")
|
||||
ServPort = ":" + HttpContext.Current.Request.ServerVariables("SERVER_PORT")
|
||||
'pagename = Request.ServerVariables("SCRIPT_NAME")
|
||||
mailto = emailTo
|
||||
Betreff = "Passwort reset"
|
||||
Dim mailpic As String = "<image src=" + "../images/VERAG_AEO_MailSig.jpg" + ">"
|
||||
Dim Ausschusstext As String = "Wir arbeiten ausschließlich auf Grund der Allgemeinen Spediteurbedingungen in der jeweils geltenden Fassung. Zahlungen werden zunächst auf Frachten, Spesen"
|
||||
Dim Ausschusstext2 As String = "und Zinsen zuletzt auf Zölle angerechnet. Zahlbar und klagbar in Schärding oder Ried. Steuer-Zoll-und Tarifauskünfte sind unverbindlich."
|
||||
Dim Ausschusstext3 As String = "We operate exclusively on the basis of the General Freight Forwarding Terms and Conditions in the respectively applicable version. Payments are initially"
|
||||
Dim Ausschusstext4 As String = "charged on freight, fees and interests and at last on customs duties. The place of jurisdiction: Schärding / Ried. Tax, customs and tariff information are not binding."
|
||||
htmlbody = String.Format("Auf der Seite <a runat=" + "server" + " href=http://" + getdomianenvironment + "/login/Customers/login_FLEX.aspx> http: //" + getdomianenvironment + "/login/Customers/login_FLEX.aspx </a> trat der Fehler " + errornumb + "auf. Bitte Logs anschauen." + Environment.NewLine + "<br /><br />Notice:<br /><span style='color: #043381;font-size:14px'><i>The Link is valid for 30 minutes until" + Space(1) + Date.Now.AddMinutes(30).ToString() + Space(1) + "only!</i></span><br / >To resend the E-Mail: <a runat=" + "server" + " href=http://" + getdomianenvironment + "/login/ForgotPW.aspx>Follow this Link</a><br />Kind regards, <br /><span style='color: #043381'><b>VERAG | EDV Support</b></span><br /><span>" + mailpic + "</span><br /><span style='color: #043381'>VERAG Spedition AG | A 4975 Suben, Nr. 100</span><br /><span style='color: #043381'>T.<a href='tel:+43 7711 2777-xx'>+43 7711 2777-xx</a> |<a href='mailto:@support@verag.ag'>support@verag.ag</a> | " + emailnr + "FN xxxxxxx</span><br /><span style='color: #043381;font-size:12px'><i>" + Ausschusstext + "</i></span><br /><span style='color: #043381;font-size:12px'><i>" + Ausschusstext2 + "</i></span><br /><span style='color: #043381;font-size:12px'><i>" + Ausschusstext3 + "</i></span><br /><span style='color: #043381;font-size:12px'><i>" + Ausschusstext4 + "</i></span><br />")
|
||||
ElseIf String.IsNullOrWhiteSpace(HttpContext.Current.Request.ServerVariables("SERVER_NAME")) = False Then
|
||||
getdomianenvironment = HttpContext.Current.Request.ServerVariables("SERVER_NAME")
|
||||
'MsgBox(getdomianenvironment)
|
||||
ServPort = ":" + HttpContext.Current.Request.ServerVariables("SERVER_PORT")
|
||||
'pagename = Request.ServerVariables("SCRIPT_NAME")
|
||||
mailto = emailTo
|
||||
Betreff = "Passwort reset"
|
||||
Dim mailpic As String = "<image src=" + "../images/VERAG_AEO_MailSig.jpg" + ">"
|
||||
Dim Ausschusstext As String = "Wir arbeiten ausschließlich auf Grund der Allgemeinen Spediteurbedingungen in der jeweils geltenden Fassung. Zahlungen werden zunächst auf Frachten, Spesen"
|
||||
Dim Ausschusstext2 As String = "und Zinsen zuletzt auf Zölle angerechnet. Zahlbar und klagbar in Schärding oder Ried. Steuer-Zoll-und Tarifauskünfte sind unverbindlich."
|
||||
Dim Ausschusstext3 As String = "We operate exclusively on the basis of the General Freight Forwarding Terms and Conditions in the respectively applicable version. Payments are initially"
|
||||
Dim Ausschusstext4 As String = "charged on freight, fees and interests and at last on customs duties. The place of jurisdiction: Schärding / Ried. Tax, customs and tariff information are not binding."
|
||||
htmlbody = String.Format("Auf der Seite <a runat=" + "server" + " href=http://" + getdomianenvironment + "/login/Customers/login_FLEX.aspx> http: //" + getdomianenvironment + "/login/Customers/login_FLEX.aspx </a> trat der Fehler " + errornumb + "auf. Bitte Logs anschauen." + Environment.NewLine + "<br /><br />Notice:<br /><span style='color: #043381;font-size:14px'><i>The Link is valid for 30 minutes until" + Space(1) + Date.Now.AddMinutes(30).ToString() + Space(1) + "only!</i></span><br / >To resend the E-Mail: <a runat=" + "server" + " href=http://" + getdomianenvironment + "/login/ForgotPW.aspx>Follow this Link</a><br />Kind regards, <br /><span style='color: #043381'><b>VERAG | EDV Support</b></span><br /><span>" + mailpic + "</span><br /><span style='color: #043381'>VERAG Spedition AG | A 4975 Suben, Nr. 100</span><br /><span style='color: #043381'>T.<a href='tel:+43 7711 2777-xx'>+43 7711 2777-xx</a> |<a href='mailto:@support@verag.ag'>support@verag.ag</a> | " + emailnr + "FN xxxxxxx</span><br /><span style='color: #043381;font-size:12px'><i>" + Ausschusstext + "</i></span><br /><span style='color: #043381;font-size:12px'><i>" + Ausschusstext2 + "</i></span><br /><span style='color: #043381;font-size:12px'><i>" + Ausschusstext3 + "</i></span><br /><span style='color: #043381;font-size:12px'><i>" + Ausschusstext4 + "</i></span><br />")
|
||||
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
|
||||
'Dim pg As String = Request.ServerVariables("URL")
|
||||
'MsgBox("/" + ServPort + Request.ServerVariables("URL"))
|
||||
Try
|
||||
'Dim Strtemp = Session.Keys.Item("urltochangepw")
|
||||
' Msg.Attachments.Add(attachment)
|
||||
If String.IsNullOrEmpty(mailto) = False AndAlso String.IsNullOrEmpty(Betreff) = False AndAlso String.IsNullOrEmpty(htmlbody) = False Then
|
||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(mailto, Betreff, htmlbody)
|
||||
Else
|
||||
|
||||
VERAG_VARIABLES.seterrorcount(7)
|
||||
'lblMessage_M.Text = VERAG_VARIABLES.geterrornumb + "The form has not been filled out completely."
|
||||
End If
|
||||
' lblMessage_M.ForeColor = Color.Green
|
||||
'lblMessage_M.Text = "Success" + Environment.NewLine + "The Password-Reset-Link has been mailed to the valid Address given."
|
||||
'MsgBox("SENT")
|
||||
Catch ex As Exception
|
||||
'MsgBox(Err.Number & ex.Message & ex.StackTrace.ToString) 'Falls ein Fehler auftritt wird eine MsgBox angezeigt
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Protected Async Sub ValidateUser(sender As Object, e As EventArgs)
|
||||
Dim ConnectionString = ""
|
||||
If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||
@@ -116,7 +190,7 @@ Partial Class login_FLEX
|
||||
reqfieldvalpassw.Validate()
|
||||
If reqfieldvalpassw.IsValid = True Then
|
||||
intzahl = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 6), Math.Pow(2, 10))
|
||||
Dim hashpw1 As Byte() = VERAG_VARIABLES.HashPassword(tb3.Text, salt, intzahliterats, intzahl)
|
||||
Dim hashpw1 As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(tb3.Text, salt, intzahliterats, intzahl)
|
||||
passw = tb3.Text
|
||||
End If
|
||||
End If
|
||||
@@ -125,9 +199,8 @@ Partial Class login_FLEX
|
||||
reqfieldvalpassw_M.Enabled = True
|
||||
reqfieldvalpassw_M.Validate()
|
||||
intzahl = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 6), Math.Pow(2, 10))
|
||||
Dim hashpw1_M As Byte() = VERAG_VARIABLES.HashPassword(tb3_M.Text, salt, intzahliterats, intzahl)
|
||||
If reqfieldvalpassw_M.IsValid = True Then
|
||||
Dim hashpw_M As Byte() = VERAG_VARIABLES.HashPassword(tb3_M.Text, salt, intzahliterats, intzahl)
|
||||
Dim hashpw_M As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(tb3_M.Text, salt, intzahliterats, intzahl)
|
||||
passw = tb3_M.Text
|
||||
Else
|
||||
VERAG_VARIABLES.seterrorcount(4)
|
||||
@@ -175,8 +248,8 @@ Partial Class login_FLEX
|
||||
If String.Equals(tb3.Text, dr("Password")) = True Then
|
||||
intzahl = VERAG_VARIABLES.RandomInteger(Math.Pow(2, 6), Math.Pow(2, 10))
|
||||
salt = VERAG_VARIABLES.GenerateSalt(intzahl)
|
||||
Dim hashpw As Byte() = VERAG_VARIABLES.HashPassword(passw, salt, intzahliterats, intzahl)
|
||||
If VERAG_VARIABLES.Verifyhash(dr("Password").ToString, salt, hashpw, intzahliterats, intzahl) = True Then
|
||||
Dim hashpw As Byte() = Await VERAG_VARIABLES.HashPasswordAsync(passw, salt, intzahliterats, intzahl)
|
||||
If Await VERAG_VARIABLES.VerifyhashAsync(dr("Password").ToString, salt, hashpw, intzahliterats, intzahl) = True Then
|
||||
passw = dr("Password").ToString
|
||||
Else
|
||||
passw = String.Empty
|
||||
|
||||
Reference in New Issue
Block a user