Commit Graph

141 Commits

Author SHA1 Message Date
Ansgar Becker
e96fa77cbd Do not cache dialog instances any longer. OnCreate code is mostly very quick, and caching them adds quite some pitfalls into the code. Not to mention 30 lines less code in main.pas now :) 2011-06-26 20:01:42 +00:00
Ansgar Becker
2d548b5ef6 Introduce some wrapper functions for message and error dialogs in order to have less code and to avoid hidden titles on Windows XP. Fixes issue #2425. 2011-05-27 04:48:21 +00:00
Ansgar Becker
2c9e2edc9d Create users list after querying mysql.user, so when that query returns an error, a later check for existence of the user list can decide to close the user manager. Fixes issue #2414 2011-05-14 05:36:38 +00:00
Ansgar Becker
0bba145162 Silence error message about invalid password length after changing a users' password. Fixes issue #2346. 2011-04-05 22:38:23 +00:00
Ansgar Becker
4fbf2c23dd Introduce experimental MS SQL support 2011-03-29 23:20:21 +00:00
Ansgar Becker
49a97584e6 Code preparation for non-MySQL connections: Extract abstract stuff into a new TDBConnection class, and let TMySQLConnection derive from that. Same with TDBQuery / TMySQLQuery. See issue #1008. 2011-03-17 23:03:54 +00:00
Ansgar Becker
de2767711d Flush privileges after user has been dropped. 2011-02-14 09:30:47 +00:00
Ansgar Becker
216f097d9c Servers up to 5.0.6 do not support the object type in a GRANT or REVOKE query. See http://www.heidisql.com/forum.php?t=7753 2011-02-09 23:22:48 +00:00
Ansgar Becker
08513f1d88 Improve user manager: Include inactive users in users list and disable these nodes. Just to make clear they exist, and the user should fix them manually. 2011-02-05 07:23:43 +00:00
Ansgar Becker
ca58d88410 Improve password generator on user manager dialog: Create a drop down menu containing groups of passwords in several lengths. Do not automatically copy to clipboard, and leave the password visible as long as the user did not type manually. 2011-02-05 06:37:43 +00:00
Ansgar Becker
95f50b9ca5 Improve user manager: Add drop down menu to "From host" input, containing some predefined hosts plus all unique ones from the users list. 2011-02-03 23:50:01 +00:00
Ansgar Becker
374e79448f New user object does not update its user name and host, so the save button granted privileges to some "Unnamed" user, which was probably named differently by the user. So, update the user object with current input before saving. Fixes issue #2294. 2011-02-03 23:03:40 +00:00
Ansgar Becker
ba9d971e02 Apply added privs which were in org privs, then deleted, and added again. Fixes issue #2284. 2011-01-30 23:44:43 +00:00
Ansgar Becker
6988d82c55 User manager: Split user list into username and host column, and allow sorting by header click. Also, add overlay icons for users with empty passwords, and added privilege objects. 2011-01-30 23:25:28 +00:00
Ansgar Becker
59f6dbb3c4 Initialize child nodes after adding a privilege object to a user, so the parent checkbox checks all rather than only the first few visible child nodes. Regression introduced most probably in r3585. Fixes issue #2283. 2011-01-30 07:02:59 +00:00
Ansgar Becker
6921e6e189 Make detection of disabled users more stable. See http://www.heidisql.com/forum.php?t=7433#p7442 2011-01-03 23:21:17 +00:00
Ansgar Becker
6f95a796e1 Modify identifier quoting logic:
- Move QuoteIdent() and DeQuoteIdent() out of TMySQLConnection, make them classless
- Remove TMainForm.mask(), instead always use QuoteIdent()
- Introduce a third parameter to QuoteIdent(): "AlwaysQuote" - setting this to false will quote only if required
- Set AlwaysQuote to false for all stuff which drops some code into the query editor, see http://www.heidisql.com/forum.php?t=6986
2010-11-24 23:12:13 +00:00
Ansgar Becker
c0ded109b5 User manager form is kept in memory after closing. Later calls need to check the current server version to display the right list of priv names. So, move creation of these lists from Form.OnCreate to Form.OnShow. 2010-11-21 23:21:58 +00:00
Ansgar Becker
a2e20b08f1 Use CREATE USER query for added users, as required since 5.0.2 servers when password is empty. Works around SQL error 1133 (Can't find any matching row in the user table). See http://www.heidisql.com/forum.php?t=6948 2010-11-21 19:21:16 +00:00
Ansgar Becker
7d3446d346 Sort accessible objects by relevance (global > db > table) + alphabetically 2010-11-16 19:40:31 +00:00
Ansgar Becker
c2e984c4b7 Do not try to remove non applied privileges after unchecking priv names. 2010-11-16 19:09:00 +00:00
Ansgar Becker
55452f60cc Forgot to add REFERENCES to list of write privs 2010-11-11 13:16:36 +00:00
Ansgar Becker
d98a0e826d Although the REFERENCES privilege is unused by MySQL, the user manager needs to revoke it, for users which have it assigned in some unwanted privilege object. 2010-11-11 13:05:44 +00:00
Ansgar Becker
b6f7c17ac1 Rewrite code behind user manager dialog:
- Use GRANT + REVOKE queries as recommended by MySQL.
- Fixes various wrong INSERTs/UPDATEs which were intended to normalize structure in mysql db.
- Remove features: max query count per hour/day/...
- Enables user to assign stored routine privileges now, see http://www.heidisql.com/forum.php?t=6684
- Add "Clone user" button, fixes issue #1316
- Add "Repeat password" edit box, fixes issue #1461
- Paint privilege text in different colors for read/write/admin commands.
2010-11-10 21:15:54 +00:00
Ansgar Becker
0fa6c15c9d Implement multiple connections per window. DBtree and friends now have their nodes bound to TDBObject instances. Fixes issue #2144. 2010-10-05 23:06:29 +00:00
Ansgar Becker
0889281c22 Let priv tree track the node's checkstate itself, and initialize all nodes in Tree.OnPaint, so there is no node left out when AutoOptions.toAutoTristateTracking is doing its job. Further, check/uncheck parent priv nodes manually in OnInitNode as this is not done by auto-tracking. Fixes issue #2163 again. 2010-09-17 05:24:44 +00:00
Ansgar Becker
f69e8b31ce User manager: When checking a first level node, do not only auto-check initialized sub nodes, but also the non-initialized ones. Fixes issue #2163. 2010-09-11 11:46:17 +00:00
Ansgar Becker
15d73678c6 Focus previous privilege tree node after deletion. Fixes issue #853. 2010-06-13 14:39:56 +00:00
Ansgar Becker
f1ae13770d Bugfix: After click on password generator button, user was not marked as modified. 2010-05-14 22:37:53 +00:00
Ansgar Becker
b3b1710c35 Introduce EDatabaseError exception class, so we're able to handle only those and let others raise the exception up to MadExcept. Helps finding non-database related AVs as users are able to get the callstack now. Similar to r3292 but more consistent all over the code now. 2010-04-24 13:56:57 +00:00
Ansgar Becker
1ffea39756 Validate user + host name input in OnExit, not OnChange, which is too early when one of them gets reset. Fixes issue #1794. 2010-03-24 17:05:21 +00:00
Ansgar Becker
860390e986 User manager: Add button to generate a random password. Fixes issue #1460. 2010-03-16 23:50:40 +00:00
Ansgar Becker
962c0b3b44 Fix non working right anchors of aligned controls (mainly TEdit) on user manager dialog. 2010-02-21 10:59:19 +00:00
Ansgar Becker
1376a4e5f0 Privilege tree doesn't repaint automatically when calling ReInitNode 2010-02-21 07:14:32 +00:00
Ansgar Becker
812cbc82b6 Apply a new style to the user manager dialog:
* Use 2 VirtualTree's instead of broken TComboBoxEx pulldown's
* Enlarge the user list so all items are visible at once
* Privilege objects now use a tree style, 1st level is the objects name, 2nd level is the privilege name ("select", "update" ...)
Fixes issue #1707
2010-02-20 17:12:54 +00:00
Ansgar Becker
29bd958a9f Work around too few items in TComboBoxEx in higher DPI modes. Fixes issue #1707. 2010-02-19 07:10:01 +00:00
Ansgar Becker
c06dd0d8bf Fix mysterious endless loop in user manager, after having focused the password editor once. Make use of Delphi's new TextHint property to display the old hashed password, instead of assigning and removing OnChange handlers all the time. Fixes issue #1658. 2010-02-06 13:48:39 +00:00
Ansgar Becker
9080ad7607 No need to use the Wide* version of string functions any longer. 2010-01-15 20:28:48 +00:00
Ansgar Becker
52ea8f410a Use Unicode enabled TStringList instead of TWideStringList in all places. Should have no visible effect, apart from a very minor performance optimization, as String reference pointers are handled by Delphi, WideString by Windows. 2010-01-14 19:41:58 +00:00
Ansgar Becker
a4652d39a4 * Fix compiler warnings due to implicit AnsiString to (Unicode)String or vice versa
* Remove workaround for Unicode text to and from clipboard
* Fix writing/reading wrong encoded text into/from registry - no need to use Utf8Encode() any longer
* Implement TMySQLQuery.ColAsAnsi() for cases in which we read binary data.
2010-01-07 00:00:56 +00:00
Ansgar Becker
7d401ffde8 Upgrade to Delphi 2010:
* Removes TNT Unicode controls, which are no longer required. All VCL controls now have native Unicode support.
* Remove Delphi 11 packages, otherwise we would either need to keep TNT or break Unicode
* PngComponents update from Uwe Raabe on http://cc.embarcadero.com/Item/26127
* Adjust auto build process
* Since Delphi 2009, Strings are now UnicodeStrings, not AnsiStrings any longer. Fix a bunch of compiler errors which came along with this change.
TODO: Project should compile but give tons of compiler warnings.
2010-01-05 23:14:33 +00:00
Ansgar Becker
f0f2036925 Avoid loading values from a privilege table with 0 rows. Fixes issue #1540. 2009-12-31 17:35:43 +00:00
Ansgar Becker
e356cb7ed7 Sanitize all "uses" clauses from unneeded unit references. 2009-12-22 23:19:56 +00:00
Ansgar Becker
8d32a1fd0c Raise with a more detailed exception message, to debug issue #1540. 2009-12-22 14:16:54 +00:00
Ansgar Becker
115148fd23 Move a "continue" for deleted privs slightly lower, so these get deleted. Fixes issue #1454 2009-11-29 20:03:11 +00:00
Ansgar Becker
6ebe40c929 Make INSERTs in user manager compatible with pre-4.1 servers by
* removing the ON DUPLICATE KEY clauses
* turning the INSERT into INSERT IGNORE
* and doing an UPDATE afterwards if RowsAffected is 0
Fixes issue #1229
2009-11-24 22:59:21 +00:00
Ansgar Becker
45fa64fe81 Wrap most queries in a try..except block which may fail with a SQL privilege error. So these places do not raise an exception at user level. Exceptions should only raise in unpredictable error situations. Important for reactivating the MadExcept dialog. 2009-11-22 18:07:53 +00:00
Ansgar Becker
12a8e2ebc5 Implement a more lightweight connection layer, consisting of 2 units in source directory. Breaks threading and window to window communication, which should be reimplemented later. 2009-10-28 00:08:49 +00:00
Ansgar Becker
f01893d08a Experimental: Reintroduce table tab, this time by placing the existing editors for tables, views and routines as TFrames onto that tab. Unfortunately a whole bunch of GUI changes involved here which makes the diff unreadable. Should solve issue #1149 . 2009-06-04 12:56:55 +00:00
rosenfield.albert
1d94ad0156 Bugfix: close user manager form when no access to privilege tables.
Forms are not closeable with Close() inside FormShow, you must either return -1 in response to a WM_CREATE message, post a WM_CLOSE (seen that fail too though), or just do the check before showing the form.
2009-03-04 14:43:35 +00:00