From 8f3a90128f5f16ddddf58dbc098bb3136e661455 Mon Sep 17 00:00:00 2001 From: mltownsend Date: Mon, 24 May 2010 23:49:58 +0000 Subject: More tweaks in regards to issue#699 --- Interfaces/English.lproj/UserManagerView.xib | 52 +++++++++++++++++++--------- Source/SPUserManager.m | 20 +++++++---- 2 files changed, 48 insertions(+), 24 deletions(-) diff --git a/Interfaces/English.lproj/UserManagerView.xib b/Interfaces/English.lproj/UserManagerView.xib index 32840b71..a7619996 100644 --- a/Interfaces/English.lproj/UserManagerView.xib +++ b/Interfaces/English.lproj/UserManagerView.xib @@ -3688,22 +3688,6 @@ 792 - - - contentArray: grantedSchemaPrivs - - - - - - contentArray: grantedSchemaPrivs - contentArray - grantedSchemaPrivs - 2 - - - 800 - value: arrangedObjects.Database @@ -4080,6 +4064,26 @@ 928 + + + contentArray: grantedSchemaPrivs + + + + + + contentArray: grantedSchemaPrivs + contentArray + grantedSchemaPrivs + + NSDeletesObjectsOnRemove + + + 2 + + + 929 + @@ -5675,7 +5679,7 @@ - 928 + 929 @@ -6342,6 +6346,20 @@ Growl.framework/Headers/GrowlApplicationBridge.h + + NSObject + + IBFrameworkSource + PSMTabBar.framework/Headers/PSMTabBarCell.h + + + + NSObject + + IBFrameworkSource + PSMTabBar.framework/Headers/PSMTabBarControl.h + + NSObject diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index 4e27b407..48446d22 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -357,7 +357,10 @@ key = [privColumnToGrantMap objectForKey:key]; } [dbPriv setValue:[NSNumber numberWithBool:boolValue] forKey:key]; - } else if (![key isEqualToString:@"Host"] && ![key isEqualToString:@"User"]) { + } else if ([key isEqualToString:@"Db"]) { + [dbPriv setValue:[[rowDict objectForKey:key] stringByReplacingOccurrencesOfString:@"\\_" withString:@"_"] + forKey:key]; + } else if (![key isEqualToString:@"Host"] && ![key isEqualToString:@"User"]) { [dbPriv setValue:[rowDict objectForKey:key] forKey:key]; } } @@ -760,7 +763,8 @@ } [self.managedObjectContext reset]; - [grantedSchemaPrivs removeAllObjects]; + [grantedSchemaPrivs removeAllObjects]; + //[grantedController fetch:nil]; [grantedTableView reloadData]; [self _initializeAvailablePrivs]; [treeController fetch:nil]; @@ -773,8 +777,8 @@ NSArray *userArray = [self.managedObjectContext executeFetchRequest:request error:nil]; for (NSManagedObject *user in userArray) { if (![user parent]) { - [user setValue:[user valueForKey:@"user"] forKey:@"originaluser"]; - [user setValue:[user valueForKey:@"password"] forKey:@"originalpassword"]; + [user setPrimitiveValue:[user valueForKey:@"user"] forKey:@"originaluser"]; + [user setPrimitiveValue:[user valueForKey:@"password"] forKey:@"originalpassword"]; } } } @@ -786,11 +790,12 @@ NSManagedObject *selectedHost = [[treeController selectedObjects] objectAtIndex:0]; NSString *selectedDb = [[[schemaController selectedObjects] objectAtIndex:0] valueForKey:@"Database"]; NSArray *selectedPrivs = [self _fetchPrivsWithUser:[selectedHost valueForKeyPath:@"parent.user"] - schema:selectedDb + schema:[selectedDb stringByReplacingOccurrencesOfString:@"_" withString:@"\\_"] host:[selectedHost valueForKey:@"host"]]; NSManagedObject *priv = nil; BOOL isNew = FALSE; + if ([selectedPrivs count] > 0) { priv = [selectedPrivs objectAtIndex:0]; @@ -1377,8 +1382,9 @@ // Check to see if the user host node was selected if ([user valueForKey:@"host"]) { NSString *selectedSchema = [[[schemaController selectedObjects] objectAtIndex:0] valueForKey:@"Database"]; - selectedSchema = [selectedSchema stringByReplacingOccurrencesOfString:@"_" withString:@"\\\\_"]; - NSArray *results = [self _fetchPrivsWithUser:[[user parent] valueForKey:@"user"] schema:selectedSchema host:[user valueForKey:@"host"]]; + NSArray *results = [self _fetchPrivsWithUser:[[user parent] valueForKey:@"user"] + schema:[selectedSchema stringByReplacingOccurrencesOfString:@"_" withString:@"\\_"] + host:[user valueForKey:@"host"]]; if ([results count] > 0) { NSManagedObject *priv = [results objectAtIndex:0]; -- cgit v1.2.3