From 0bc8a1f3c0e783a9ba8ab0f759cdade202e0b985 Mon Sep 17 00:00:00 2001 From: yamat0jp Date: Fri, 10 Jan 2020 11:54:19 +0900 Subject: [PATCH] =?utf8?q?=E3=83=AD=E3=82=B0=E3=82=A4=E3=83=B3=E5=91=A8?= =?utf8?q?=E3=82=8A=E3=81=A7=E8=A8=82=E6=AD=A3=E3=81=82=E3=82=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- WebModuleUnit1.pas | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/WebModuleUnit1.pas b/WebModuleUnit1.pas index 0e87f4c..2e987b5 100644 --- a/WebModuleUnit1.pas +++ b/WebModuleUnit1.pas @@ -658,22 +658,26 @@ procedure TWebModule1.WebModule1adminsetAction(Sender: TObject; var s: string; begin - s := hash(Request.ContentFields.Values['pass']); + s := Request.ContentFields.Values['pass']; with DataModule1.FDTable3 do begin Edit; FieldByName('mente').AsBoolean := Request.ContentFields.Values ['mente'] = 'on'; - FieldByName('password').AsString := hash(s); + if s <> '' then + begin + s := hash(s); + FieldByName('password').AsString := hash(s); + with Response.Cookies.Add do + begin + Name := 'user'; + Value := s; + Expires := Now + 14; + Secure := true; + end; + end; Post; end; - with Response.Cookies.Add do - begin - Name := 'user'; - Value := s; - Expires := Now + 14; - Secure := true; - end; Request.CookieFields.Values['user'] := s; WebModule1adminAction(nil, Request, Response, Handled); end; -- 2.11.0