Ejemplo n.º 1
0
void CAclWeb::Edit()
{
	if((m_bButtonFlags & ACL_BUTTON_EDIT_MASK) != ACL_BUTTON_EDIT_MASK) return;

	if(m_iListIndex < 0) 
		return;

	CAclDialog dlg;
	dlg.SetDialog(ACL_CAPTION_EDIT, ACL_CAPTION_WEB_EDIT, ACL_DIALOG_WEB);
	CAclWebSet* pAclWebSet = dlg.GetAclWebSet();
	PXACL_WEB pAcl = pAclWebSet->GetAcl();

	pAcl->dwId = atol(m_List.GetItemText(m_iListIndex, 0));
	PXACL_WEB pAclOld = (PXACL_WEB)m_History.FindAcl(pAcl->dwId);
	if(pAclOld == NULL) pAclOld = (PXACL_WEB)theApp.m_AclFile.FindAcl(pAcl->dwId, ACL_TYPE_WEB);
	if(pAclOld == NULL) return;

	*pAcl = *pAclOld;

	int iRet = dlg.DoModal();

	if(iRet == IDCANCEL || !pAclWebSet->IsChange()) return;

	AddAcl(pAcl, TRUE, TRUE, m_iListIndex);
	m_bButtonFlags |= ACL_BUTTON_SHOW_APPLY_GROUP;
	SendMessageEx(m_bButtonFlags);
	m_History.AddHistory(OPT_TYPE_EDIT, m_bButtonFlags, (char*)pAcl, (char*)pAclOld);
}
Ejemplo n.º 2
0
void CAclApp::Add()
{
	if((m_bButtonFlags & ACL_BUTTON_ADD_MASK) != ACL_BUTTON_ADD_MASK) return;

	CAclDialog dlg;
	dlg.SetDialog(ACL_CAPTION_ADD, ACL_CAPTION_APP_ADD, ACL_DIALOG_APP);
	CAclSet* pAclSet = dlg.GetAclSet();
	PXACL pAcl = pAclSet->GetAcl();

	int nIndex = m_List.GetItemCount();
	if(nIndex == 0)
		pAcl->ulAclID = 1;
	else
		pAcl->ulAclID = atol(m_List.GetItemText(nIndex - 1, 0)) + 1;

	pAcl->bDirection = ACL_DIRECTION_IN_OUT;
	pAcl->sApplication[0] = '*';

	int iRet = dlg.DoModal();

	if(iRet == IDCANCEL) return;

	AddAcl(pAcl);
	m_bButtonFlags |= ACL_BUTTON_SHOW_APPLY_GROUP;
	m_History.AddHistory(OPT_TYPE_ADD, m_bButtonFlags, (char*)pAcl);
	SendMessageEx(m_bButtonFlags);
}
Ejemplo n.º 3
0
void CAclWeb::InitList()
{
	m_List.DeleteAllItems();

	PXACL_WEB pAcl = theApp.m_AclFile.GetHeader()->pWeb;
	while(pAcl != NULL)
	{
		AddAcl(pAcl, FALSE);
		pAcl = pAcl->pNext;
	}
	if(m_List.GetItemCount() > 0)
	{
		m_List.SetItemState(0,	LVIS_SELECTED,LVIS_SELECTED);
	}
}
Ejemplo n.º 4
0
void CAclApp::InitList()
{
	m_List.DeleteAllItems();
	m_List.SetImageList(&m_ImageList, LVSIL_SMALL);

	PXACL pAcl = theApp.m_AclFile.GetHeader()->pAcl;
	while(pAcl != NULL)
	{
		AddAcl(pAcl, FALSE);
		pAcl = pAcl->pNext;
	}
	if(m_List.GetItemCount() > 0)
	{
		m_List.SetItemState(0,	LVIS_SELECTED,LVIS_SELECTED);
	}
}
Ejemplo n.º 5
0
void CAclWeb::Add()
{
	if((m_bButtonFlags & ACL_BUTTON_ADD_MASK) != ACL_BUTTON_ADD_MASK) return;

	CAclDialog dlg;
	dlg.SetDialog(ACL_CAPTION_ADD, ACL_CAPTION_WEB_ADD, ACL_DIALOG_WEB);
	CAclWebSet* pAclWebSet = dlg.GetAclWebSet();
	PXACL_WEB pAcl = pAclWebSet->GetAcl();

	int nIndex = m_List.GetItemCount();
	if(nIndex == 0)
		pAcl->dwId = 1;
	else
		pAcl->dwId = atol(m_List.GetItemText(nIndex - 1, 0)) + 1;

	int iRet = dlg.DoModal();

	if(iRet == IDCANCEL) return;

	AddAcl(pAcl);
	m_bButtonFlags |= ACL_BUTTON_SHOW_APPLY_GROUP;
	m_History.AddHistory(OPT_TYPE_ADD, m_bButtonFlags, (char*)pAcl);
	SendMessageEx(m_bButtonFlags);
}