Implement a completely new user manager (look + feel + logic):

- Accounts and existing privileges are presented in a pulldown which makes it as easy to use as a toy
- Adding privileges calls the new SelectDBO dialog which is basically a tree like childwins dbtree
- Updating accounts canonicalizes various odd/legacy mechanisms in the MySQL user system
- Fullfills feature request #1547437 (btw)
- Wants to be tested heavily on different servers

A result of a team work. 1000 thanks to rosenfield for the admin friendly logic implementation, tons of fixes and usability ideas.
This commit is contained in:
Ansgar Becker
2008-05-08 20:45:51 +00:00
parent 54de398a1c
commit d4c32d56d7
15 changed files with 2493 additions and 1710 deletions

View File

@@ -7,6 +7,7 @@ const
// Names of the system tables and system databases
PRIVTABLE_USERS = 'user';
PRIVTABLE_DB = 'db';
PRIVTABLE_HOST = 'host';
PRIVTABLE_TABLES = 'tables_priv';
PRIVTABLE_COLUMNS = 'columns_priv';
DBNAME_INFORMATION_SCHEMA = 'information_schema';
@@ -158,6 +159,10 @@ const
REGNAME_VIEWWINHEIGHT = 'View_WindowHeight';
REGNAME_PREFER_SHOWTABLES = 'PreferShowTables';
DEFAULT_PREFER_SHOWTABLES = False;
REGNAME_USERMNGR_WINWIDTH = 'Usermanager_WindowWidth';
REGNAME_USERMNGR_WINHEIGHT = 'Usermanager_WindowHeight';
REGNAME_SELECTDBO_WINWIDTH = 'SelectDBO_WindowWidth';
REGNAME_SELECTDBO_WINHEIGHT = 'SelectDBO_WindowHeight';
REGPREFIX_COLWIDTHS = 'ColWidths_';
REGPREFIX_COLSVISIBLE = 'ColsVisible_';
@@ -175,6 +180,9 @@ const
ICONINDEX_INDEXKEY = 23;
ICONINDEX_UNIQUEKEY = 24;
ICONINDEX_FULLTEXTKEY = 22;
ICONINDEX_SERVER = 1;
ICONINDEX_DB = 5;
ICONINDEX_DB_HIGHLIGHT = 70;
ICONINDEX_TABLE = 14;
ICONINDEX_TABLE_HIGHLIGHT = 71;
ICONINDEX_VIEW = 81;
@@ -217,3 +225,5 @@ const
NODETYPE_DEFAULT = 0;
NODETYPE_BASETABLE = 1;
NODETYPE_VIEW = 2;
NODETYPE_DB = 3;
NODETYPE_COLUMN = 4;

View File

@@ -18,7 +18,6 @@ uses
optimizetables in '..\..\source\optimizetables.pas' {optimize},
printlist in '..\..\source\printlist.pas' {printlistForm},
copytable in '..\..\source\copytable.pas' {CopyTableForm},
edituser in '..\..\source\edituser.pas' {FormEditUser},
insertfiles in '..\..\source\insertfiles.pas' {frmInsertFiles},
insertfiles_progress in '..\..\source\insertfiles_progress.pas' {frmInsertFilesProgress},
helpers in '..\..\source\helpers.pas',
@@ -37,7 +36,8 @@ uses
createdatabase in '..\..\source\createdatabase.pas' {CreateDatabaseForm},
updatecheck in '..\..\source\updatecheck.pas' {frmUpdateCheck},
editvar in '..\..\source\editvar.pas' {frmEditVariable},
view in '..\..\source\view.pas' {frmView};
view in '..\..\source\view.pas' {frmView},
selectdbobject in '..\..\source\selectdbobject.pas' {frmSelectDBObject};
{$R *.RES}

View File

@@ -85,9 +85,6 @@
<DCCReference Include="..\..\source\data_sorting.pas">
<Form>DataSortingForm</Form>
</DCCReference>
<DCCReference Include="..\..\source\edituser.pas">
<Form>FormEditUser</Form>
</DCCReference>
<DCCReference Include="..\..\source\editvar.pas">
<Form>frmEditVariable</Form>
</DCCReference>
@@ -129,6 +126,9 @@
<DCCReference Include="..\..\source\runsqlfile.pas">
<Form>RunSQLFileForm</Form>
</DCCReference>
<DCCReference Include="..\..\source\selectdbobject.pas">
<Form>frmSelectDBObject</Form>
</DCCReference>
<DCCReference Include="..\..\source\sqlhelp.pas">
<Form>frmSQLhelp</Form>
</DCCReference>
@@ -147,4 +147,4 @@
<Form>frmView</Form>
</DCCReference>
</ItemGroup>
</Project>
</Project>

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 785 B

BIN
res/icons/user_delete.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

BIN
res/icons/user_edit.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

View File

