當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Ldap_Dn::explodeDn方法代碼示例

本文整理匯總了PHP中Zend_Ldap_Dn::explodeDn方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Ldap_Dn::explodeDn方法的具體用法?PHP Zend_Ldap_Dn::explodeDn怎麽用?PHP Zend_Ldap_Dn::explodeDn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Ldap_Dn的用法示例。


在下文中一共展示了Zend_Ldap_Dn::explodeDn方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testDnWithMultiValuedRdnRoundTrip

 public function testDnWithMultiValuedRdnRoundTrip()
 {
     $dn1 = 'cn=Surname\\, Firstname+uid=userid,cn=name2,dc=example,dc=org';
     $dnArray = Zend_Ldap_Dn::explodeDn($dn1);
     $dn2 = Zend_Ldap_Dn::implodeDn($dnArray);
     $this->assertEquals($dn1, $dn2);
 }
開發者ID:SustainableCoastlines,項目名稱:loveyourwater,代碼行數:7,代碼來源:ImplodingTest.php

示例2: getDomainConfiguration

 /**
  * fetch domain config with domain sid and name
  *
  * @throws Tinebase_Exception_Backend_Ldap
  * @throws Zend_Ldap_Exception
  * @return array
  *
  * TODO cache this longer?
  */
 public function getDomainConfiguration()
 {
     if ($this->_domainConfig === null) {
         $this->_domainConfig = $this->getLdap()->search('objectClass=domain', $this->getLdap()->getFirstNamingContext(), Zend_Ldap::SEARCH_SCOPE_BASE)->getFirst();
         $this->_domainConfig['domainSidBinary'] = $this->_domainConfig['objectsid'][0];
         $this->_domainConfig['domainSidPlain'] = Tinebase_Ldap::decodeSid($this->_domainConfig['objectsid'][0]);
         $domainNameParts = array();
         $keys = null;
         // not really needed
         Zend_Ldap_Dn::explodeDn($this->_domainConfig['distinguishedname'][0], $keys, $domanNameParts);
         $this->_domainConfig['domainName'] = implode('.', $domainNameParts);
     }
     return $this->_domainConfig;
 }
開發者ID:ingoratsdorf,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:23,代碼來源:DomainConfigurationTrait.php

示例3: copy

 /**
  * Copies a LDAP entry from one DN to another DN.
  *
  * @param  string|Zend_Ldap_Dn $from
  * @param  string|Zend_Ldap_Dn $to
  * @param  boolean             $recursively
  * @return Zend_Ldap Provides a fluid interface
  * @throws Zend_Ldap_Exception
  */
 public function copy($from, $to, $recursively = false)
 {
     $entry = $this->getEntry($from, array(), true);
     if ($to instanceof Zend_Ldap_Dn) {
         $toDnParts = $to->toArray();
     } else {
         $toDnParts = Zend_Ldap_Dn::explodeDn($to);
     }
     $this->add($to, $entry);
     if ($recursively === true && $this->countChildren($from) > 0) {
         $children = $this->_getChildrenDns($from);
         foreach ($children as $c) {
             $cDnParts = Zend_Ldap_Dn::explodeDn($c);
             $newChildParts = array_merge(array(array_shift($cDnParts)), $toDnParts);
             $newChild = Zend_Ldap_Dn::implodeDn($newChildParts);
             $this->copy($c, $newChild, true);
         }
     }
     return $this;
 }
開發者ID:jpbender,項目名稱:mage_virtual,代碼行數:29,代碼來源:Ldap.php

示例4: testExplodeDnsProvidedByRFC2253

 /**
  * @dataProvider rfc2253DnProvider
  */
 public function testExplodeDnsProvidedByRFC2253($input, $expected)
 {
     $dnArray = Zend_Ldap_Dn::explodeDn($input);
     $this->assertEquals($expected, $dnArray);
 }
開發者ID:sasezaki,項目名稱:mirror-zf1-tests,代碼行數:8,代碼來源:ExplodingTest.php

示例5: testGetDnArray

 public function testGetDnArray()
 {
     $data = $this->_createTestArrayData();
     $node = Zend_Ldap_Node::fromArray($data);
     $exA = Zend_Ldap_Dn::explodeDn($data['dn']);
     $this->assertEquals($exA, $node->getDnArray());
 }
開發者ID:netvlies,項目名稱:zf,代碼行數:7,代碼來源:OfflineTest.php

示例6: __construct

 /**
  * 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);
 }
開發者ID:bitExpert,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:43,代碼來源:ActiveDirectory.php


注:本文中的Zend_Ldap_Dn::explodeDn方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。