#9612: User/Group relationships aren't properly synced from LDAP
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 3 Mar 2014 09:41:51 +0000 (10:41 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 22 Apr 2014 07:57:22 +0000 (09:57 +0200)
- adds a crude fix for the problem,b ut this can (and should) be
improved, as only the user/group/memberships caches should be cleaned

https://forge.tine20.org/mantisbt/view.php?id=9612

Change-Id: Iaf01077f6ea16f60e11880c21f02ca1f51e2cdc9
Reviewed-on: http://gerrit.tine20.com/customers/388
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/User.php

index cffdee9..9e93429 100644 (file)
@@ -561,8 +561,8 @@ class Tinebase_User
         Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ .' start synchronizing users');
         
         $users = Tinebase_User::getInstance()->getUsersFromSyncBackend(NULL, NULL, 'ASC', NULL, NULL, 'Tinebase_Model_FullUser');
-
-        foreach($users as $user) {
+        
+        foreach ($users as $user) {
             try {
                 $user = self::syncUser($user, $options);
             } catch (Tinebase_Exception_NotFound $ten) {
@@ -570,9 +570,11 @@ class Tinebase_User
                     . $ten->getMessage());
             }
         }
-
+        
+        // @todo this should be improved: only the cache of synced users + group memberships should be cleaned
         if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ 
-            . ' finished synchronizing users');
+            . ' Finished synchronizing users. Clearing cache after user sync ...');
+        Tinebase_Core::getCache()->clean();
     }
 
     /**