Feature: Support to forbidden the user in violation of rules
This commit is contained in:
Binary file not shown.
@@ -646,6 +646,7 @@ CMy2015RemoteDlg::CMy2015RemoteDlg(CWnd* pParent): CDialogLangEx(CMy2015RemoteDl
|
||||
m_bmOnline[59].LoadBitmap(IDB_BITMAP_ACTIVE_WND);
|
||||
m_bmOnline[60].LoadBitmap(IDB_BITMAP_DEBUG);
|
||||
m_bmOnline[61].LoadBitmap(IDB_BITMAP_CLIENTLOG);
|
||||
m_bmOnline[62].LoadBitmap(IDB_BITMAP_FORBIDDEN);
|
||||
for (int i = 0; i < PAYLOAD_MAXTYPE; i++) {
|
||||
m_ServerDLL[i] = nullptr;
|
||||
m_ServerBin[i] = nullptr;
|
||||
@@ -1003,6 +1004,7 @@ BEGIN_MESSAGE_MAP(CMy2015RemoteDlg, CDialogEx)
|
||||
ON_COMMAND(ID_ONLINE_VIEW_WND, &CMy2015RemoteDlg::OnOnlineWindowManager)
|
||||
ON_COMMAND(ID_ENABLE_DEV_DEBUG, &CMy2015RemoteDlg::OnEnableDevDebug)
|
||||
ON_COMMAND(ID_ONLINE_CLIENT_LOG, &CMy2015RemoteDlg::OnOnlineClientLog)
|
||||
ON_COMMAND(ID_ONLINE_FORBIDDEN, &CMy2015RemoteDlg::OnOnlineForbidden)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
@@ -1522,6 +1524,11 @@ VOID CMy2015RemoteDlg::AddList(CString strIP, CString strAddr, CString strPCName
|
||||
ContextObject->SetID(id);
|
||||
ContextObject->SetGroup(groupName);
|
||||
m_ClientMap->SaveClientMapData(ContextObject);
|
||||
int status = m_ClientMap->GetClientMapInteger(id, MAP_AUTH);
|
||||
if (status == AUTH_FORBIDDEN) {
|
||||
BYTE buf[32] = { COMMAND_FORBIDDEN };
|
||||
ContextObject->Send2Client(buf, sizeof(buf));
|
||||
}
|
||||
|
||||
EnterCriticalSection(&m_cs);
|
||||
|
||||
@@ -4054,6 +4061,7 @@ void CMy2015RemoteDlg::OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult)
|
||||
Menu.SetMenuItemBitmaps(ID_COPY_CLIENT_INFO, MF_BYCOMMAND, &m_bmOnline[58], &m_bmOnline[58]);
|
||||
Menu.SetMenuItemBitmaps(ID_ONLINE_ACTIVE_WND, MF_BYCOMMAND, &m_bmOnline[59], &m_bmOnline[59]);
|
||||
Menu.SetMenuItemBitmaps(ID_ONLINE_CLIENT_LOG, MF_BYCOMMAND, &m_bmOnline[61], &m_bmOnline[61]);
|
||||
Menu.SetMenuItemBitmaps(ID_ONLINE_FORBIDDEN, MF_BYCOMMAND, &m_bmOnline[62], &m_bmOnline[62]);
|
||||
|
||||
Menu.ModifyMenuL(ID_ONLINE_AUTHORIZE, MF_BYCOMMAND | MF_STRING, ID_ONLINE_AUTHORIZE, _T("发送授权"));
|
||||
|
||||
@@ -11573,3 +11581,17 @@ LRESULT CMy2015RemoteDlg::OnOpenClientLogDialog(WPARAM wParam, LPARAM lParam)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void forbiddenClient(context* ctx, void* user) {
|
||||
_ClientList* m_ClientMap = (_ClientList*)user;
|
||||
m_ClientMap->SetClientMapInteger(ctx->GetClientID(), MAP_AUTH, AUTH_FORBIDDEN);
|
||||
}
|
||||
|
||||
void CMy2015RemoteDlg::OnOnlineForbidden()
|
||||
{
|
||||
if (IDYES != MessageBoxL(_T("确定封禁选定的被控程序吗?"), _T("提示"), MB_ICONQUESTION | MB_YESNO))
|
||||
return;
|
||||
|
||||
BYTE buf[32] = { COMMAND_FORBIDDEN };
|
||||
SendSelectedCommand(buf, sizeof(buf), forbiddenClient, m_ClientMap);
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ public:
|
||||
bool IsDllRequestLimited(const std::string& ip);
|
||||
void RecordDllRequest(const std::string& ip);
|
||||
CMenu m_MainMenu;
|
||||
CBitmap m_bmOnline[62];
|
||||
CBitmap m_bmOnline[63];
|
||||
uint64_t m_superID;
|
||||
std::map<HWND, CDialogBase *> m_RemoteWnds;
|
||||
FileTransformCmd m_CmdList;
|
||||
@@ -639,4 +639,5 @@ public:
|
||||
afx_msg void OnEnableDevDebug();
|
||||
afx_msg void OnOnlineClientLog();
|
||||
afx_msg LRESULT OnOpenClientLogDialog(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg void OnOnlineForbidden();
|
||||
};
|
||||
|
||||
@@ -510,6 +510,7 @@
|
||||
<Image Include="res\Bitmap\Backup.bmp" />
|
||||
<Image Include="res\Bitmap\CancelShare.bmp" />
|
||||
<Image Include="res\Bitmap\ClientLog.bmp" />
|
||||
<Image Include="res\Bitmap\Forbidden.bmp" />
|
||||
<Image Include="res\bitmap\compress.bmp" />
|
||||
<Image Include="res\Bitmap\Copy.bmp" />
|
||||
<Image Include="res\Bitmap\Debug.bmp" />
|
||||
|
||||
@@ -288,7 +288,7 @@ void CClientListDlg::DisplayClients()
|
||||
CString strLevel;
|
||||
strLevel.FormatL(_T("%d"), val.Level);
|
||||
|
||||
CString strAuth = val.Authorized ? _T("Y") : _T("N");
|
||||
CString strAuth = (val.Authorized == AUTHED_BY_SUPER || val.Authorized == AUTHED_BY_ADMIN)? _T("Y") : _T("N");
|
||||
|
||||
nItem = m_ClientList.InsertItem(nRow, strNo);
|
||||
m_ClientList.SetItemText(nItem, COL_ID, strID);
|
||||
@@ -340,7 +340,7 @@ void CClientListDlg::DisplayClients()
|
||||
CString strLevel;
|
||||
strLevel.FormatL(_T("%d"), val.Level);
|
||||
|
||||
CString strAuth = val.Authorized ? _T("Y") : _T("N");
|
||||
CString strAuth = (val.Authorized == AUTHED_BY_SUPER || val.Authorized == AUTHED_BY_ADMIN) ? _T("Y") : _T("N");
|
||||
|
||||
nItem = m_ClientList.InsertItem(nRow, strSubNo);
|
||||
m_ClientList.SetItemText(nItem, COL_ID, strID);
|
||||
|
||||
@@ -1956,3 +1956,5 @@ FRPC Զ
|
||||
设置失败! 通常是权限不足, 请手动在系统环境变量设置。=Failed! You have to set it via system environment center.
|
||||
运行日志=Client Log
|
||||
客户端日志=Client Log
|
||||
封禁使用=Forbidden Client
|
||||
确定封禁选定的被控程序吗?=Are you sure to forbidden the selected clients?
|
||||
|
||||
@@ -1947,3 +1947,5 @@ FRPC Զ
|
||||
设置失败! 通常是权限不足, 请手动在系统环境变量设置。=设置失败! 通常是权限不足, 请手动在系统环境变量设置。
|
||||
运行日志=运行日志
|
||||
客户端日志=客户端日志
|
||||
封禁使用=封禁使用
|
||||
确定封禁选定的被控程序吗?=确定封禁选定的被控程序吗?
|
||||
|
||||
BIN
server/2015Remote/res/Bitmap/Forbidden.bmp
Normal file
BIN
server/2015Remote/res/Bitmap/Forbidden.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -276,6 +276,7 @@
|
||||
#define IDD_DIALOG_CLIENT_LOG 393
|
||||
#define IDB_BITMAP_CLIENTLOG 395
|
||||
#define IDI_CLIENTLOG 396
|
||||
#define IDB_BITMAP_FORBIDDEN 397
|
||||
#define IDC_MESSAGE 1000
|
||||
#define IDC_ONLINE 1001
|
||||
#define IDC_STATIC_TIPS 1002
|
||||
@@ -1021,14 +1022,16 @@
|
||||
#define ID_ENABLE_DEV_DEBUG 33072
|
||||
#define ID_ONLINE_33073 33073
|
||||
#define ID_ONLINE_CLIENT_LOG 33074
|
||||
#define ID_ONLINE_33075 33075
|
||||
#define ID_ONLINE_FORBIDDEN 33076
|
||||
#define ID_EXIT_FULLSCREEN 40001
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 397
|
||||
#define _APS_NEXT_COMMAND_VALUE 33075
|
||||
#define _APS_NEXT_RESOURCE_VALUE 398
|
||||
#define _APS_NEXT_COMMAND_VALUE 33077
|
||||
#define _APS_NEXT_CONTROL_VALUE 2542
|
||||
#define _APS_NEXT_SYMED_VALUE 105
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user