aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPUserManager.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-11-10 00:30:28 +0000
committerrowanbeentje <rowan@beent.je>2010-11-10 00:30:28 +0000
commitf7ed9b4c096138e883181be99e4dae6886578c11 (patch)
tree06629848363ebb1fe6006f1785e5dff40ca83f46 /Source/SPUserManager.m
parent7e34cf68b09d6b95bfa29e1233b44370adfd18b3 (diff)
downloadsequelpro-f7ed9b4c096138e883181be99e4dae6886578c11.tar.gz
sequelpro-f7ed9b4c096138e883181be99e4dae6886578c11.tar.bz2
sequelpro-f7ed9b4c096138e883181be99e4dae6886578c11.zip
- Alter connection details to be sent over UTF8 instead of Latin1 - this improves handling of special characters in passwords, improving Issue #890
- Improve code in (the unused) [MCPConnection connectWithLogin:password:host:socket:] to match latest updates in the rest of the framework - Fix creation of new users
Diffstat (limited to 'Source/SPUserManager.m')
-rw-r--r--Source/SPUserManager.m6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m
index d8851c3c..c545c6a8 100644
--- a/Source/SPUserManager.m
+++ b/Source/SPUserManager.m
@@ -1090,10 +1090,10 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
NSString *username = [[[user parent] valueForKey:@"user"] tickQuotedString];
NSString *password = [[[user parent] valueForKey:@"password"] tickQuotedString];
-
+
createStatement = ([serverSupport supportsCreateUser]) ?
- [NSString stringWithFormat:@"CREATE USER %@@%@ IDENTIFIED BY PASSWORD %@", username, host, password] :
- [NSString stringWithFormat:@"GRANT SELECT ON mysql.* TO %@@%@ IDENTIFIED BY PASSWORD %@", username, host, password];
+ [NSString stringWithFormat:@"CREATE USER %@@%@ IDENTIFIED BY %@%@", username, host, [[user parent] valueForKey:@"originaluser"]?@"PASSWORD ":@"", password] :
+ [NSString stringWithFormat:@"GRANT SELECT ON mysql.* TO %@@%@ IDENTIFIED BY %@%@", username, host, [[user parent] valueForKey:@"originaluser"]?@"PASSWORD ":@"", password];
}
else if ([user parent] && [[user parent] valueForKey:@"user"]) {