From dfe9c477aac50a859e283e0eb6316682458e3e39 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 18 Nov 2015 00:14:52 +0100 Subject: * Remove restriction on 16 chars for username in User Manager (#1886) * Change user manager code so that mysql queries are executed on validation instead of after save (in Core Data, not mysql). This should in general make more sense since a failure in MySQL essentialy means that Core Data can't save it either (but did anyway in the past). * Remove a deprecated method call that is no longer needed in 10.6+ --- Source/SPUserManagerDelegate.m | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Source/SPUserManagerDelegate.m') diff --git a/Source/SPUserManagerDelegate.m b/Source/SPUserManagerDelegate.m index ac9e0675..cefe7f2e 100644 --- a/Source/SPUserManagerDelegate.m +++ b/Source/SPUserManagerDelegate.m @@ -65,7 +65,7 @@ static NSString *SPSchemaPrivilegesTabIdentifier = @"Schema Privileges"; [self _initializeAvailablePrivs]; if ([[treeController selectedObjects] count] > 0 && [[schemasTableView selectedRowIndexes] count] > 0) { - NSManagedObject *user = [[treeController selectedObjects] objectAtIndex:0]; + SPUserMO *user = [[treeController selectedObjects] objectAtIndex:0]; // Check to see if the user host node was selected if ([user valueForKey:@"host"]) { @@ -127,7 +127,7 @@ static NSString *SPSchemaPrivilegesTabIdentifier = @"Schema Privileges"; // If the schema has permissions set, highlight with a yellow background BOOL enabledPermissions = NO; - NSManagedObject *user = [[treeController selectedObjects] objectAtIndex:0]; + SPUserMO *user = [[treeController selectedObjects] objectAtIndex:0]; NSArray *results = [self _fetchPrivsWithUser:[[user parent] valueForKey:@"user"] schema:[schemaName stringByReplacingOccurrencesOfString:@"_" withString:@"\\_"] host:[user valueForKey:@"host"]]; @@ -233,9 +233,8 @@ static NSString *SPSchemaPrivilegesTabIdentifier = @"Schema Privileges"; if ([cell isKindOfClass:[ImageAndTextCell class]]) { // Determines which Image to display depending on parent or child object - NSImage *image = [[NSImage imageNamed:[(NSManagedObject *)[item representedObject] parent] ? NSImageNameNetwork : NSImageNameUser] retain]; + NSImage *image = [[NSImage imageNamed:[(SPUserMO *)[item representedObject] parent] ? NSImageNameNetwork : NSImageNameUser] retain]; - [image setScalesWhenResized:YES]; [image setSize:(NSSize){16, 16}]; [(ImageAndTextCell *)cell setImage:image]; [image release]; -- cgit v1.2.3