240 lines
7.0 KiB
Plaintext
240 lines
7.0 KiB
Plaintext
unit DLicense;
|
|
|
|
interface
|
|
|
|
uses
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.Imaging.pngimage,
|
|
Vcl.StdCtrls, System.ImageList, Vcl.ImgList, PngImageList, Tocsg.Win32;
|
|
|
|
const
|
|
DEF_VPN_DESC = '사내 VPN 접속시 아래의 기능이 제한됩니다.' + #13#10#13#10 +
|
|
'1. 화면 캡처 제한' + #13#10 +
|
|
' - Screen Capture 기능이 제한됩니다.' + #13#10 +
|
|
'2. 윈도우 원격 접속 프로그램 사용 금지' + #13#10 +
|
|
' - Windows 원격 데스크톱 기능이 제한됩니다.' + #13#10 +
|
|
'3. 프린트 출력 금지' + #13#10 +
|
|
' - 프린트 출력이 제한됩니다.' + #13#10 +
|
|
'4. PC 내 파일 생성 및 변경 제한' + #13#10 +
|
|
' - PC에서 파일을 생성하거나 변경하는 작업이 제한됩니다.' + #13#10 +
|
|
'5. 개인정보 및 사내 주요 정보 마스킹 처리' + #13#10 +
|
|
' - 개인정보 및 사내 주요 정보에 대해서 자동으로 마스킹 처리 됩니다.' + #13#10 +
|
|
'6. 클립보드 사용 제한' + #13#10 +
|
|
' - 클립보드 사용이 제한됩니다.';
|
|
|
|
KR_VPN_DESC = '사내 VPN 접속시 아래의 기능이 제한됩니다.' + #13#10#13#10 +
|
|
'1. 업무 프로그램 외 인터넷 접속 차단' + #13#10 +
|
|
' - 업무PC가상화, MS Teams, 페이퍼리스, 외부메일서버 외 모든 접속이 차단됩니다.' + #13#10 +
|
|
'2. 프린터 출력 금지' + #13#10 +
|
|
' - 개인 프린터 출력이 제한됩니다.' + #13#10 +
|
|
'3. 공공장소(커피숍 등) 무선 와이파이 접속 차단' + #13#10 +
|
|
'4. 일정 유휴시간 경과 시 VPN 접속이 차단됩니다.';
|
|
|
|
type
|
|
TDlgLicense = class(TForm)
|
|
imgMain: TImage;
|
|
imgOk: TImage;
|
|
imgBtnList: TPngImageList;
|
|
Label1: TLabel;
|
|
Label2: TLabel;
|
|
Label3: TLabel;
|
|
lbSecureAgree: TLabel;
|
|
mmGuide: TMemo;
|
|
mmAgree: TMemo;
|
|
tInit: TTimer;
|
|
lbCloseMsg: TLabel;
|
|
tClose: TTimer;
|
|
edAgree: TEdit;
|
|
procedure tInitTimer(Sender: TObject);
|
|
procedure imgMainMouseDown(Sender: TObject; Button: TMouseButton;
|
|
Shift: TShiftState; X, Y: Integer);
|
|
procedure imgOkMouseEnter(Sender: TObject);
|
|
procedure imgOkMouseLeave(Sender: TObject);
|
|
procedure imgOkClick(Sender: TObject);
|
|
procedure tCloseTimer(Sender: TObject);
|
|
private
|
|
{ Private declarations }
|
|
Mutex_: TTgMutex;
|
|
nClose_: Integer;
|
|
sTitle_: String;
|
|
bLCount_,
|
|
bIsNoExit_: Boolean;
|
|
procedure SetImgBtn(nImgIdx: Integer);
|
|
public
|
|
{ Public declarations }
|
|
Constructor Create(aOwner: TComponent; dwCustomerType: DWORD; bLicenseCnt, bIsNoExit: Boolean; sMsg: String);
|
|
procedure CreateParams(var Params: TCreateParams); override;
|
|
Destructor Destroy; override;
|
|
|
|
procedure process_WM_SYSCOMMAND(var msg: TWMSysCommand); Message WM_SYSCOMMAND;
|
|
end;
|
|
|
|
var
|
|
DlgLicense: TDlgLicense;
|
|
|
|
implementation
|
|
|
|
uses
|
|
Tocsg.Exception, superobject, GlobalDefine, Condition, ProcessParam, DefineHelper;
|
|
|
|
resourcestring
|
|
RS_FMT_CutTimer = '미동의 시 %d초 후 네트워크가 차단 됩니다.';
|
|
RS_SecuAgree = '보안 사용 동의';
|
|
RS_SecuAgree_ABL = 'ABL생명 정보보안 서약서 동의';
|
|
|
|
{$R *.dfm}
|
|
|
|
Constructor TDlgLicense.Create(aOwner: TComponent; dwCustomerType: DWORD; bLicenseCnt, bIsNoExit: Boolean; sMsg: String);
|
|
var
|
|
O: ISuperObject;
|
|
begin
|
|
Inherited Create(aOwner);
|
|
|
|
sTitle_ := '';
|
|
bLCount_ := bLicenseCnt;
|
|
bIsNoExit_ := bIsNoExit;
|
|
Mutex_ := TTgMutex.Create(MUTEX_LICENSE);
|
|
SetImgBtn(0);
|
|
if dwCustomerType = CUSTOMER_KR then
|
|
begin
|
|
nClose_ := 300;
|
|
mmGuide.Lines.Add(KR_VPN_DESC);
|
|
end else begin
|
|
nClose_ := 60;
|
|
mmGuide.Lines.Add(DEF_VPN_DESC);
|
|
end;
|
|
|
|
if bLCount_ then
|
|
lbCloseMsg.Caption := Format(RS_FMT_CutTimer, [nClose_])
|
|
else
|
|
lbCloseMsg.Visible := false;
|
|
|
|
if dwCustomerType = CUSTOMER_ABL then
|
|
begin
|
|
Label1.Caption := RS_SecuAgree_ABL;
|
|
Label1.Font.Color := clRed;
|
|
end else
|
|
Label1.Caption := RS_SecuAgree;
|
|
|
|
try
|
|
if sMsg <> '' then
|
|
begin
|
|
O := SO(sMsg);
|
|
if (O <> nil) and (O.O['resultStr'] <> nil) and
|
|
(O.O['resultStr'].S['eulatitle'] <> '') then
|
|
begin
|
|
sTitle_ := O.O['resultStr'].S['eulatitle'];
|
|
lbSecureAgree.Caption := sTitle_;
|
|
mmAgree.Text := StringReplace(O.O['resultStr'].S['eulacontent'], '\r\n', #13#10, [rfReplaceAll]);
|
|
end;
|
|
end;
|
|
except
|
|
on E: Exception do
|
|
ETgException.TraceException(Self, E, 'Fail .. Create()');
|
|
end;
|
|
|
|
tInit.Enabled := true;
|
|
end;
|
|
|
|
procedure TDlgLicense.CreateParams(var Params: TCreateParams);
|
|
begin
|
|
inherited CreateParams(Params);
|
|
Params.ExStyle := WS_EX_APPWINDOW;
|
|
Params.WindowClass.Style := Params.WindowClass.Style or CS_DROPSHADOW;
|
|
Params.WndParent := GetDesktopWindow;
|
|
end;
|
|
|
|
Destructor TDlgLicense.Destroy;
|
|
begin
|
|
FreeAndNil(Mutex_);
|
|
Inherited;
|
|
end;
|
|
|
|
procedure TDlgLicense.imgMainMouseDown(Sender: TObject; Button: TMouseButton;
|
|
Shift: TShiftState; X, Y: Integer);
|
|
begin
|
|
ReleaseCapture;
|
|
SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
|
|
end;
|
|
|
|
procedure TDlgLicense.imgOkClick(Sender: TObject);
|
|
var
|
|
sAgree: String;
|
|
begin
|
|
sAgree := Trim(edAgree.Text);
|
|
if (sAgree = '동의합니다') or (sAgree = '동의합니다.') then
|
|
begin
|
|
// gMgSvc.AgentModel.EulaDT := Now;
|
|
// gMgSvc.AgentModel.Save;
|
|
gParam.SendData(HPCMD_LICENSE_AGREE, '');
|
|
Close;
|
|
end;
|
|
end;
|
|
|
|
procedure TDlgLicense.imgOkMouseEnter(Sender: TObject);
|
|
begin
|
|
SetImgBtn(1);
|
|
end;
|
|
|
|
procedure TDlgLicense.imgOkMouseLeave(Sender: TObject);
|
|
begin
|
|
SetImgBtn(0);
|
|
end;
|
|
|
|
procedure TDlgLicense.SetImgBtn(nImgIdx: Integer);
|
|
begin
|
|
imgBtnList.GetIcon(nImgIdx, imgOk.Picture.Icon);
|
|
imgOk.Repaint
|
|
end;
|
|
|
|
procedure TDlgLicense.tCloseTimer(Sender: TObject);
|
|
begin
|
|
Dec(nClose_);
|
|
lbCloseMsg.Caption := Format(RS_FMT_CutTimer, [nClose_]);
|
|
if nClose_ <= 0 then
|
|
begin
|
|
tClose.Enabled := false;
|
|
// gMgSvc.VulService.SetDisconnect(true, true);
|
|
gParam.SendData(HPCMD_LICENSE_DISCONN, '');
|
|
|
|
if not bIsNoExit_ then
|
|
begin
|
|
Close;
|
|
end else begin
|
|
// 다시 반복 22_0725 14:07:04 kku
|
|
// 반복되지 않도록 요청 사항 들어옴 (KR) 22_0809 16:50:40 kku
|
|
// if CUSTOMER_TYPE = CUSTOMER_KR then
|
|
// nClose_ := 300
|
|
// else
|
|
// nClose_ := 60;
|
|
// tClose.Enabled := true;
|
|
lbCloseMsg.Visible := false;
|
|
end;
|
|
end;
|
|
Application.ProcessMessages;
|
|
end;
|
|
|
|
procedure TDlgLicense.tInitTimer(Sender: TObject);
|
|
begin
|
|
tInit.Enabled := false;
|
|
if MuTex_.MutexState <> msCreateOk then
|
|
Close;
|
|
// FormStyle := fsNormal;
|
|
|
|
if bLCount_ then
|
|
begin
|
|
lbCloseMsg.Visible := true;
|
|
tClose.Enabled := true;
|
|
end;
|
|
end;
|
|
|
|
procedure TDlgLicense.process_WM_SYSCOMMAND(var msg: TWMSysCommand);
|
|
begin
|
|
if msg.CmdType = SC_CLOSE then
|
|
exit;
|
|
|
|
Inherited;
|
|
end;
|
|
|
|
end.
|