e794e58035f782df899d84fa04e5f87f6abffd50
[public/netxms.git] / src / console / win32 / UserPropDlg.cpp
1 // UserPropDlg.cpp : implementation file
2 //
3
4 #include "stdafx.h"
5 #include "nxcon.h"
6 #include "UserPropDlg.h"
7
8 #ifdef _DEBUG
9 #define new DEBUG_NEW
10 #undef THIS_FILE
11 static char THIS_FILE[] = __FILE__;
12 #endif
13
14 /////////////////////////////////////////////////////////////////////////////
15 // CUserPropDlg dialog
16
17
18 CUserPropDlg::CUserPropDlg(CWnd* pParent /*=NULL*/)
19 : CDialog(CUserPropDlg::IDD, pParent)
20 {
21 //{{AFX_DATA_INIT(CUserPropDlg)
22 m_bAccountDisabled = FALSE;
23 m_bDropConn = FALSE;
24 m_bEditEventDB = FALSE;
25 m_bManageUsers = FALSE;
26 m_bChangePassword = FALSE;
27 m_bViewEventDB = FALSE;
28 m_strDescription = _T("");
29 m_strLogin = _T("");
30 m_strFullName = _T("");
31 m_bManageActions = FALSE;
32 m_bManageEPP = FALSE;
33 m_bManageConfig = FALSE;
34 m_bConfigureTraps = FALSE;
35 m_bDeleteAlarms = FALSE;
36 m_bManagePkg = FALSE;
37 //}}AFX_DATA_INIT
38 }
39
40
41 void CUserPropDlg::DoDataExchange(CDataExchange* pDX)
42 {
43 CDialog::DoDataExchange(pDX);
44 //{{AFX_DATA_MAP(CUserPropDlg)
45 DDX_Check(pDX, IDC_CHECK_DISABLED, m_bAccountDisabled);
46 DDX_Check(pDX, IDC_CHECK_DROP_CONN, m_bDropConn);
47 DDX_Check(pDX, IDC_CHECK_EDIT_EVENTDB, m_bEditEventDB);
48 DDX_Check(pDX, IDC_CHECK_MANAGE_USERS, m_bManageUsers);
49 DDX_Check(pDX, IDC_CHECK_PASSWORD, m_bChangePassword);
50 DDX_Check(pDX, IDC_CHECK_VIEW_EVENTDB, m_bViewEventDB);
51 DDX_Text(pDX, IDC_EDIT_DESCRIPTION, m_strDescription);
52 DDV_MaxChars(pDX, m_strDescription, 255);
53 DDX_Text(pDX, IDC_EDIT_LOGIN_NAME, m_strLogin);
54 DDV_MaxChars(pDX, m_strLogin, 63);
55 DDX_Text(pDX, IDC_EDIT_NAME, m_strFullName);
56 DDV_MaxChars(pDX, m_strFullName, 127);
57 DDX_Check(pDX, IDC_CHECK_MANAGE_ACTIONS, m_bManageActions);
58 DDX_Check(pDX, IDC_CHECK_MANAGE_EPP, m_bManageEPP);
59 DDX_Check(pDX, IDC_CHECK_MANAGE_CONFIG, m_bManageConfig);
60 DDX_Check(pDX, IDC_CHECK_SNMP_TRAPS, m_bConfigureTraps);
61 DDX_Check(pDX, IDC_CHECK_DELETE_ALARMS, m_bDeleteAlarms);
62 DDX_Check(pDX, IDC_CHECK_MANAGE_PKG, m_bManagePkg);
63 //}}AFX_DATA_MAP
64 }
65
66
67 BEGIN_MESSAGE_MAP(CUserPropDlg, CDialog)
68 //{{AFX_MSG_MAP(CUserPropDlg)
69 //}}AFX_MSG_MAP
70 END_MESSAGE_MAP()
71
72 /////////////////////////////////////////////////////////////////////////////
73 // CUserPropDlg message handlers
74
75 BOOL CUserPropDlg::OnInitDialog()
76 {
77 CDialog::OnInitDialog();
78
79 if (m_pUser->dwId == 0)
80 {
81 // Disable checkboxes with system access rights for superuser
82 GetDlgItem(IDC_CHECK_DISABLED)->EnableWindow(FALSE);
83 GetDlgItem(IDC_CHECK_DROP_CONN)->EnableWindow(FALSE);
84 GetDlgItem(IDC_CHECK_MANAGE_USERS)->EnableWindow(FALSE);
85 GetDlgItem(IDC_CHECK_SNMP_TRAPS)->EnableWindow(FALSE);
86 GetDlgItem(IDC_CHECK_MANAGE_CONFIG)->EnableWindow(FALSE);
87 GetDlgItem(IDC_CHECK_VIEW_EVENTDB)->EnableWindow(FALSE);
88 GetDlgItem(IDC_CHECK_EDIT_EVENTDB)->EnableWindow(FALSE);
89 GetDlgItem(IDC_CHECK_MANAGE_ACTIONS)->EnableWindow(FALSE);
90 GetDlgItem(IDC_CHECK_MANAGE_EPP)->EnableWindow(FALSE);
91 }
92
93 return TRUE;
94 }