aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m15
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 2120a85d..92f83a79 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -669,7 +669,7 @@
[tableDataInstance setConnection:mySQLConnection];
[extendedTableInfoInstance setConnection:mySQLConnection];
[databaseDataInstance setConnection:mySQLConnection];
- userManagerInstance.mySqlConnection = mySQLConnection;
+// userManagerInstance.mySqlConnection = mySQLConnection;
// Set the cutom query editor's MySQL version
[customQueryInstance setMySQLversion:mySQLVersion];
@@ -2327,6 +2327,12 @@
*/
- (IBAction)showUserManager:(id)sender
{
+ if (!userManagerInstance)
+ {
+ userManagerInstance = [[SPUserManager alloc] init];
+ userManagerInstance.mySqlConnection = mySQLConnection;
+ }
+
// Before displaying the user manager make sure the current user has access to the mysql.user table.
MCPResult *result = [mySQLConnection queryString:@"SELECT * FROM `mysql`.`user` ORDER BY `user`"];
@@ -2347,11 +2353,16 @@
[NSApp beginSheet:[userManagerInstance window]
modalForWindow:parentWindow
- modalDelegate:userManagerInstance
+ modalDelegate:self
didEndSelector:@selector(userManagerSheetDidEnd:returnCode:contextInfo:)
contextInfo:nil];
}
+- (void)userManagerSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void*)context
+{
+ [userManagerInstance release], userManagerInstance = nil;
+}
+
/**
* Passes query to tablesListInstance
*/