2008-01-24 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ * SoObjects/SOGo/SOGoUser.m ([SOGoUser
+ +userWithLogin:newLoginroles:newRoles]): test if the user is well
+ initialized before registering it with the SOGo cache.
+ ([SOGoUser -initWithLogin:newLoginroles:newRoles]): returns a user
+ only if the realUID has been found, otherwise we dealloc self and
+ return nil.
+
* SoObjects/Appointments/SOGoAppointmentFolder.m: if c_cycleinfo
is an NSNull instance, we consider it to be empty and return
automatically with an error message in the log.
if (!user)
{
user = [[self alloc] initWithLogin: newLogin roles: newRoles];
- [user autorelease];
- [cache registerUser: user];
+ if (user)
+ {
+ [user autorelease];
+ [cache registerUser: user];
+ }
}
[user setPrimaryRoles: newRoles];
realUID = [[um contactInfosForUserWithUIDorEmail: newLogin]
objectForKey: @"c_uid"];
}
- self = [super initWithLogin: realUID roles: newRoles];
+ if (realUID)
+ self = [super initWithLogin: realUID roles: newRoles];
+ else
+ {
+ [self release];
+ self = nil;
+ }
return self;
}