home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 March / Chip_2002-03_cd1.bin / zkuste / delphi / kompon / d56 / MSYSINFO.ZIP / Demos / GUI / GroupProps.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2002-01-04  |  2.0 KB  |  88 lines

  1. unit GroupProps;
  2.  
  3. interface
  4.  
  5. uses 
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   ComCtrls, StdCtrls, ExtCtrls, ImgList;
  8.  
  9. type
  10.   TpropGroup = class(TFrame)
  11.     pc: TPageControl;
  12.     tsMembers: TTabSheet;
  13.     Panel4: TPanel;
  14.     lv: TListView;
  15.     imgList: TImageList;
  16.     tsGeneral: TTabSheet;
  17.     Image1: TImage;
  18.     Bevel3: TBevel;
  19.     lComment: TLabel;
  20.     stName: TEdit;
  21.     Bevel1: TBevel;
  22.     Label1: TLabel;
  23.     Label2: TLabel;
  24.     Label3: TLabel;
  25.     stNSA: TStaticText;
  26.     stSidType: TStaticText;
  27.     Label4: TLabel;
  28.     Label5: TLabel;
  29.     stDomain: TStaticText;
  30.     stLen: TStaticText;
  31.     eSID: TEdit;
  32.     eComment: TEdit;
  33.     Image: TImage;
  34.   private
  35.     FIndex: DWORD;
  36.     FAccounts: TObject;
  37.     FGlobalLevel: Boolean;
  38.   public
  39.     property Accounts: TObject read FAccounts write FAccounts;
  40.     property GroupIndex: DWORD read FIndex write FIndex;
  41.     property GlobalLevel: Boolean read FGlobalLevel write FGlobalLevel;
  42.     procedure Refresh;
  43.   end;
  44.  
  45. implementation
  46.  
  47. uses MiTeC_AccountsNT;
  48.  
  49. {$R *.DFM}
  50.  
  51. { TpropGroup }
  52.  
  53. procedure TpropGroup.Refresh;
  54. var
  55.   i: integer;
  56.   sl: TStringList;
  57.   gr: TGroupInfo;
  58. begin
  59.   sl:=TStringList.Create;
  60.   pc.ActivePage:=tsGeneral;
  61.   sl:=TStringList.Create;
  62.   Image.Visible:=GlobalLevel;
  63.   if GlobalLevel then begin
  64.     gr:=TAccounts(Accounts).GlobalGroups[GroupIndex]^;
  65.     TAccounts(Accounts).GetGlobalGroupUsers('',gr.Name,sl);
  66.   end else begin
  67.     gr:=TAccounts(Accounts).LocalGroups[GroupIndex]^;
  68.     TAccounts(Accounts).GetLocalGroupUsers('',gr.Name,sl);
  69.   end;
  70.   with TAccounts(Accounts),gr do begin
  71.     eSID.Text:=SID;
  72.     stNSA.Caption:=IntToStr(NumberOfSubAuths);
  73.     stSidType.Caption:=GetNameUseStr(SidType);
  74.     stLen.Caption:=IntToStr(SidLength);
  75.     stDomain.Caption:=Domain;
  76.     stName.Text:=Name;
  77.     eComment.Text:=Comment;
  78.     for i:=0 to sl.Count-1 do
  79.       with lv.Items.Add do begin
  80.         Caption:=sl[i];
  81.         ImageIndex:=0;
  82.       end;
  83.   end;
  84.   sl.Free;
  85. end;
  86.  
  87. end.
  88.