2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
15 #include <afs/param.h>
19 #include "afs_shl_ext.h"
20 #include "add_acl_entry_dlg.h"
21 #include "set_afs_acl.h"
27 static char THIS_FILE
[] = __FILE__
;
30 /////////////////////////////////////////////////////////////////////////////
31 // CAddAclEntryDlg dialog
34 CAddAclEntryDlg::CAddAclEntryDlg(CWnd
* pParent
/*=NULL*/)
37 InitModalIndirect (TaLocale_GetDialogResource (CAddAclEntryDlg::IDD
), pParent
);
39 //{{AFX_DATA_INIT(CAddAclEntryDlg)
46 void CAddAclEntryDlg::DoDataExchange(CDataExchange
* pDX
)
48 CDialog::DoDataExchange(pDX
);
49 //{{AFX_DATA_MAP(CAddAclEntryDlg)
50 DDX_Control(pDX
, IDOK
, m_Ok
);
51 DDX_Control(pDX
, IDC_NAME
, m_Name
);
52 DDX_Control(pDX
, IDC_ADD_NORMAL_ENTRY
, m_NormalEntry
);
53 DDX_Control(pDX
, IDC_LOOKUP2
, m_LookupPerm
);
54 DDX_Control(pDX
, IDC_LOCK2
, m_LockPerm
);
55 DDX_Control(pDX
, IDC_WRITE
, m_WritePerm
);
56 DDX_Control(pDX
, IDC_ADMINISTER
, m_AdminPerm
);
57 DDX_Control(pDX
, IDC_READ
, m_ReadPerm
);
58 DDX_Control(pDX
, IDC_INSERT
, m_InsertPerm
);
59 DDX_Control(pDX
, IDC_DELETE
, m_DeletePerm
);
64 BEGIN_MESSAGE_MAP(CAddAclEntryDlg
, CDialog
)
65 //{{AFX_MSG_MAP(CAddAclEntryDlg)
66 ON_BN_CLICKED(IDC_ADD_NEGATIVE_ENTRY
, OnAddNegativeEntry
)
67 ON_BN_CLICKED(IDC_ADD_NORMAL_ENTRY
, OnAddNormalEntry
)
68 ON_EN_CHANGE(IDC_NAME
, OnChangeName
)
69 ON_BN_CLICKED(IDHELP
, OnHelp
)
73 /////////////////////////////////////////////////////////////////////////////
74 // CAddAclEntryDlg message handlers
76 void CAddAclEntryDlg::OnAddNegativeEntry()
81 void CAddAclEntryDlg::OnAddNormalEntry()
86 BOOL
CAddAclEntryDlg::OnInitDialog()
88 CDialog::OnInitDialog();
90 m_NormalEntry
.SetCheck(CHECKED
);
91 m_Ok
.EnableWindow(FALSE
);
97 return TRUE
; // return TRUE unless you set the focus to a control
98 // EXCEPTION: OCX Property Pages should return FALSE
101 CString
CAddAclEntryDlg::MakePermString()
105 if (m_ReadPerm
.GetCheck() == CHECKED
)
107 if (m_LookupPerm
.GetCheck() == CHECKED
)
109 if (m_InsertPerm
.GetCheck() == CHECKED
)
111 if (m_DeletePerm
.GetCheck() == CHECKED
)
113 if (m_WritePerm
.GetCheck() == CHECKED
)
115 if (m_LockPerm
.GetCheck() == CHECKED
)
117 if (m_AdminPerm
.GetCheck() == CHECKED
)
123 void CAddAclEntryDlg::OnOK()
125 m_Rights
= MakePermString();
126 m_Name
.GetWindowText(m_strName
);
128 if (m_pAclSetDlg
->IsNameInUse(m_bNormal
, m_strName
)) {
129 ShowMessageBox(IDS_ACL_ENTRY_NAME_IN_USE
, MB_ICONEXCLAMATION
, IDS_ACL_ENTRY_NAME_IN_USE
);
136 void CAddAclEntryDlg::OnChangeName()
138 m_Name
.GetWindowText(m_strName
);
140 if (m_strName
.GetLength() > 0)
141 m_Ok
.EnableWindow(TRUE
);
144 void CAddAclEntryDlg::OnHelp()
146 ShowHelp(m_hWnd
, ADD_ACL_ENTRY_HELP_ID
);