Änderung implementierung update befehl sQL Database für pw änderung und
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user