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


PHP Ldap::getBaseDn方法代碼示例

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


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

示例1: findUnit

 private function findUnit(Identity $identity)
 {
     if (null === $this->unit) {
         $filter = Filter::equals('mail', $identity->mail);
         $baseDn = Dn::factory($this->ldap->getBaseDn())->prepend(['ou' => 'people']);
         $result = $this->ldap->search($filter, $baseDn, Ldap::SEARCH_SCOPE_ONE, ['l']);
         if (1 !== $result->count()) {
             return;
         }
         $result = $result->current();
         $unitDn = $result['l'][0];
         $this->unit = $this->ldap->getNode($unitDn);
     }
     return $this->unit;
 }
開發者ID:eellak,項目名稱:gredu_labs,代碼行數:15,代碼來源:CreateSchool.php

示例2: _prepareOptions

 /**
  * Sets the LDAP specific options on the Zend_Ldap instance
  *
  * @param  Zend_Ldap $ldap
  * @param  array $options
  * @return array of auth-adapter specific options
  */
 protected function _prepareOptions(\Zend\Ldap\Ldap $ldap, array $options)
 {
     $adapterOptions = array('group' => null, 'groupDn' => $ldap->getBaseDn(), 'groupScope' => \Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, 'groupAttr' => 'cn', 'groupFilter' => 'objectClass=groupOfUniqueNames', 'memberAttr' => 'uniqueMember', 'memberIsDn' => true);
     foreach ($adapterOptions as $key => $value) {
         if (array_key_exists($key, $options)) {
             $value = $options[$key];
             unset($options[$key]);
             switch ($key) {
                 case 'groupScope':
                     $value = (int) $value;
                     if (in_array($value, array(\Zend\Ldap\Ldap::SEARCH_SCOPE_BASE, \Zend\Ldap\Ldap::SEARCH_SCOPE_ONE, \Zend\Ldap\Ldap::SEARCH_SCOPE_SUB), true)) {
                         $adapterOptions[$key] = $value;
                     }
                     break;
                 case 'memberIsDn':
                     $adapterOptions[$key] = $value === true || $value === '1' || strcasecmp($value, 'true') == 0;
                     break;
                 default:
                     $adapterOptions[$key] = trim($value);
                     break;
             }
         }
     }
     $ldap->setOptions($options);
     return $adapterOptions;
 }
開發者ID:navtis,項目名稱:xerxes-pazpar2,代碼行數:33,代碼來源:Ldap.php

示例3: attachLdap

 /**
  * Attach node to an LDAP connection
  *
  * This is an offline method.
  *
  * @param  Ldap $ldap
  * @return Node Provides a fluid interface
  * @throws Exception\LdapException
  */
 public function attachLdap(Ldap $ldap)
 {
     if (!Dn::isChildOf($this->_getDn(), $ldap->getBaseDn())) {
         throw new Exception\LdapException(null, 'LDAP connection is not responsible for given node.', Exception\LdapException::LDAP_OTHER);
     }
     if ($ldap !== $this->ldap) {
         $this->ldap = $ldap;
         if (is_array($this->children)) {
             foreach ($this->children as $child) {
                 $child->attachLdap($ldap);
             }
         }
     }
     return $this;
 }
開發者ID:GeeH,項目名稱:zend-ldap,代碼行數:24,代碼來源:Node.php


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