@@ -1314,8 +1314,8 @@ begin
newTree.Parent := self;
tnodehost := newTree.Items.Add( nil, FConn.MysqlParams.User + '@' + FConn.MysqlParams.Host ); // Host or Root
tnodehost.ImageIndex := 1;
tnodehost.SelectedIndex := 1;
tnodehost.ImageIndex := ICONINDEX_SERVER;
tnodehost.SelectedIndex := ICONINDEX_SERVER;
select := 0;
// Avoids excessive InitializeKeywordLists() calls.
@@ -1330,8 +1330,8 @@ begin
for i := 0 to ( OnlyDBs2.Count - 1 ) do
begin
tnode := newTree.Items.AddChild( tnodehost, OnlyDBs2[i] );
tnode.ImageIndex := 5;
tnode.SelectedIndex := 70;
tnode.ImageIndex := ICONINDEX_DB;
tnode.SelectedIndex := ICONINDEX_DB_HIGHLIGHT;
// Add dummy-node, will be replaced by real tables on expanding
newTree.Items.AddChild( tnode, DUMMY_NODE_TEXT );
if i = 0 then tnodehost.Expand(false);
@@ -5983,8 +5983,8 @@ procedure TMDIChild.vstGetImageIndex(Sender: TBaseVirtualTree; Node:
var
NodeData : PVTreeData;
begin
// Display icon only for leftmost cell
if Column <> 0 then
// Display icon only for leftmost cell (0) or for tree nodes (-1)
if Column > 0 then
exit;
// Get pointer to node which gets displayed
NodeData := Sender.GetNodeData(Node);

View File

@@ -1,108 +0,0 @@
object FormEditUser: TFormEditUser
Left = 792
Top = 134
AutoSize = True
BorderStyle = bsDialog
BorderWidth = 5
Caption = 'Edit User...'
ClientHeight = 168
ClientWidth = 313
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poMainFormCenter
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 237
Top = 143
Width = 75
Height = 25
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 0
end
object Button2: TButton
Left = 154
Top = 143
Width = 75
Height = 25
Caption = 'Save'
Default = True
ModalResult = 1
TabOrder = 1
OnClick = Button2Click
end
object GroupBox1: TGroupBox
Left = 0
Top = 0
Width = 313
Height = 137
Caption = 'Edit users credentials'
TabOrder = 2
object Label1: TLabel
Left = 24
Top = 32
Width = 52
Height = 13
Caption = 'Username:'
end
object Label2: TLabel
Left = 24
Top = 56
Width = 26
Height = 13
Caption = 'Host:'
end
object Label3: TLabel
Left = 24
Top = 80
Width = 74
Height = 13
Caption = 'New Password:'
end
object Label4: TLabel
Left = 24
Top = 104
Width = 88
Height = 13
Caption = 'Retype Password:'
end
object EditUsername: TEdit
Left = 125
Top = 28
Width = 150
Height = 21
TabOrder = 0
end
object EditHost: TEdit
Left = 125
Top = 52
Width = 150
Height = 21
TabOrder = 1
end
object EditPassword1: TEdit
Left = 125
Top = 76
Width = 150
Height = 21
PasswordChar = '*'
TabOrder = 2
end
object EditPassword2: TEdit
Left = 125
Top = 100
Width = 150
Height = 21
PasswordChar = '*'
TabOrder = 3
end
end
end

View File

@@ -1,103 +0,0 @@
unit edituser;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TFormEditUser = class(TForm)
Button1: TButton;
Button2: TButton;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
EditUsername: TEdit;
EditHost: TEdit;
EditPassword1: TEdit;
EditPassword2: TEdit;
procedure FormShow(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function EditUserWindow(AOwner: TComponent): Boolean;
implementation
uses usermanager, childwin, MAIN;
{$I const.inc}
{$R *.DFM}
{**
Create form on demand
@param TComponent Owner of form (should be calling form)
@return Boolean Form closed using modalresult mrOK
}
function EditUserWindow(AOwner: TComponent): Boolean;
var
f : TFormEditUser;
begin
f := TFormEditUser.Create(AOwner);
Result := (f.ShowModal=mrOK);
FreeAndNil(f);
end;
procedure TFormEditUser.FormShow(Sender: TObject);
begin
EditUsername.Text := UserManagerForm.user;
EditHost.Text := UserManagerForm.host;
EditPassword1.Text := '';
EditPassword2.Text := '';
EditUsername.SetFocus;
end;
procedure TFormEditUser.Button2Click(Sender: TObject);
var passwdset : String;
begin
// Save credentials
Screen.Cursor := crHourglass;
if EditPassword1.Text <> EditPassword2.Text then begin
Screen.Cursor := crDefault;
MessageDlg('Retyped password doesn''t match with first password.', mtError, [mbOK], 0);
EditPassword2.SetFocus;
abort;
end;
passwdset := ', Password=password('''+Self.EditPassword1.Text+''')';
if EditPassword1.Text = '' then begin
// No password?
Screen.Cursor := crDefault;
if MessageDlg('Set empty password?' + CRLF + 'Press no to leave the old password.',
mtConfirmation, [mbYes, mbNo], 0) <> mrYes then
passwdset := '';
end;
Mainform.ChildWin.ExecUpdateQuery('UPDATE mysql.user SET Host='''+EditHost.Text+''', User='''+EditUsername.Text+''' '+passwdset+' WHERE Host='''+UserManagerForm.host+''' AND User='''+UserManagerForm.user+'''');
Mainform.ChildWin.ExecUpdateQuery('UPDATE mysql.db SET Host='''+EditHost.Text+''', User='''+EditUsername.Text+''' WHERE Host='''+UserManagerForm.host+''' AND User='''+UserManagerForm.user+'''');
Mainform.ChildWin.ExecUpdateQuery('UPDATE mysql.tables_priv SET Host='''+EditHost.Text+''', User='''+EditUsername.Text+''' WHERE Host='''+UserManagerForm.host+''' AND User='''+UserManagerForm.user+'''');
Mainform.ChildWin.ExecUpdateQuery('UPDATE mysql.columns_priv SET Host='''+EditHost.Text+''', User='''+EditUsername.Text+''' WHERE Host='''+UserManagerForm.host+''' AND User='''+UserManagerForm.user+'''');
Mainform.ChildWin.ExecUpdateQuery('FLUSH PRIVILEGES');
UserManagerForm.ShowPrivilegesControls(false, true, false);
// Clear and refill user-list
FreeAndNil(UserManagerForm.ZQueryDBs);
FreeAndNil(UserManagerForm.ZQueryTables);
FreeAndNil(UserManagerForm.ZQueryColumns);
FreeAndNil(UserManagerForm.ZQueryUsers);
UserManagerForm.TreeViewUsers.Items.Clear;
UserManagerForm.PageControl1.OnChange(self);
Screen.Cursor := crdefault;
Close;
end;
end.

View File

@@ -1184,31 +1184,32 @@ object MainForm: TMainForm
PngImage.Data = {
89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF
610000001974455874536F6674776172650041646F626520496D616765526561
647971C9653C000002E54944415478DA85D26948545118C6F1E7DED16B5E7574
5CA6C646BDEE6B4AA399669B0C894B64995BAB186529ED460B6520D69720D428
0D4949A1144A8B8C2025D25033D14CAD68DCD351C975CC1967BCCE3099906BE8
F9780EEFEFC3FFBC8456ABC54AE746A4657CACD82083C79DE4B2D394BAA29128
78518BC4579F3AD9BFEFC44AC0B950A1F8C201DD328AA32217DE9756D399271F
749C5F15C88DB3B817126E7386A037C284E70299B4045AB60763324AE69ED8C1
5B15C88A34B91B915274919677823634804AA1C038CDA0B5F47A77604AA3EDAA
40446874C2ED83C28742CF2D84014542A521F17BA80739792525370B2AF62F03
12021DE3BD18AB0C8D5ACBD5E190EA16E560932BB3DD33DA778DAE5A870B0252
C8E513E0186E8062B81284AA2F6E0E880B7010FB3A3165D3AC665130AE8F2714
B405F87A12ECB0B684BEC53618DB8A20EBAAC1F7B78F06E780F418519581A975
80F95A33B83A09F0B9418291C151503401AB784BF8711918717D30DA2E81B1B9
3D28233EBEBECBD7CC01F763EC9F059FBA15C9A7C616056B294F836FA8182676
C1981A28827284C0E08F494CA858F0D8F1F906FF0B36D6FF01B4400FC60EE150
F56583A4D49896DBA0B7AA0E3972535C319C9C0738DE99D73283DA53237DA8D9
60F2F15698B809C1F7D837339C0552570D76C2167D95B5B823530E987707E524
F94BDA660132A0E8F85E3FA7F4B39745863595C5A087EAB1CB6E1AAE3BF780FD
950F82C342352EC450659D52A354B8395FAAEDFE17996042B2A37C1C858F8F24
86D2CD5A12930D85386CDA0235C187995935787C6A66D80AD2F7F54A3D8DDCC3
39B9B673E12F11CD69DE6AD6258EF394138561FD75086B12233A290F92C264F4
75D740CFDA0B53232AD818EBC3FEF41B62E9B2115D19DBFBEBE52241F1542C8C
B66E86F0B927AE1E4B00480DBE94BF44FB4F297AB91138EAFC0D8213AF970392
8204FFF6AEA1C0D496085FCD7A9770A6310C22C61C9B5C19F442809C8FDED243
8E0DB9BBDD156DB6F1854F96027F00878B3EF0E6507EDA0000000049454E44AE
426082}
647971C9653C000003084944415478DAA5D36B4893611407F0FFB3779B5ACEE9
A64BB3655EA2344DB4CC72599FC46E921566526A4AA44650242295D29D34A320
21B3B228141704155D30B5A28B16A5A3B432BB985463DE66DB9C7BE7FB6E7B9A
0B8202EB43CFB773E0FC383CE71C4229C5FF3CF227B02DCEB734544E8B19C631
99B3538C70024B8F913959D73E58F24F206F9EBC383A901E154D22C4E18C399E
C2CC3A3060A6F4BD4174E876C7D0BEBF02552BBDA9BB84C1A0C90E3B19CF08E0
200C0CA30EE84C76536DBB41FA57E0E812098DC9D881A8195EF8A6D5A1AEB616
42A11063C403BCC5C02F4E5449B2CA6E8E4D089CCB0AD2675634C9B88FF760B6
B0181A36C2CB7312A47392D05096668A4F966DE52DA16AC6330AA3430F41ACDA
ECDF80531B239E64EE2C51D90422780A6DE33ECC36064262C3B33B073EC724AC
0EF6F04B8434381686CFAD7877F77CFF2F60CACA3A9197B1A5E660CCF3CCB59B
F341DDE5AE3CE52D78D6588EA815A90E2FEFF982E18FDD90FA86422C51A0EBFE
65AB0BF05B51EF461DF65C77F89FBE7B6E115E9FC900C54F58E6338AB8E52A48
439231A65383D5130CBCB380B7727A2B6B4E20F2656AC2D991ED230EBCD8503D
0FEDF080C600B0A380D2F80005018D9086AD86555B0581D806DE1C04FDA3D6FE
61B370596C61F34B12B1B62635800C5DCB2B2A84DE83C11B0B05CF02FE7D3790
3FF32914916B9CC5A72110D9C08D04E36BF30BD4BC093970E2EC99FDAE2968F6
CEB24D8B4F65AE0CAAD0169002C6D9F954FD4DA4FB3D46C4D255E0FA2F81301C
ACC669E87BA8814C39179F1EDDE2171EEF12BB805725B31DCAC40C52705589C8
B47418BA6E2037AC1336A2805CDE021F85D859AC84B6A51BC73449A8DCA0C787
A67A1A57FE56E0023A2F6DDFCD75351CACECCBC16BBA4858147E18EBB75D4077
7D21B4BDAD709B1E0D93F34F2ADAD6618E778F2577EA2D4614B6B42232ABB2F4
D722F5AA0B24173A02C597DF461FC9F1DD93B77B4B9E738BED78D9741DEF3F7D
41B56EEB779D38BC6D559066D32E553F3B3DBD6A64C26B4C4B94B1B1210AE182
F06050D1582B3B30989352DED933D139FF00B0986008DCC8D9BB000000004945
4E44AE426082}
Name = 'PngImage10'
Background = clWindow
end
@@ -3429,6 +3430,36 @@ object MainForm: TMainForm
86F8BFF90166BD77F0B083A4C90000000049454E44AE426082}
Name = 'PngImage82'
Background = clWindow
end
item
PngImage.Data = {
89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF
610000001974455874536F6674776172650041646F626520496D616765526561
647971C9653C000002BB4944415478DAA5937D48535118C69FE3BDD3399D2B3F
5033518B205311D3283123C9BE3441162223350B4C0D4221C2024D3052214128
D344321035C5A83F4A324711A810E20A4D532433A2A1B64DE7749BDEDD7B4FD7
09129416740EE78FF39EF7FDF19EE73987504AF13F83FC0970F9806FD96E1F5A
C230A20727502C712EB62F8B4C6D9BCE50FA57407EAC4F497410AD92290811A5
3DE7A058B68BF8B14CE9A45976AB7BC458BE25A021751B952B19182C0204B216
7181481898AD22662C82A55567566D09A83AA2A4319A2244857AE1BB7E066DAD
AD605916ABC41D0E9BD9713831419953FD7C755340534E8829FB8ED69BFBFC1A
CB363B8CF38BF0F2544015711C3DD51996C84327FDA272EBB94D0177CFEDEBCF
2E2E4DE05D64F064F9B5142CF30C58C2A3ABAE5277A9F963DCA657F04F6D9379
2D0E3CAC8819CC56E71680CA7D9C71EAB0E1656B2DCA07E39ECEBAC56619B479
F6DF007E298FDDA8285C9423A0FE55533C461F6840B17E46A4B923AB1D9AA241
D8F9E962024793F14D816D03E07BBA937002CE6F770D7AD4D3180B1DDCF1DE0C
D8AD928D521A2FADA4C9FB08D3D581D34FC1CAB82EB882AB49D172954E40C4D9
E6F440627C967FED2A4CEE0CC66C140EA9495E928A5B01A286EB916CE9407852
3ADC7645C03EDC8BB13EADB8303151EC047C28DDCBEF3C98CE741A1230149806
46EA5CE4A913C04B86A9BBF6E04C5E21DCA7DE02FA0140A582910D81AEB77FDA
0918290B17831335A4F0493022333231BEA800950002B7DE4561BB1B8ED57480
EC576F086E2E0FC0509F893A01A32D576E70E33D15F7662F6094C6B3919AA320
BF5895D6188A13A9C9F0F8D68D55FB1CD6D45BB230189F827EC385AF1D85CAE6
9120D7964FD1B7A9D994CAC814DE20D2631029D4F21744EDFF8E0DF3E5C0BAE8
B164E0313DC7088E157A93FCEB77EECF0CBE6E9D9FC96704122230542F55359C
D2F2953F01332057A0274B93790000000049454E44AE426082}
Name = 'PngImage83'
Background = clWindow
end>
PngOptions = [pngBlendOnDisabled, pngGrayscaleOnDisabled]
Left = 8

View File

@@ -17,7 +17,8 @@ uses
ActnList, ImgList, Registry, ShellApi, ToolWin, Clipbrd, db, DBCtrls,
SynMemo, synedit, SynEditTypes, ZDataSet, ZSqlProcessor,
HeidiComp, sqlhelp, MysqlQueryThread, Childwin, VirtualTrees, TntDBGrids,
StrUtils, DateUtils, PngImageList, OptimizeTables, View;
StrUtils, DateUtils, PngImageList, OptimizeTables, View, Usermanager,
SelectDBObject;
type
TMainForm = class(TForm)
@@ -212,6 +213,8 @@ type
public
MaintenanceForm: TOptimize;
ViewForm: TfrmView;
UserManagerForm: TUserManagerForm;
SelectDBObjectForm: TfrmSelectDBObject;
procedure OpenRegistry(Session: String = '');
function GetRegValue( valueName: String; defaultValue: Integer; Session: String = '' ) : Integer; Overload;
function GetRegValue( valueName: String; defaultValue: Boolean; Session: String = '' ) : Boolean; Overload;
@@ -258,7 +261,6 @@ uses
exportsql,
tbl_properties,
loaddata,
usermanager,
options,
printlist,
copytable,
@@ -684,7 +686,9 @@ end;
procedure TMainForm.UserManagerExecute(Sender: TObject);
begin
UserManagerWindow (Self);
if UserManagerForm = nil then
UserManagerForm := TUserManagerForm.Create(Self);
UserManagerForm.ShowModal;
end;
procedure TMainForm.menuWindowClick(Sender: TObject);

144
source/selectdbobject.dfm Normal file
View File

@@ -0,0 +1,144 @@
object frmSelectDBObject: TfrmSelectDBObject
Left = 0
Top = 0
Caption = 'Select database object ...'
ClientHeight = 316
ClientWidth = 232
Color = clBtnFace
Constraints.MinHeight = 343
Constraints.MinWidth = 240
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poOwnerFormCenter
OnCreate = FormCreate
OnDestroy = FormDestroy
OnResize = FormResize
OnShow = FormShow
DesignSize = (
232
316)
PixelsPerInch = 96
TextHeight = 13
object lblSelect: TLabel
Left = 8
Top = 8
Width = 161
Height = 13
Caption = 'Select database, table or column:'
end
object lblDB: TLabel
Left = 8
Top = 218
Width = 17
Height = 13
Anchors = [akLeft, akBottom]
Caption = 'DB:'
end
object lblTable: TLabel
Left = 69
Top = 218
Width = 30
Height = 13
Anchors = [akLeft, akBottom]
Caption = 'Table:'
end
object lblCol: TLabel
Left = 131
Top = 218
Width = 39
Height = 13
Anchors = [akLeft, akBottom]
Caption = 'Column:'
end
object lblHint: TLabel
Left = 8
Top = 260
Width = 135
Height = 13
Anchors = [akLeft, akBottom]
Caption = '(% and _ wildcards allowed)'
end
object TreeDBO: TVirtualStringTree
Left = 8
Top = 27
Width = 216
Height = 184
Anchors = [akLeft, akTop, akRight, akBottom]
Header.AutoSizeIndex = -1
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.MainColumn = -1
Header.Options = [hoColumnResize, hoDrag]
Images = MainForm.PngImageListMain
Indent = 16
Margin = 2
TabOrder = 0
TreeOptions.PaintOptions = [toHotTrack, toShowButtons, toShowDropmark, toShowRoot, toShowTreeLines, toThemeAware, toUseBlendedImages]
OnFocusChanged = TreeDBOFocusChanged
OnGetText = TreeDBOGetText
OnGetImageIndex = TreeDBOGetImageIndex
OnGetNodeDataSize = TreeDBOGetNodeDataSize
OnInitChildren = TreeDBOInitChildren
OnInitNode = TreeDBOInitNode
Columns = <>
end
object btnOK: TButton
Left = 68
Top = 283
Width = 75
Height = 25
Anchors = [akRight, akBottom]
Caption = 'OK'
Default = True
ModalResult = 1
TabOrder = 1
end
object btnCancel: TButton
Left = 149
Top = 283
Width = 75
Height = 25
Anchors = [akRight, akBottom]
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 2
end
object editDB: TEdit
Left = 8
Top = 233
Width = 57
Height = 21
Anchors = [akLeft, akBottom]
TabOrder = 3
Text = 'editDB'
OnChange = editChange
end
object editTable: TEdit
Left = 69
Top = 233
Width = 58
Height = 21
Anchors = [akLeft, akBottom]
TabOrder = 4
Text = 'editTable'
OnChange = editChange
end
object editCol: TEdit
Left = 131
Top = 233
Width = 53
Height = 21
Anchors = [akLeft, akBottom]
TabOrder = 5
Text = 'editCol'
OnChange = editChange
end
end

260
source/selectdbobject.pas Normal file
View File

@@ -0,0 +1,260 @@
unit selectdbobject;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, VirtualTrees, Childwin, DB, Registry;
type
TfrmSelectDBObject = class(TForm)
TreeDBO: TVirtualStringTree;
btnOK: TButton;
btnCancel: TButton;
lblSelect: TLabel;
editDB: TEdit;
editTable: TEdit;
editCol: TEdit;
lblDB: TLabel;
lblTable: TLabel;
lblCol: TLabel;
lblHint: TLabel;
procedure editChange(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TreeDBOFocusChanged(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex);
procedure TreeDBOGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode;
Kind: TVTImageKind; Column: TColumnIndex; var Ghosted: Boolean; var
ImageIndex: Integer);
procedure TreeDBOGetNodeDataSize(Sender: TBaseVirtualTree; var NodeDataSize:
Integer);
procedure TreeDBOGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column:
TColumnIndex; TextType: TVSTTextType; var CellText: WideString);
procedure TreeDBOInitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode; var
ChildCount: Cardinal);
procedure TreeDBOInitNode(Sender: TBaseVirtualTree; ParentNode, Node:
PVirtualNode; var InitialStates: TVirtualNodeInitStates);
private
{ Private declarations }
FDatabases: TStringList;
FColumns: Array of Array of TStringList;
function GetSelectedObject: TStringList;
public
{ Public declarations }
property SelectedObject: TStringList read GetSelectedObject;
end;
function SelectDBO: TStringList;
var
CWin: TMDIChild;
implementation
uses main, helpers;
{$R *.dfm}
function SelectDBO: TStringList;
begin
if Mainform.SelectDBObjectForm = nil then
Mainform.SelectDBObjectForm := TfrmSelectDBObject.Create(Mainform);
Result := nil;
if Mainform.SelectDBObjectForm.ShowModal = mrOK then
Result := Mainform.SelectDBObjectForm.SelectedObject;
end;
procedure TfrmSelectDBObject.FormCreate(Sender: TObject);
begin
Width := Mainform.GetRegValue(REGNAME_SELECTDBO_WINWIDTH, Width);
Height := Mainform.GetRegValue(REGNAME_SELECTDBO_WINHEIGHT, Height);
end;
procedure TfrmSelectDBObject.FormDestroy(Sender: TObject);
var
reg: TRegistry;
begin
reg := TRegistry.Create;
if reg.OpenKey(REGPATH, False) then begin
reg.WriteInteger( REGNAME_SELECTDBO_WINWIDTH, Width );
reg.WriteInteger( REGNAME_SELECTDBO_WINHEIGHT, Height );
reg.CloseKey;
end;
reg.Free;
end;
procedure TfrmSelectDBObject.FormResize(Sender: TObject);
var
EditWidth: Integer;
const
space = 3;
begin
// Calculate width for 1 TEdit
EditWidth := (TreeDBO.Width - 2*space) div 3;
// Set widths
editDb.Width := EditWidth;
editTable.Width := EditWidth;
editCol.Width := EditWidth;
// Set position of TEdits
editDb.Left := TreeDBO.Left;
editTable.Left := TreeDBO.Left + EditWidth + space;
editCol.Left := TreeDBO.Left + 2*(EditWidth + space);
// Set position of TLabels
lblDB.Left := editDB.Left;
lblTable.Left := editTable.Left;
lblCol.Left := editCol.Left;
end;
procedure TfrmSelectDBObject.FormShow(Sender: TObject);
var
i: Integer;
begin
CWin := Mainform.Childwin;
TreeDBO.Clear;
FDatabases := TStringList.Create;
for i := 0 to CWin.DBtree.Items.Count - 1 do begin
if CWin.DBtree.Items[i].Level <> 1 then
continue;
FDatabases.Add(CWin.DBtree.Items[i].Text);
end;
TreeDBO.RootNodeCount := FDatabases.Count;
SetLength(FColumns, FDatabases.Count);
// TreeDBO.OnFocusChanged(TreeDBO, TreeDBO.FocusedNode, 0);
editDB.Clear;
editTable.Clear;
editCol.Clear;
editChange(Sender);
end;
function TfrmSelectDBObject.GetSelectedObject: TStringList;
begin
Result := nil;
if editDb.Text <> '' then begin
Result := TStringList.Create;
Result.Add(editDb.Text);
if editTable.Text <> '' then Result.Add(editTable.Text);
if editCol.Text <> '' then Result.Add(editCol.Text);
end;
// Let the result be nil to indicate we have no selected node
end;
procedure TfrmSelectDBObject.TreeDBOFocusChanged(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex);
var
s: TStringList;
begin
editDB.Clear;
editTable.Clear;
editCol.Clear;
if Assigned(TreeDBO.FocusedNode) then begin
s := TStringList.Create;
s.Delimiter := '.';
s.DelimitedText := TreeDBO.Path(TreeDBO.FocusedNode, -1, ttStatic, '.');
// Tree.Path is buggy, has mostly one superflous empty item at the end. Cut that.
while s.Count > 3 do
s.Delete(s.Count-1);
if s.Count >= 1 then editDB.Text := s[0];
if s.Count >= 2 then editTable.Text := s[1];
if s.Count >= 3 then editCol.Text := s[2];
s.Free;
end;
end;
procedure TfrmSelectDBObject.editChange(Sender: TObject);
begin
// DB must be filled
btnOK.Enabled := editDB.Text <> '';
// If col given, check if table is also given
if editCol.Text <> '' then
btnOK.Enabled := editTable.Text <> '';
end;
procedure TfrmSelectDBObject.TreeDBOGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex; var Ghosted:
Boolean; var ImageIndex: Integer);
var
ds: TDataset;
begin
case Sender.GetNodeLevel(Node) of
0: ImageIndex := ICONINDEX_DB;
1: begin
ds := CWin.FetchDbTableList(FDatabases[Node.Parent.Index]);
ds.RecNo := Node.Index+1;
case GetDBObjectType(ds.Fields) of
NODETYPE_BASETABLE: ImageIndex := ICONINDEX_TABLE;
NODETYPE_VIEW: ImageIndex := ICONINDEX_VIEW;
end;
end;
2: ImageIndex := ICONINDEX_FIELD;
end;
end;
procedure TfrmSelectDBObject.TreeDBOGetNodeDataSize(Sender: TBaseVirtualTree;
var NodeDataSize: Integer);
begin
NodeDataSize := 0;
end;
procedure TfrmSelectDBObject.TreeDBOInitChildren(Sender: TBaseVirtualTree;
Node: PVirtualNode; var ChildCount: Cardinal);
var
ds: TDataset;
cols: TStringList;
begin
// Fetch sub nodes
case Sender.GetNodeLevel(Node) of
0: begin // DB expanding
ds := CWin.FetchDbTableList(FDatabases[Node.Index]);
ChildCount := ds.RecordCount;
SetLength(FColumns[Node.Index], ds.RecordCount);
end;
1: begin // Table expanding
ds := CWin.FetchDbTableList(FDatabases[Node.Parent.Index]);
ds.RecNo := Node.Index+1;
cols := CWin.GetCol('SHOW COLUMNS FROM '
+ Mainform.mask(FDatabases[Node.Parent.Index])+'.'
+ Mainform.Mask(ds.Fields[0].AsString));
FColumns[Node.Parent.Index][Node.Index] := cols;
ChildCount := cols.Count;
end;
end;
end;
procedure TfrmSelectDBObject.TreeDBOGetText(Sender: TBaseVirtualTree; Node:
PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText:
WideString);
var
ds: TDataset;
begin
case Sender.GetNodeLevel(Node) of
0: CellText := FDatabases[Node.Index];
1: begin
ds := CWin.FetchDbTableList(FDatabases[Node.Parent.Index]);
ds.RecNo := Node.Index+1;
CellText := ds.Fields[0].AsString;
end;
2: CellText := FColumns[Node.Parent.Parent.Index][Node.Parent.Index][Node.Index];
end;
end;
procedure TfrmSelectDBObject.TreeDBOInitNode(Sender: TBaseVirtualTree;
ParentNode, Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates);
begin
// Ensure plus sign is visible for dbs and tables
if Sender.GetNodeLevel(Node) in [0,1] then
InitialStates := InitialStates + [ivsHasChildren];
end;
end.

View File

@@ -1,13 +1,13 @@
object UserManagerForm: TUserManagerForm
Left = 252
Top = 131
BorderWidth = 5
Caption = 'User-Manager'
ClientHeight = 380
ClientWidth = 533
BorderIcons = [biSystemMenu, biMaximize]
Caption = 'User Manager'
ClientHeight = 446
ClientWidth = 352
Color = clBtnFace
Constraints.MinHeight = 417
Constraints.MinWidth = 551
Constraints.MinHeight = 473
Constraints.MinWidth = 360
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
@@ -17,485 +17,459 @@ object UserManagerForm: TUserManagerForm
Position = poMainFormCenter
OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy
OnResize = FormResize
OnShow = FormShow
DesignSize = (
352
446)
PixelsPerInch = 96
TextHeight = 13
object PageControl1: TPageControl
Left = 0
Top = 0
Width = 533
Height = 343
ActivePage = TabSheetAddUser
Align = alClient
Images = MainForm.PngImageListMain
TabHeight = 22
object lblUser: TLabel
Left = 8
Top = 11
Width = 29
Height = 13
Caption = '&User:'
FocusControl = comboUsers
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
end
object comboUsers: TComboBoxEx
Left = 56
Top = 8
Width = 235
Height = 22
ItemsEx = <>
Style = csExDropDownList
Anchors = [akLeft, akTop, akRight]
ItemHeight = 16
TabOrder = 0
OnChange = PageControl1Change
object TabSheetAddUser: TTabSheet
Caption = 'Add User'
ImageIndex = 21
object Label4: TLabel
Left = 16
Top = 40
OnChange = comboUsersChange
Images = MainForm.PngImageListMain
end
object btnCancel: TButton
Left = 269
Top = 413
Width = 75
Height = 25
Anchors = [akRight, akBottom]
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 1
end
object btnOK: TButton
Left = 187
Top = 413
Width = 75
Height = 25
Anchors = [akRight, akBottom]
Caption = 'OK'
Default = True
ModalResult = 1
TabOrder = 2
OnClick = btnOKClick
end
object comboObjects: TComboBoxEx
Left = 8
Top = 232
Width = 283
Height = 22
ItemsEx = <>
Style = csExDropDownList
Anchors = [akLeft, akTop, akRight]
ItemHeight = 16
TabOrder = 3
OnChange = comboObjectsChange
Images = MainForm.PngImageListMain
end
object boxPrivs: TCheckListBox
Left = 8
Top = 260
Width = 336
Height = 147
OnClickCheck = boxPrivsClickCheck
Anchors = [akLeft, akTop, akRight, akBottom]
Columns = 3
ItemHeight = 13
TabOrder = 4
end
object tlbObjects: TToolBar
Left = 297
Top = 232
Width = 46
Height = 22
Align = alNone
Anchors = [akTop, akRight]
AutoSize = True
Caption = 'tlbObjects'
Images = MainForm.PngImageListMain
ParentShowHint = False
ShowHint = True
TabOrder = 5
object btnAddObject: TToolButton
Left = 0
Top = 0
Hint = 'Add object ...'
ImageIndex = 45
OnClick = btnAddObjectClick
end
object btnDeleteObject: TToolButton
Left = 23
Top = 0
Hint = 'Remove access to object ...'
ImageIndex = 46
OnClick = btnDeleteObjectClick
end
end
object tlbUsers: TToolBar
Left = 297
Top = 8
Width = 46
Height = 22
Align = alNone
Anchors = [akTop, akRight]
AutoSize = True
Caption = 'tlbUsers'
Images = MainForm.PngImageListMain
ParentShowHint = False
ShowHint = True
TabOrder = 6
object btnAddUser: TToolButton
Left = 0
Top = 0
Hint = 'Create user ...'
ImageIndex = 45
OnClick = btnAddUserClick
end
object btnDeleteUser: TToolButton
Left = 23
Top = 0
Hint = 'Delete user ...'
ImageIndex = 46
OnClick = btnDeleteUserClick
end
end
object chkTogglePrivs: TCheckBox
Left = 8
Top = 417
Width = 129
Height = 17
Anchors = [akLeft, akBottom]
Caption = 'Select / Deselect all'
TabOrder = 7
OnClick = chkTogglePrivsClick
end
object PageControlUser: TPageControl
Left = 8
Top = 36
Width = 335
Height = 190
ActivePage = tabSettings
Anchors = [akLeft, akTop, akRight]
TabOrder = 8
object tabSettings: TTabSheet
Caption = 'Settings'
DesignSize = (
327
162)
object lblFromHost: TLabel
Left = 10
Top = 62
Width = 52
Height = 13
Caption = '&Username:'
FocusControl = EditUser
Caption = 'From &host:'
FocusControl = editFromHost
end
object Label5: TLabel
Left = 16
Top = 88
object lblPassword: TLabel
Left = 10
Top = 36
Width = 50
Height = 13
Caption = '&Password:'
FocusControl = EditPassword
FocusControl = editPassword
end
object Label6: TLabel
Left = 16
Top = 64
Width = 53
object lblUsername: TLabel
Left = 10
Top = 10
Width = 55
Height = 13
Caption = 'From &Host:'
FocusControl = EditHost
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
Caption = 'User &name:'
end
object Label7: TLabel
Left = 256
Top = 16
Width = 89
object lblHostHint: TLabel
Left = 100
Top = 84
Width = 164
Height = 13
Caption = 'Allow a&ccess to:'
FocusControl = DBUserTree
Caption = '(Host: % and _ wildcards allowed)'
end
object lblWarning: TLabel
Left = 10
Top = 136
Width = 314
Height = 23
Anchors = [akLeft, akTop, akRight]
AutoSize = False
Caption = 'Security warning'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Color = clRed
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
WordWrap = True
end
object Label8: TLabel
Left = 16
Top = 128
Width = 58
object editPassword: TEdit
Left = 100
Top = 33
Width = 220
Height = 21
Anchors = [akLeft, akTop, akRight]
TabOrder = 1
Text = 'editPassword'
OnChange = editPasswordChange
OnEnter = editPasswordEnter
OnExit = editPasswordExit
end
object editFromHost: TEdit
Left = 100
Top = 59
Width = 220
Height = 21
Anchors = [akLeft, akTop, akRight]
TabOrder = 2
Text = 'editFromHost'
OnChange = editFromHostChange
end
object chkDisabled: TCheckBox
Left = 10
Top = 105
Width = 103
Height = 17
Alignment = taLeftJustify
Caption = '&Disable account:'
TabOrder = 3
OnClick = chkDisabledClick
end
object editUsername: TEdit
Left = 100
Top = 7
Width = 220
Height = 21
Anchors = [akLeft, akTop, akRight]
TabOrder = 0
Text = 'editUsername'
OnChange = editUsernameChange
end
end
object tabLimitations: TTabSheet
Caption = 'Limitations'
ImageIndex = 1
DesignSize = (
327
162)
object lblMaxQuestions: TLabel
Left = 10
Top = 10
Width = 182
Height = 13
Caption = 'Privileges:'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
Caption = 'Maximum number of &queries per hour:'
FocusControl = editMaxQuestions
end
object Label9: TLabel
Left = 16
Top = 16
Width = 67
object lblMaxUpdates: TLabel
Left = 10
Top = 34
Width = 186
Height = 13
Caption = 'Credentials:'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
Caption = 'Maximum number of &updates per hour:'
FocusControl = editMaxUpdates
end
object Bevel1: TBevel
Left = 16
Top = 120
Width = 209
Height = 9
Shape = bsTopLine
object lblMaxConnections: TLabel
Left = 10
Top = 58
Width = 204
Height = 13
Caption = 'Maximum number of &connections per hour:'
FocusControl = editMaxConnections
end
object Label1: TLabel
Left = 274
Top = 272
object lblMaxUserConnections: TLabel
Left = 10
Top = 82
Width = 225
Height = 13
Caption = 'Maximum number of &simultaneous connections:'
FocusControl = editMaxUserConnections
end
object lblLimitHint: TLabel
Left = 184
Top = 138
Width = 133
Height = 13
Caption = '(Use 0 to indicate unlimited)'
end
object editMaxUserConnections: TEdit
Left = 240
Top = 79
Width = 64
Height = 21
Anchors = [akTop, akRight]
TabOrder = 6
Text = '0'
end
object editMaxConnections: TEdit
Left = 240
Top = 55
Width = 64
Height = 21
Anchors = [akTop, akRight]
TabOrder = 4
Text = '0'
end
object editMaxUpdates: TEdit
Left = 240
Top = 31
Width = 64
Height = 21
Anchors = [akTop, akRight]
TabOrder = 2
Text = '0'
end
object editMaxQuestions: TEdit
Left = 240
Top = 7
Width = 64
Height = 21
Anchors = [akTop, akRight]
TabOrder = 0
Text = '0'
end
object udMaxQuestions: TUpDown
Left = 304
Top = 7
Width = 16
Height = 21
Anchors = [akTop, akRight]
Associate = editMaxQuestions
Max = 32767
TabOrder = 1
Wrap = True
end
object udMaxUpdates: TUpDown
Left = 304
Top = 31
Width = 16
Height = 21
Anchors = [akTop, akRight]
Associate = editMaxUpdates
Max = 32767
TabOrder = 3
Wrap = True
end
object udMaxConnections: TUpDown
Left = 304
Top = 55
Width = 16
Height = 21
Anchors = [akTop, akRight]
Associate = editMaxConnections
Max = 32767
TabOrder = 5
Wrap = True
end
object udMaxUserConnections: TUpDown
Left = 304
Top = 79
Width = 16
Height = 21
Anchors = [akTop, akRight]
Associate = editMaxUserConnections
Max = 32767
TabOrder = 7
Wrap = True
end
end
object tabUserInfo: TTabSheet
Caption = 'User info'
ImageIndex = 2
TabVisible = False
DesignSize = (
327
162)
object lblFullName: TLabel
Left = 10
Top = 10
Width = 49
Height = 13
Caption = '&Full name:'
end
object lblDescription: TLabel
Left = 10
Top = 36
Width = 57
Height = 13
Caption = '&Description:'
Enabled = False
FocusControl = EditDescription
end
object DBUserTree: TTreeView
Left = 256
Top = 40
Width = 257
Height = 193
Images = MainForm.PngImageListMain
Indent = 19
ReadOnly = True
RowSelect = True
ShowLines = False
ShowRoot = False
TabOrder = 3
OnExpanding = DBUserTreeExpanding
object lblEmail: TLabel
Left = 10
Top = 62
Width = 28
Height = 13
Caption = '&Email:'
end
object EditUser: TEdit
Left = 96
Top = 40
Width = 129
Height = 21
TabOrder = 0
end
object EditPassword: TEdit
Left = 96
object lblContactInfo: TLabel
Left = 10
Top = 88
Width = 129
Width = 63
Height = 13
Caption = '&Contact info:'
end
object editFullName: TEdit
Left = 100
Top = 7
Width = 220
Height = 21
PasswordChar = '*'
TabOrder = 2
end
object EditHost: TEdit
Left = 96
Top = 64
Width = 129
Height = 21
TabOrder = 1
Text = '%'
end
object CheckListBoxPrivileges: TCheckListBox
Left = 96
Top = 152
Width = 129
Height = 113
ItemHeight = 13
Items.Strings = (
'Select'
'Insert'
'Update'
'...')
TabOrder = 5
end
object CheckBoxAllPrivileges: TCheckBox
Left = 96
Top = 128
Width = 105
Height = 17
Caption = '&All Privileges'
TabOrder = 4
OnClick = CheckBoxAllPrivilegesClick
end
object CheckBoxWithGrant: TCheckBox
Left = 96
Top = 272
Width = 105
Height = 17
Caption = '&With Grant Option'
TabOrder = 6
end
object CheckBoxCreateAccount: TCheckBox
Left = 256
Top = 248
Width = 249
Height = 17
Caption = 'Create Connection-Account for appname'
TabOrder = 7
OnClick = CheckBoxCreateAccountClick
end
object EditDescription: TEdit
Left = 336
Top = 270
Width = 177
Height = 21
Enabled = False
TabOrder = 8
end
end
object TabSheetEditUsers: TTabSheet
Caption = 'Edit Users'
ImageIndex = 12
object Panel1: TPanel
Left = 280
Top = 0
Width = 245
Height = 311
Align = alRight
Anchors = [akLeft, akTop, akRight, akBottom]
BevelOuter = bvNone
Anchors = [akLeft, akTop, akRight]
MaxLength = 60
TabOrder = 0
DesignSize = (
245
311)
object Label13: TLabel
Left = 14
Top = 82
Width = 39
Height = 13
Caption = 'Column:'
Visible = False
end
object LabelColumn: TLabel
Left = 84
Top = 82
Width = 60
Height = 13
Caption = 'LabelColumn'
Visible = False
end
object LabelTable: TLabel
Left = 84
Top = 66
Width = 51
Height = 13
Caption = 'LabelTable'
Visible = False
end
object LabelDB: TLabel
Left = 84
Top = 50
Width = 38
Height = 13
Caption = 'LabelDB'
Visible = False
end
object Label12: TLabel
Left = 14
Top = 66
Width = 30
Height = 13
Caption = 'Table:'
Visible = False
end
object Label11: TLabel
Left = 14
Top = 50
Width = 50
Height = 13
Caption = 'Database:'
Visible = False
end
object LabelPrivileges: TLabel
Left = 14
Top = 8
Width = 58
Height = 13
Caption = 'Privileges:'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
Visible = False
WordWrap = True
end
object LabelPleaseSelect: TLabel
Left = 40
Top = 96
Width = 136
Height = 39
Caption =
'Please select a user or doubleclick on a user to access items be' +
'low him.'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
WordWrap = True
end
object LabelNoPrivs: TLabel
Left = 24
Top = 120
Width = 200
Height = 13
Caption = 'No Privileges are set for the selected item'
Visible = False
end
object LabelUser: TLabel
Left = 14
Top = 32
Width = 3
Height = 13
end
object CheckListBoxPrivs: TCheckListBox
Left = 14
Top = 106
Width = 107
Height = 193
OnClickCheck = CheckListBoxPrivsClickCheck
Anchors = [akLeft, akTop, akRight, akBottom]
ItemHeight = 13
Items.Strings = (
'Select'
'Insert'
'Update'
'Delete'
'Create'
'Drop'
'Reload'
'Shutdown'
'Process'
'File'
'Grant'
'References'
'Index'
'Alter')
TabOrder = 0
Visible = False
end
object ButtonSelectAll: TButton
Left = 136
Top = 172
Width = 100
Height = 25
Anchors = [akRight, akBottom]
Caption = 'Select all'
TabOrder = 1
Visible = False
OnClick = ButtonSelectAllClick
end
object ButtonSelectNone: TButton
Left = 136
Top = 204
Width = 100
Height = 25
Anchors = [akRight, akBottom]
Caption = 'Select none'
TabOrder = 2
Visible = False
OnClick = ButtonSelectNoneClick
end
object ButtonSet: TButton
Left = 136
Top = 244
Width = 100
Height = 25
Anchors = [akRight, akBottom]
Caption = 'Grant Privileges'
Enabled = False
TabOrder = 3
Visible = False
OnClick = ButtonSetClick
end
object ButtonSelectPrivileges: TButton
Left = 72
Top = 136
Width = 113
Height = 25
Caption = 'Specify Privileges'
TabOrder = 4
OnClick = ButtonSelectPrivilegesClick
end
object ButtonRevoke: TButton
Left = 136
Top = 274
Width = 100
Height = 25
Anchors = [akRight, akBottom]
Caption = 'Revoke Privileges'
TabOrder = 5
OnClick = ButtonRevokeClick
end
Text = 'editFullName'
end
object Panel2: TPanel
Left = 0
Top = 0
Width = 280
Height = 311
Align = alClient
BevelOuter = bvNone
BorderWidth = 5
Caption = 'Panel2'
object editDescription: TEdit
Left = 100
Top = 33
Width = 220
Height = 21
Anchors = [akLeft, akTop, akRight]
MaxLength = 255
TabOrder = 1
object Label2: TLabel
Left = 5
Top = 5
Width = 270
Height = 13
Align = alTop
Caption = 'Registered users:'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsBold]
ParentFont = False
end
object TreeViewUsers: TTreeView
Left = 5
Top = 18
Width = 270
Height = 253
Align = alClient
Anchors = [akLeft, akTop, akBottom]
ChangeDelay = 50
HotTrack = True
Images = MainForm.PngImageListMain
Indent = 19
ReadOnly = True
TabOrder = 0
OnChange = TreeViewUsersChange
OnDblClick = TreeViewUsersDblClick
end
object Panel4: TPanel
Left = 5
Top = 271
Width = 270
Height = 35
Align = alBottom
BevelOuter = bvNone
TabOrder = 1
object ButtonEditUser: TButton
Left = 0
Top = 8
Width = 105
Height = 25
Caption = 'Edit User...'
Enabled = False
TabOrder = 0
OnClick = ButtonEditUserClick
end
object Button1: TButton
Left = 112
Top = 8
Width = 105
Height = 25
Caption = 'Refresh'
TabOrder = 1
OnClick = Button1Click
end
end
Text = 'editDescription'
end
object editEmail: TEdit
Left = 100
Top = 59
Width = 220
Height = 21
Anchors = [akLeft, akTop, akRight]
MaxLength = 80
TabOrder = 2
Text = 'editEmail'
end
object memoContactInfo: TMemo
Left = 100
Top = 86
Width = 220
Height = 67
Anchors = [akLeft, akTop, akRight]
Lines.Strings = (
'memoContactInfo')
MaxLength = 65535
ScrollBars = ssVertical
TabOrder = 3
end
end
end
object Panel3: TPanel
Left = 0
Top = 343
Width = 533
Height = 37
Align = alBottom
BevelOuter = bvNone
TabOrder = 1
DesignSize = (
533
37)
object ButtonClose: TButton
Left = 456
Top = 8
Width = 75
Height = 25
Anchors = [akTop, akRight]
Cancel = True
Caption = 'Close'
ModalResult = 2
TabOrder = 0
end
object ButtonAddUser: TButton
Left = 368
Top = 8
Width = 75
Height = 25
Anchors = [akTop, akRight]
Caption = 'Add User'
Default = True
TabOrder = 1
OnClick = ButtonAddUserClick
end
end
end

View File

File diff suppressed because it is too large Load Diff