From e4752ff70def1c43dfe16155310125e3871bdb37 Mon Sep 17 00:00:00 2001 From: ja Date: Mon, 18 Oct 2021 14:38:09 +0200 Subject: [PATCH] =?UTF-8?q?=C3=84nderung=20implementierung=20update=20befe?= =?UTF-8?q?hl=20sQL=20Database=20f=C3=BCr=20pw=20=C3=A4nderung=20und?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- login/ChangePW.aspx | 1 + login/ChangePW.aspx.vb | 39 +++++++++++++++++++++++++++++++++++---- login/ForgotPW.aspx.vb | 4 ++-- login/login_FLEX.aspx | 40 ++++++++++++++++++++-------------------- 4 files changed, 58 insertions(+), 26 deletions(-) diff --git a/login/ChangePW.aspx b/login/ChangePW.aspx index ad8be8b..4e34b07 100644 --- a/login/ChangePW.aspx +++ b/login/ChangePW.aspx @@ -228,6 +228,7 @@ + diff --git a/login/ChangePW.aspx.vb b/login/ChangePW.aspx.vb index 1e7a4d7..207bc14 100644 --- a/login/ChangePW.aspx.vb +++ b/login/ChangePW.aspx.vb @@ -1,4 +1,6 @@ - +Imports System.Data.SqlClient +Imports System.Data + Partial Class login_ChangePW Inherits System.Web.UI.Page @@ -54,14 +56,13 @@ Partial Class login_ChangePW Dim tempstr As String = "" Dim Msg, Style, Title As String - If String.IsNullOrEmpty(txt_Pw.Text) = Not True AndAlso String.IsNullOrEmpty(txt_Pw_WH.Text) = Not True AndAlso txt_Pw_M.Attributes.Item("Placeholder") = "Enter Password" And String.IsNullOrEmpty(txt_Pw_M.Text) AndAlso txt_Pw_WH_M.Attributes.Item("Placeholder") = "Repeat Password" Then - + If String.IsNullOrEmpty(txt_Pw.Text) = Not True AndAlso String.IsNullOrEmpty(txt_Pw_WH.Text) = Not True AndAlso String.IsNullOrEmpty(txt_Pw.Text) = Not True AndAlso String.IsNullOrEmpty(txt_Pw_WH_M.Text) = Not True Then reqPasswtxt.Validate() reqPassw1txt.Validate() reqPassw1txt_M.Enabled = False reqPasswtxt.Enabled = True tempstr = txt_Pw.Text - ElseIf String.IsNullOrEmpty(txt_Pw.Text) = True AndAlso String.IsNullOrEmpty(txt_Pw_WH.Text) = True AndAlso txt_Pw.Attributes.Item("Placeholder") = Not True AndAlso txt_Pw_WH.Attributes.Item("Placeholder") = "Repeat Password" AndAlso txt_Pw.Attributes.Item("Placeholder") = "Repeat Password" Then + 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 @@ -74,6 +75,32 @@ Partial Class login_ChangePW 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 + Try + Dim ConnectionString = "" + Dim usrname = VERAG_PROG_ALLGEMEIN.cCryptography2.Decrypt(Request.QueryString("Par2")) + 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 + 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;" + End If + Using con As New SqlConnection(ConnectionString) + ' Using cmd As New SqlCommand("Validate_User") + Using cmd As New SqlCommand("UPDATE [VERAG_HOMEPAGE].[dbo].[Users] SET Password=@Password WHERE Username=@Username AND Password=@Password") + ' cmd.CommandType = CommandType.StoredProcedure + cmd.Parameters.AddWithValue("@Username", usrname) + cmd.Parameters.AddWithValue("@Password", tempstr) + cmd.Connection = con + con.Open() + ' userId = Convert.ToInt32(cmd.ExecuteScalar()) + cmd.ExecuteNonQuery() + con.Close() + End Using + End Using + Catch ex As Exception + + End Try Msg = "PW erfolgreich geändert!" Style = vbOKOnly + vbInformation + vbDefaultButton1 Title = "Information" @@ -85,7 +112,11 @@ Partial Class login_ChangePW '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 + Try + Catch ex As Exception + + End Try Msg = "PW erfolgreich geändert!" Style = vbOKOnly + vbInformation + vbDefaultButton1 Title = "Information" diff --git a/login/ForgotPW.aspx.vb b/login/ForgotPW.aspx.vb index c302453..e2d851a 100644 --- a/login/ForgotPW.aspx.vb +++ b/login/ForgotPW.aspx.vb @@ -244,7 +244,7 @@ Partial Class login_ForgotPW 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("Dear, {0},

