]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1339 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 24 Jan 2008 17:11:48 +0000 (17:11 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 24 Jan 2008 17:11:48 +0000 (17:11 +0000)
ChangeLog
SoObjects/SOGo/SOGoUser.m

index 2c004999f096b4d8fbff88e7050a320d8988eaf2..08e209834b60e4c4b94721fc8140ac2e48fb514d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 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.
index fe0aa2a6aedbea247e190bba8076fd9a53c9e154..b0f1c6b71b38a59b2a717a2cd934e828dba692fe 100644 (file)
@@ -133,8 +133,11 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
   if (!user)
     {
       user = [[self alloc] initWithLogin: newLogin roles: newRoles];
-      [user autorelease];
-      [cache registerUser: user];
+      if (user)
+       {
+         [user autorelease];
+         [cache registerUser: user];
+       }
     }
   [user setPrimaryRoles: newRoles];
 
@@ -173,7 +176,13 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
       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;
 }