104 Commits

Author SHA1 Message Date
1858c04d82 Usermanager: Host may contain uppercase chars, it's just case sensitive, as stated on http://bugs.mysql.com/bug.php?id=19828 . Allow uppercase host names, which may cause errors when selecting such users, but as we have a exit-logic here that does not show AVs to the end user. 2012-04-06 09:03:26 +00:00
75e69ec3ab Detect --skip-name-resolve server option in usermanager, and disable users where that would cause "There is no such grant..." errors when firing "SHOW GRANTS FOR ...". On older servers there is no server variable for that detection, so as a fallback the "SHOW GRANTS FOR ..." errors are try/caught and the user node gets disabled lately. See r4101 and http://www.heidisql.com/forum.php 2012-04-01 09:30:40 +00:00
66f9ead0f0 Avoid AV when trying to focus username edit box in cases where tabCredentials is not the active tab. 2012-03-29 13:59:13 +00:00
269d3a0791 Revert r4101 - instead, do a FLUSH PRIVILEGES when the user manager dialog is opened, to ensure that non-flushed users can be edited. Users with uppercase chars in their host name cannot be edited - disable such nodes with a hint on how to manually fix that. 2012-03-27 23:17:20 +00:00
500472970a User manager: Check grants *before* tree node has focus. Could be a non-flushed user, since we just SELECT them from mysql.user. Catch such "There is no such grant defined for user" errors and disable tree node in that case. See http://www.heidisql.com/forum.php?t=10364 2012-03-24 07:40:26 +00:00
b271ea2670 Find GRANT OPTION also when SSL requirements are set. Fixes issue #2671. 2012-02-05 07:04:41 +00:00
6325d42c4b Fix enabled controls which should be disabled when no SSL option selected. 2012-01-07 09:13:13 +00:00
84d27865e2 Fix mixed up GRANT privilege in user manager, caused by errors and high complexity in regular expression. See issue #2671. Revert modification in SynRegExpr.pas again, now that we have only about 10 parentheses left. 2012-01-06 01:03:12 +00:00
aedbb997ab Support GRANT .. REQUIRE syntax in user manager with a new "SSL options" tab. Fixes issue #2671. 2012-01-05 20:44:49 +00:00
1f75acc999 Fix non-overtaken grants when user clicks "clone user". See http://www.heidisql.com/forum.php?t=8943 2011-07-30 08:20:51 +00:00
48ed802352 Usermanager: Support CREATE TABLESPACE privilege in MySQL 5.4.4 and up. See 5.4 manual for version. And add TODO for different syntax of GRANT PROXY. 2011-07-22 05:02:31 +00:00
d0f7e7f505 Support account resources limits in user manager. Fixes issue #2492. 2011-07-14 19:54:37 +00:00
133b2a265c Refactor code for Host subtabs: Remove TVTreeData structure, use TDBQueryList instead. Use same code for most grid events. 2011-07-03 08:44:20 +00:00
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
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
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
0bba145162 Silence error message about invalid password length after changing a users' password. Fixes issue #2346. 2011-04-05 22:38:23 +00:00
4fbf2c23dd Introduce experimental MS SQL support 2011-03-29 23:20:21 +00:00
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
de2767711d Flush privileges after user has been dropped. 2011-02-14 09:30:47 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
7d3446d346 Sort accessible objects by relevance (global > db > table) + alphabetically 2010-11-16 19:40:31 +00:00
c2e984c4b7 Do not try to remove non applied privileges after unchecking priv names. 2010-11-16 19:09:00 +00:00
55452f60cc Forgot to add REFERENCES to list of write privs 2010-11-11 13:16:36 +00:00
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
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
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
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
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
15d73678c6 Focus previous privilege tree node after deletion. Fixes issue #853. 2010-06-13 14:39:56 +00:00
f1ae13770d Bugfix: After click on password generator button, user was not marked as modified. 2010-05-14 22:37:53 +00:00
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
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
860390e986 User manager: Add button to generate a random password. Fixes issue #1460. 2010-03-16 23:50:40 +00:00
962c0b3b44 Fix non working right anchors of aligned controls (mainly TEdit) on user manager dialog. 2010-02-21 10:59:19 +00:00
1376a4e5f0 Privilege tree doesn't repaint automatically when calling ReInitNode 2010-02-21 07:14:32 +00:00
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
29bd958a9f Work around too few items in TComboBoxEx in higher DPI modes. Fixes issue #1707. 2010-02-19 07:10:01 +00:00
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