Avoid uid+attributes entries on shared cache

In multidomain environments this will produce that info@domain1.com
can read info@domain2.com emails when info@domain2.com log in after
info@domain1.com is already logged in.

If multidomain is not enabled, this action is not needed because
uid+attributes has been already saved on shared cache
pull/85/head
Jesús García Sáez 2015-05-20 11:44:06 +02:00
parent 79bfc7aedf
commit 9922ec56d9
1 changed files with 10 additions and 14 deletions

View File

@ -806,24 +806,20 @@ static Class NSNullK;
withLogin: (NSString *) login
{
NSEnumerator *emails;
NSString *key;
[[SOGoCache sharedCache]
setUserAttributes: [newUser jsonRepresentation]
forLogin: login];
NSString *key, *user_json;
user_json = [newUser jsonRepresentation];
[[SOGoCache sharedCache] setUserAttributes: user_json
forLogin: login];
if (![newUser isKindOfClass: NSNullK])
{
key = [newUser objectForKey: @"c_uid"];
if (key && ![key isEqualToString: login])
[[SOGoCache sharedCache]
setUserAttributes: [newUser jsonRepresentation]
forLogin: key];
emails = [[newUser objectForKey: @"emails"] objectEnumerator];
while ((key = [emails nextObject]))
[[SOGoCache sharedCache]
setUserAttributes: [newUser jsonRepresentation]
forLogin: key];
{
if (![key isEqualToString: login])
[[SOGoCache sharedCache] setUserAttributes: user_json
forLogin: key];
}
}
}