/** * 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'; } }
/** * 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); }