mirror of
https://github.com/reactos/reactos.git
synced 2024-08-28 14:18:41 +00:00
- Add a property sheet for user groups. Settings are visible but cannot be changed yet.
- Add missing SVN properties. svn path=/trunk/; revision=33790
This commit is contained in:
parent
b82096c544
commit
fbcc10c57e
155
reactos/dll/cpl/usrmgr/groupprops.c
Normal file
155
reactos/dll/cpl/usrmgr/groupprops.c
Normal file
|
@ -0,0 +1,155 @@
|
||||||
|
/*
|
||||||
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
|
* PROJECT: ReactOS User Manager Control Panel
|
||||||
|
* FILE: dll/cpl/usrmgr/groupprops.c
|
||||||
|
* PURPOSE: Group property sheet
|
||||||
|
*
|
||||||
|
* PROGRAMMERS: Eric Kohl
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "usrmgr.h"
|
||||||
|
|
||||||
|
|
||||||
|
static VOID
|
||||||
|
GetGroupData(HWND hwndDlg, LPTSTR lpGroupName)
|
||||||
|
{
|
||||||
|
PLOCALGROUP_INFO_1 groupInfo = NULL;
|
||||||
|
PLOCALGROUP_MEMBERS_INFO_1 membersInfo = NULL;
|
||||||
|
DWORD dwRead;
|
||||||
|
DWORD dwTotal;
|
||||||
|
DWORD_PTR resumeHandle = 0;
|
||||||
|
DWORD i;
|
||||||
|
LV_ITEM lvi;
|
||||||
|
HWND hwndLV;
|
||||||
|
LV_COLUMN column;
|
||||||
|
RECT rect;
|
||||||
|
HIMAGELIST hImgList;
|
||||||
|
HICON hIcon;
|
||||||
|
|
||||||
|
hwndLV = GetDlgItem(hwndDlg, IDC_GROUP_GENERAL_MEMBERS);
|
||||||
|
|
||||||
|
/* Create the image list */
|
||||||
|
hImgList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 5, 5);
|
||||||
|
hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
|
||||||
|
ImageList_AddIcon(hImgList, hIcon);
|
||||||
|
hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_GROUP), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
|
||||||
|
ImageList_AddIcon(hImgList, hIcon);
|
||||||
|
DestroyIcon(hIcon);
|
||||||
|
|
||||||
|
(void)ListView_SetImageList(hwndLV, hImgList, LVSIL_SMALL);
|
||||||
|
|
||||||
|
/* Set the list column */
|
||||||
|
GetClientRect(hwndLV, &rect);
|
||||||
|
|
||||||
|
memset(&column, 0x00, sizeof(column));
|
||||||
|
column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM;
|
||||||
|
column.fmt = LVCFMT_LEFT;
|
||||||
|
column.cx = (INT)(rect.right - rect.left);
|
||||||
|
column.iSubItem = 0;
|
||||||
|
(void)ListView_InsertColumn(hwndLV, 0, &column);
|
||||||
|
|
||||||
|
/* Set group name */
|
||||||
|
SetDlgItemText(hwndDlg, IDC_GROUP_GENERAL_NAME, lpGroupName);
|
||||||
|
|
||||||
|
/* Set group description */
|
||||||
|
NetLocalGroupGetInfo(NULL, lpGroupName, 1, (LPBYTE*)&groupInfo);
|
||||||
|
SetDlgItemText(hwndDlg, IDC_GROUP_GENERAL_DESCRIPTION, groupInfo->lgrpi1_comment);
|
||||||
|
NetApiBufferFree(groupInfo);
|
||||||
|
|
||||||
|
/* Set group members */
|
||||||
|
NetLocalGroupGetMembers(NULL, lpGroupName, 1, (LPBYTE*)&membersInfo,
|
||||||
|
MAX_PREFERRED_LENGTH, &dwRead, &dwTotal,
|
||||||
|
&resumeHandle);
|
||||||
|
|
||||||
|
for (i = 0; i < dwRead; i++)
|
||||||
|
{
|
||||||
|
ZeroMemory(&lvi, sizeof(lvi));
|
||||||
|
lvi.mask = LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;
|
||||||
|
lvi.pszText = membersInfo[i].lgrmi1_name;
|
||||||
|
lvi.state = 0;
|
||||||
|
lvi.iImage = (membersInfo[i].lgrmi1_sidusage == SidTypeGroup ||
|
||||||
|
membersInfo[i].lgrmi1_sidusage == SidTypeWellKnownGroup) ? 1 : 0;
|
||||||
|
|
||||||
|
(void)ListView_InsertItem(hwndLV, &lvi);
|
||||||
|
}
|
||||||
|
|
||||||
|
NetApiBufferFree(membersInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
INT_PTR CALLBACK
|
||||||
|
GroupGeneralPageProc(HWND hwndDlg,
|
||||||
|
UINT uMsg,
|
||||||
|
WPARAM wParam,
|
||||||
|
LPARAM lParam)
|
||||||
|
{
|
||||||
|
UNREFERENCED_PARAMETER(lParam);
|
||||||
|
UNREFERENCED_PARAMETER(wParam);
|
||||||
|
UNREFERENCED_PARAMETER(hwndDlg);
|
||||||
|
|
||||||
|
switch (uMsg)
|
||||||
|
{
|
||||||
|
case WM_INITDIALOG:
|
||||||
|
GetGroupData(hwndDlg,
|
||||||
|
(LPTSTR)((PROPSHEETPAGE *)lParam)->lParam);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_COMMAND:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_DESTROY:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static VOID
|
||||||
|
InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc, LPTSTR pszGroup)
|
||||||
|
{
|
||||||
|
ZeroMemory(psp, sizeof(PROPSHEETPAGE));
|
||||||
|
psp->dwSize = sizeof(PROPSHEETPAGE);
|
||||||
|
psp->dwFlags = PSP_DEFAULT;
|
||||||
|
psp->hInstance = hApplet;
|
||||||
|
psp->pszTemplate = MAKEINTRESOURCE(idDlg);
|
||||||
|
psp->pfnDlgProc = DlgProc;
|
||||||
|
psp->lParam = (LPARAM)pszGroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
VOID
|
||||||
|
GroupProperties(HWND hwndDlg)
|
||||||
|
{
|
||||||
|
PROPSHEETPAGE psp[1];
|
||||||
|
PROPSHEETHEADER psh;
|
||||||
|
TCHAR szGroupName[UNLEN];
|
||||||
|
INT nItem;
|
||||||
|
HWND hwndLV;
|
||||||
|
|
||||||
|
hwndLV = GetDlgItem(hwndDlg, IDC_GROUPS_LIST);
|
||||||
|
nItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED);
|
||||||
|
if (nItem == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Get the new user name */
|
||||||
|
ListView_GetItemText(hwndLV,
|
||||||
|
nItem, 0,
|
||||||
|
szGroupName,
|
||||||
|
UNLEN);
|
||||||
|
|
||||||
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||||
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
|
||||||
|
psh.hwndParent = hwndDlg;
|
||||||
|
psh.hInstance = hApplet;
|
||||||
|
psh.hIcon = NULL;
|
||||||
|
psh.pszCaption = szGroupName;
|
||||||
|
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
|
||||||
|
psh.nStartPage = 0;
|
||||||
|
psh.ppsp = psp;
|
||||||
|
|
||||||
|
InitPropSheetPage(&psp[0], IDD_GROUP_GENERAL, (DLGPROC)GroupGeneralPageProc, szGroupName);
|
||||||
|
|
||||||
|
PropertySheet(&psh);
|
||||||
|
}
|
|
@ -53,11 +53,9 @@ UpdateGroupsList(HWND hwndListView)
|
||||||
DWORD totalentries;
|
DWORD totalentries;
|
||||||
DWORD resume_handle = 0;
|
DWORD resume_handle = 0;
|
||||||
DWORD i;
|
DWORD i;
|
||||||
|
|
||||||
LV_ITEM lvi;
|
LV_ITEM lvi;
|
||||||
INT iItem;
|
INT iItem;
|
||||||
|
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
netStatus = NetLocalGroupEnum(NULL, 1, (LPBYTE*)&pBuffer,
|
netStatus = NetLocalGroupEnum(NULL, 1, (LPBYTE*)&pBuffer,
|
||||||
|
@ -385,15 +383,18 @@ OnNotify(HWND hwndDlg, PGROUP_DATA pGroupData, NMHDR *phdr)
|
||||||
{
|
{
|
||||||
case NM_CLICK:
|
case NM_CLICK:
|
||||||
pGroupData->iCurrentItem = lpnmlv->iItem;
|
pGroupData->iCurrentItem = lpnmlv->iItem;
|
||||||
if (lpnmlv->iItem == -1)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NM_DBLCLK:
|
case NM_DBLCLK:
|
||||||
|
if (lpnmlv->iItem != -1)
|
||||||
|
{
|
||||||
|
UINT uItem;
|
||||||
|
|
||||||
|
uItem = GetMenuDefaultItem(GetSubMenu(pGroupData->hPopupMenu, 1),
|
||||||
|
FALSE, 0);
|
||||||
|
if (uItem != (UINT)-1)
|
||||||
|
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(uItem, 0), 0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NM_RCLICK:
|
case NM_RCLICK:
|
||||||
|
@ -439,6 +440,9 @@ GroupsPageProc(HWND hwndDlg,
|
||||||
pGroupData->hPopupMenu = LoadMenu(hApplet, MAKEINTRESOURCE(IDM_POPUP_GROUP));
|
pGroupData->hPopupMenu = LoadMenu(hApplet, MAKEINTRESOURCE(IDM_POPUP_GROUP));
|
||||||
|
|
||||||
OnInitDialog(hwndDlg);
|
OnInitDialog(hwndDlg);
|
||||||
|
SetMenuDefaultItem(GetSubMenu(pGroupData->hPopupMenu, 1),
|
||||||
|
IDM_GROUP_PROPERTIES,
|
||||||
|
FALSE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
|
@ -455,6 +459,10 @@ GroupsPageProc(HWND hwndDlg,
|
||||||
case IDM_GROUP_DELETE:
|
case IDM_GROUP_DELETE:
|
||||||
GroupDelete(hwndDlg);
|
GroupDelete(hwndDlg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IDM_GROUP_PROPERTIES:
|
||||||
|
GroupProperties(hwndDlg);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||||
CAPTION "General"
|
CAPTION "General"
|
||||||
FONT 8, "MS Shell Dlg"
|
FONT 8, "MS Shell Dlg"
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "", IDC_USER_GENERAL_NAME, 7, 7, 112, 8
|
LTEXT "", IDC_USER_GENERAL_NAME, 7, 12, 112, 8
|
||||||
LTEXT "Full name:", -1, 7, 46, 63, 8
|
LTEXT "Full name:", -1, 7, 46, 63, 8
|
||||||
EDITTEXT IDC_USER_GENERAL_FULL_NAME,77,43,168,13,ES_AUTOHSCROLL
|
EDITTEXT IDC_USER_GENERAL_FULL_NAME,77,43,168,13,ES_AUTOHSCROLL
|
||||||
LTEXT "Description:", -1, 7, 64, 63, 8
|
LTEXT "Description:", -1, 7, 64, 63, 8
|
||||||
|
@ -54,6 +54,20 @@ BEGIN
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
IDD_GROUP_GENERAL DIALOGEX DISCARDABLE 0, 0, 252, 223
|
||||||
|
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
|
||||||
|
CAPTION "General"
|
||||||
|
FONT 8, "MS Shell Dlg"
|
||||||
|
BEGIN
|
||||||
|
LTEXT "", IDC_GROUP_GENERAL_NAME, 7, 12, 112, 8
|
||||||
|
LTEXT "Description:", -1, 7, 45, 46, 8
|
||||||
|
EDITTEXT IDC_GROUP_GENERAL_DESCRIPTION,65,42,180,13,ES_AUTOHSCROLL
|
||||||
|
LTEXT "Members:", -1, 7, 63, 45, 8
|
||||||
|
CONTROL "", IDC_GROUP_GENERAL_MEMBERS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,
|
||||||
|
7, 74, 238, 117, WS_EX_CLIENTEDGE
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
IDD_CHANGE_PASSWORD DIALOGEX DISCARDABLE 0, 0, 267, 74
|
IDD_CHANGE_PASSWORD DIALOGEX DISCARDABLE 0, 0, 267, 74
|
||||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SHELLFONT
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SHELLFONT
|
||||||
CAPTION "Change Password"
|
CAPTION "Change Password"
|
||||||
|
@ -121,7 +135,7 @@ BEGIN
|
||||||
MENUITEM "Delete", IDM_GROUP_DELETE
|
MENUITEM "Delete", IDM_GROUP_DELETE
|
||||||
MENUITEM "Rename", IDM_GROUP_RENAME
|
MENUITEM "Rename", IDM_GROUP_RENAME
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Properties", IDM_GROUP_PROPERTIES, GRAYED
|
MENUITEM "Properties", IDM_GROUP_PROPERTIES
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,20 @@
|
||||||
#include "usrmgr.h"
|
#include "usrmgr.h"
|
||||||
|
|
||||||
|
|
||||||
|
VOID
|
||||||
|
DebugPrintf(LPTSTR szFormat, ...)
|
||||||
|
{
|
||||||
|
TCHAR szOut[512];
|
||||||
|
va_list arg_ptr;
|
||||||
|
|
||||||
|
|
||||||
|
va_start (arg_ptr, szFormat);
|
||||||
|
_vstprintf (szOut, szFormat, arg_ptr);
|
||||||
|
va_end (arg_ptr);
|
||||||
|
|
||||||
|
MessageBox(NULL, szOut, _T("Debug"), MB_OK);
|
||||||
|
}
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
CheckAccountName(HWND hwndDlg,
|
CheckAccountName(HWND hwndDlg,
|
||||||
INT nIdDlgItem,
|
INT nIdDlgItem,
|
||||||
|
|
|
@ -45,6 +45,11 @@
|
||||||
#define IDC_USER_GENERAL_DISABLED 317
|
#define IDC_USER_GENERAL_DISABLED 317
|
||||||
#define IDC_USER_GENERAL_LOCKED 318
|
#define IDC_USER_GENERAL_LOCKED 318
|
||||||
|
|
||||||
|
#define IDD_GROUP_GENERAL 340
|
||||||
|
#define IDC_GROUP_GENERAL_NAME 341
|
||||||
|
#define IDC_GROUP_GENERAL_DESCRIPTION 342
|
||||||
|
#define IDC_GROUP_GENERAL_MEMBERS 343
|
||||||
|
|
||||||
|
|
||||||
#define IDD_CHANGE_PASSWORD 350
|
#define IDD_CHANGE_PASSWORD 350
|
||||||
#define IDC_EDIT_PASSWORD1 351
|
#define IDC_EDIT_PASSWORD1 351
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS User Manager Control Panel
|
* PROJECT: ReactOS User Manager Control Panel
|
||||||
* FILE: dll/cpl/usrmgr/users.c
|
* FILE: dll/cpl/usrmgr/users.c
|
||||||
* PURPOSE: Users property page
|
* PURPOSE: User property sheet
|
||||||
*
|
*
|
||||||
* PROGRAMMERS: Eric Kohl
|
* PROGRAMMERS: Eric Kohl
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -29,7 +29,14 @@ INT_PTR CALLBACK UsersPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
INT_PTR CALLBACK GroupsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
INT_PTR CALLBACK GroupsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
INT_PTR CALLBACK ExtraPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
INT_PTR CALLBACK ExtraPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
|
/* groupprops.c */
|
||||||
|
VOID
|
||||||
|
GroupProperties(HWND hwndDlg);
|
||||||
|
|
||||||
/* misc.c */
|
/* misc.c */
|
||||||
|
VOID
|
||||||
|
DebugPrintf(LPTSTR szFormat, ...);
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
CheckAccountName(HWND hwndDlg,
|
CheckAccountName(HWND hwndDlg,
|
||||||
INT nIdDlgItem,
|
INT nIdDlgItem,
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
<library>netapi32</library>
|
<library>netapi32</library>
|
||||||
<library>msvcrt</library>
|
<library>msvcrt</library>
|
||||||
<file>extra.c</file>
|
<file>extra.c</file>
|
||||||
|
<file>groupprops.c</file>
|
||||||
<file>groups.c</file>
|
<file>groups.c</file>
|
||||||
<file>misc.c</file>
|
<file>misc.c</file>
|
||||||
<file>userprops.c</file>
|
<file>userprops.c</file>
|
||||||
|
|
Loading…
Reference in a new issue