Merge branch '2013.10' into 2014.11
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 16 Jul 2015 08:59:43 +0000 (10:59 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 16 Jul 2015 08:59:43 +0000 (10:59 +0200)
1  2 
tine20/Tinebase/Group/Ldap.php

@@@ -625,6 -625,11 +625,11 @@@ class Tinebase_Group_Ldap extends Tineb
          
          $this->getLdap()->update($dn, $ldapData);
          
+         if ($metaData['cn'] != $ldapData['cn']) {
+             $newDn = "cn={$ldapData['cn']},{$this->_options['groupsDn']}";
+             $this->_ldap->rename($dn, $newDn);
+         }
+         
          $group = $this->getGroupByIdFromSyncBackend($_group);
  
          return $group;
          }
          
          foreach ($groupIds as $groupId) {
 -            $dn = $this->_getDn($groupId);
 +            try {
 +                $dn = $this->_getDn($groupId);
 +            } catch (Tinebase_Exception_NotFound $tenf) {
 +                // group does not exist in LDAP backend any more
 +                if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__
 +                    . ' Did not found group with id ' . $groupId . ' in LDAP. Delete skipped!');
 +                continue;
 +            }
 +            
              if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
                  . ' Deleting group ' . $dn . ' from LDAP');
              $this->getLdap()->delete($dn);
       */
      protected function _getAccountMetaData($_accountId)
      {
 -        return array_value(0, $this->_getAccountsMetaData(array($_accountId)));
 +        return Tinebase_Helper::array_value(0, $this->_getAccountsMetaData(array($_accountId)));
      }
      
      /**