Please follow the Link to reset your password:

" + Environment.NewLine + "http://" + getdomianenvironment + ServPort + "/login/ChangePW.aspx?Par1=" + VERAG_PROG_ALLGEMEIN.cCryptography.Encrypt(tokenname) + "" + Environment.NewLine + "


Kind regards,
VERAG | EDV Support
VERAG Spedition AG | A 4975 Suben, Nr. 100
T.+43 7711 2777-xx |support@verag.ag |" + emailnr + "FN xxxxxxx
" + Ausschusstext + "
" + Ausschusstext2 + "
" + Ausschusstext3 + "
" + Ausschusstext4 + "
", username, password) + htmlbody = String.Format("Dear, {0},

Please follow the Link to reset your password:

" + Environment.NewLine + "http://" + getdomianenvironment + ServPort + "/login/ChangePW.aspx?Par1=" + VERAG_PROG_ALLGEMEIN.cCryptography.Encrypt(tokenname) + "&Par2=" + VERAG_PROG_ALLGEMEIN.cCryptography2.Encrypt(username) + "" + Environment.NewLine + "


Kind regards,
VERAG | EDV Support
VERAG Spedition AG | A 4975 Suben, Nr. 100
T.+43 7711 2777-xx |support@verag.ag |" + emailnr + "FN xxxxxxx
" + Ausschusstext + "
" + Ausschusstext2 + "
" + Ausschusstext3 + "
" + Ausschusstext4 + "
", username, password) ElseIf String.IsNullOrWhiteSpace(HttpContext.Current.Request.ServerVariables("SERVER_NAME")) = False Then getdomianenvironment = HttpContext.Current.Request.ServerVariables("SERVER_NAME") ServPort = String.Empty @@ -255,7 +255,7 @@ Partial Class login_ForgotPW 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("Dear, {0},

Please follow the Link to reset your password:

" + Environment.NewLine + "http://" + getdomianenvironment + ServPort + "/login/ChangePW.aspx?Par1=" + VERAG_PROG_ALLGEMEIN.cCryptography.Encrypt(tokenname) + "" + Environment.NewLine + "


Kind regards,
VERAG | EDV Support
VERAG Spedition AG | A 4975 Suben, Nr. 100
T.+43 7711 2777-xx |support@verag.ag | " + emailnr + "FN xxxxxxx
" + Ausschusstext + "
" + Ausschusstext2 + "
" + Ausschusstext3 + "
" + Ausschusstext4 + "
", username, password) + htmlbody = String.Format("Dear, {0},

Please follow the Link to reset your password:

" + Environment.NewLine + "http://" + getdomianenvironment + ServPort + "/login/ChangePW.aspx?Par1=" + VERAG_PROG_ALLGEMEIN.cCryptography.Encrypt(tokenname) + "&Par2=" + VERAG_PROG_ALLGEMEIN.cCryptography2.Encrypt(username) + "" + Environment.NewLine + "


Kind regards,
VERAG | EDV Support
VERAG Spedition AG | A 4975 Suben, Nr. 100
T.+43 7711 2777-xx |support@verag.ag | " + emailnr + "FN xxxxxxx
" + Ausschusstext + "
" + Ausschusstext2 + "
" + Ausschusstext3 + "
" + Ausschusstext4 + "
", 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.") lblMessage.ForeColor = Color.OrangeRed diff --git a/login/login_FLEX.aspx b/login/login_FLEX.aspx index e96706c..c8fad52 100644 --- a/login/login_FLEX.aspx +++ b/login/login_FLEX.aspx @@ -283,28 +283,28 @@ - - - + + + - - - + + + - - - + + + - + @@ -334,28 +334,28 @@ - - - + + + - - - + + + - - - + + + - +