aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index f8b673ff..8286167a 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -2382,16 +2382,17 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
*/
- (IBAction)showUserManager:(id)sender
{
- if (!userManagerInstance)
- {
- userManagerInstance = [[SPUserManager alloc] init];
+ if (!userManagerInstance)
+ {
+ userManagerInstance = [[SPUserManager alloc] init];
- [userManagerInstance setConnection:mySQLConnection];
+ [userManagerInstance setDatabaseDocument:self];
+ [userManagerInstance setConnection:mySQLConnection];
[userManagerInstance setServerSupport:serverSupport];
- }
-
+ }
+
// Before displaying the user manager make sure the current user has access to the mysql.user table.
- SPMySQLResult *result = [mySQLConnection queryString:@"SELECT * FROM `mysql`.`user` ORDER BY `user`"];
+ SPMySQLResult *result = [mySQLConnection queryString:@"SELECT user FROM mysql.user LIMIT 1"];
if ([mySQLConnection queryErrored] && ([result numberOfRows] == 0)) {
@@ -2417,7 +2418,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
- (void)userManagerSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void*)context
{
- [userManagerInstance release], userManagerInstance = nil;
+ [userManagerInstance release], userManagerInstance = nil;
}
/**