diff options
author | rowanbeentje <rowan@beent.je> | 2009-08-15 00:03:51 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-08-15 00:03:51 +0000 |
commit | 5e14414cb9c7123ba2131ceba0a7833568b98c1c (patch) | |
tree | b682a1de7fd3fc112a8f738e353b304ecaba4988 /Source | |
parent | 44548eed4c7e103ced2c9e87bd056fe59fedf617 (diff) | |
download | sequelpro-5e14414cb9c7123ba2131ceba0a7833568b98c1c.tar.gz sequelpro-5e14414cb9c7123ba2131ceba0a7833568b98c1c.tar.bz2 sequelpro-5e14414cb9c7123ba2131ceba0a7833568b98c1c.zip |
User manager tweaks:
- Don't select the mysql database - make selections directly from the table where appropriate
- Tweak REVOKE syntax to use FROM instead of TO
- Rename "create temporary table" permission to "create temporary tables" so it saves correctly
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPUserManager.m | 9 | ||||
-rw-r--r-- | Source/SPUserManager.xcdatamodel/elements | bin | 50142 -> 50105 bytes | |||
-rw-r--r-- | Source/SPUserManager.xcdatamodel/layout | bin | 5707 -> 5719 bytes |
3 files changed, 3 insertions, 6 deletions
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index c77c757b..8b26b001 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -62,7 +62,7 @@ privColumnsMODict = [[[NSDictionary alloc] initWithObjectsAndKeys: @"grant_option_priv",@"Grant_priv", @"show_databases_priv",@"Show_db_priv", - @"create_temporary_table_priv",@"Create_tmp_table_priv", + @"create_temporary_tables_priv",@"Create_tmp_tables_priv", @"Replication_slave_priv",@"Repl_slave_priv", @"Replication_client_priv",@"Repl_client_priv",nil] retain]; @@ -114,8 +114,7 @@ NSMutableArray *resultAsArray = [NSMutableArray array]; NSMutableArray *usersResultArray = [NSMutableArray array]; - [[self connection] selectDB:@"mysql"]; - MCPResult *result = [[[self connection] queryString:@"select * from user order by user"] retain]; + MCPResult *result = [[[self connection] queryString:@"SELECT * FROM `mysql`.`user` ORDER BY `user`"] retain]; int rows = [result numOfRows]; if (rows > 0) { @@ -505,7 +504,6 @@ - (BOOL)deleteUsers:(NSArray *)deletedUsers { - [[self connection] selectDB:@"mysql"]; NSMutableString *droppedUsers = [NSMutableString string]; for (NSManagedObject *user in deletedUsers) { @@ -525,7 +523,6 @@ - (BOOL)insertUsers:(NSArray *)insertedUsers { - [[self connection] selectDB:@"mysql"]; for(NSManagedObject *user in insertedUsers) { if ([user parent] != nil) { @@ -587,7 +584,7 @@ // Revoke privileges if ([revokePrivileges count] > 0) { - NSString *revokeStatement = [NSString stringWithFormat:@"REVOKE %@ ON *.* TO %@@%@;", + NSString *revokeStatement = [NSString stringWithFormat:@"REVOKE %@ ON *.* FROM %@@%@;", [revokePrivileges componentsJoinedByCommas], [[[user parent] valueForKey:@"user"] tickQuotedString], [[user valueForKey:@"host"] tickQuotedString]]; diff --git a/Source/SPUserManager.xcdatamodel/elements b/Source/SPUserManager.xcdatamodel/elements Binary files differindex 6766bed3..8bca9833 100644 --- a/Source/SPUserManager.xcdatamodel/elements +++ b/Source/SPUserManager.xcdatamodel/elements diff --git a/Source/SPUserManager.xcdatamodel/layout b/Source/SPUserManager.xcdatamodel/layout Binary files differindex 07b18bfd..5c8f25a4 100644 --- a/Source/SPUserManager.xcdatamodel/layout +++ b/Source/SPUserManager.xcdatamodel/layout |