/**
  * the constructor
  *
  * @param  array  $_options  Options used in connecting, binding, etc.
  * @throws Tinebase_Exception_Backend_Ldap
  */
 public function __construct(array $_options = array())
 {
     if (empty($_options['userUUIDAttribute'])) {
         $_options['userUUIDAttribute'] = 'objectGUID';
     }
     if (empty($_options['groupUUIDAttribute'])) {
         $_options['groupUUIDAttribute'] = 'objectGUID';
     }
     if (empty($_options['baseDn'])) {
         $_options['baseDn'] = $_options['userDn'];
     }
     if (empty($_options['userFilter'])) {
         $_options['userFilter'] = 'objectclass=user';
     }
     if (empty($_options['userSearchScope'])) {
         $_options['userSearchScope'] = Zend_Ldap::SEARCH_SCOPE_SUB;
     }
     if (empty($_options['groupFilter'])) {
         $_options['groupFilter'] = 'objectclass=group';
     }
     parent::__construct($_options);
     if ($this->_options['useRfc2307']) {
         $this->_requiredObjectClass[] = 'posixAccount';
         $this->_requiredObjectClass[] = 'shadowAccount';
         $this->_rowNameMapping['accountHomeDirectory'] = 'unixhomedirectory';
         $this->_rowNameMapping['accountLoginShell'] = 'loginshell';
     }
 }
 /**
  * test deleting groupmembers
  *
  */
 public function testRemoveGroupMember()
 {
     $group = $this->testAddGroup();
     $this->objects['initialAccount']->accountPrimaryGroup = $group->getId();
     $user = $this->_userLDAP->addUser($this->objects['initialAccount']);
     $this->objects['users']->addRecord($user);
     $this->_groupLDAP->addGroupMember($group, $user);
     $this->_groupLDAP->removeGroupMember($group, $user);
     $groupMembers = $this->_groupLDAP->getGroupMembers($group);
     $this->assertEquals(0, count($groupMembers));
     $this->_userLDAP->deleteUser($user);
 }
 /**
  * the constructor
  *
  * @param  array  $_options  Options used in connecting, binding, etc.
  * @throws Tinebase_Exception_Backend_Ldap
  */
 public function __construct(array $_options = array())
 {
     if (empty($_options['userUUIDAttribute'])) {
         $_options['userUUIDAttribute'] = 'objectGUID';
     }
     if (empty($_options['groupUUIDAttribute'])) {
         $_options['groupUUIDAttribute'] = 'objectGUID';
     }
     if (empty($_options['baseDn'])) {
         $_options['baseDn'] = $_options['userDn'];
     }
     if (empty($_options['userFilter'])) {
         $_options['userFilter'] = 'objectclass=user';
     }
     if (empty($_options['userSearchScope'])) {
         $_options['userSearchScope'] = Zend_Ldap::SEARCH_SCOPE_SUB;
     }
     if (empty($_options['groupFilter'])) {
         $_options['groupFilter'] = 'objectclass=group';
     }
     parent::__construct($_options);
     if ($this->_options['useRfc2307']) {
         $this->_requiredObjectClass[] = 'posixAccount';
         $this->_requiredObjectClass[] = 'shadowAccount';
         $this->_rowNameMapping['accountHomeDirectory'] = 'unixhomedirectory';
         $this->_rowNameMapping['accountLoginShell'] = 'loginshell';
     }
     // get domain sid
     $this->_domainConfig = $this->_ldap->search('objectClass=domain', $this->_ldap->getFirstNamingContext(), Zend_Ldap::SEARCH_SCOPE_BASE)->getFirst();
     $this->_domainSidBinary = $this->_domainConfig['objectsid'][0];
     $this->_domainSidPlain = Tinebase_Ldap::decodeSid($this->_domainConfig['objectsid'][0]);
     $domanNameParts = array();
     $keys = null;
     // not really needed
     Zend_Ldap_Dn::explodeDn($this->_domainConfig['distinguishedname'][0], $keys, $domanNameParts);
     $this->_domainName = implode('.', $domanNameParts);
 }
 /**
  * Deletes one or more existing persistent record(s)
  *
  * @param  string|array  $_identifier
  */
 public function delete($_identifier)
 {
     $this->_ldap->deleteUsersInSyncBackend((array) $_identifier);
 }