See ChangeLog
Monotone-Parent: 7a464f08b5ba1b713a0beec23ddfa576c9023439 Monotone-Revision: 22735bbc1319155936115d59c7f2699c32dc60f1 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-08-02T13:18:09 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
8f625f6292
commit
9be1c93f84
|
@ -1,3 +1,9 @@
|
|||
2012-08-02 Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreUserContext.m (-_readUserPassword:)
|
||||
We now read per-user passwords instead of relying on
|
||||
a global file.
|
||||
|
||||
2012-07-31 Jean Raby <jraby@inverse.ca>
|
||||
|
||||
* sogo.spec:
|
||||
|
|
|
@ -99,25 +99,21 @@ static NSMapTable *contextsTable = nil;
|
|||
|
||||
- (NSString *) _readUserPassword: (NSString *) newUsername
|
||||
{
|
||||
NSString *password;
|
||||
NSString *password, *path;
|
||||
NSData *content;
|
||||
id plist;
|
||||
NSPropertyListFormat plistFormat;
|
||||
NSString *error;
|
||||
|
||||
password = nil;
|
||||
|
||||
content = [NSData dataWithContentsOfFile: SAMBA_PRIVATE_DIR
|
||||
@"/mapistore/SOGo/userpwds.plist"];
|
||||
path = [NSString stringWithFormat: SAMBA_PRIVATE_DIR
|
||||
@"/mapistore/%@/password", newUsername];
|
||||
|
||||
content = [NSData dataWithContentsOfFile: path];
|
||||
|
||||
if (content)
|
||||
{
|
||||
plist = [NSPropertyListSerialization
|
||||
propertyListFromData: content
|
||||
mutabilityOption: NSPropertyListImmutable
|
||||
format: &plistFormat
|
||||
errorDescription: &error];
|
||||
if ([plist respondsToSelector: @selector (objectForKey:)])
|
||||
password = [plist objectForKey: newUsername];
|
||||
password = [[NSString alloc] initWithData: content
|
||||
encoding: NSUTF8StringEncoding];
|
||||
[password autorelease];
|
||||
}
|
||||
|
||||
return password;
|
||||
|
|
Loading…
Reference in a new issue