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


PHP Ldap::getEntry方法代碼示例

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


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

示例1: reload

 /**
  * Reload node attributes from LDAP.
  *
  * This is an online method.
  *
  * @param  \Zend\Ldap\Ldap $ldap
  * @return AbstractNode Provides a fluid interface
  */
 public function reload(Ldap\Ldap $ldap = null)
 {
     if ($ldap !== null) {
         $data = $ldap->getEntry($this->_getDn(), array('*', '+'), true);
         $this->loadData($data, true);
     }
     return $this;
 }
開發者ID:idwsdta,項目名稱:INIT-frame,代碼行數:16,代碼來源:AbstractNode.php

示例2: create

 /**
  * Factory method to create the RootDse.
  *
  * @param \Zend\Ldap\Ldap $ldap
  * @return RootDse
  */
 public static function create(Ldap\Ldap $ldap)
 {
     $dn = Ldap\Dn::fromString('');
     $data = $ldap->getEntry($dn, ['*', '+'], true);
     if (isset($data['domainfunctionality'])) {
         return new RootDse\ActiveDirectory($dn, $data);
     } elseif (isset($data['dsaname'])) {
         return new RootDse\eDirectory($dn, $data);
     } elseif (isset($data['structuralobjectclass']) && $data['structuralobjectclass'][0] === 'OpenLDAProotDSE') {
         return new RootDse\OpenLdap($dn, $data);
     }
     return new static($dn, $data);
 }
開發者ID:GeeH,項目名稱:zend-ldap,代碼行數:19,代碼來源:RootDse.php

示例3: create

 /**
  * Factory method to create the Schema node.
  *
  * @param  \Zend\Ldap\Ldap $ldap
  * @return \Zend\Ldap\Node\Schema
  * @throws \Zend\Ldap\Exception
  */
 public static function create(Ldap\Ldap $ldap)
 {
     $dn = $ldap->getRootDse()->getSchemaDn();
     $data = $ldap->getEntry($dn, array('*', '+'), true);
     switch ($ldap->getRootDse()->getServerType()) {
         case RootDSE::SERVER_TYPE_ACTIVEDIRECTORY:
             return new Schema\ActiveDirectory($dn, $data, $ldap);
         case RootDSE::SERVER_TYPE_OPENLDAP:
             return new Schema\OpenLdap($dn, $data, $ldap);
         case RootDSE::SERVER_TYPE_EDIRECTORY:
         default:
             return new self($dn, $data, $ldap);
     }
 }
開發者ID:rexmac,項目名稱:zf2,代碼行數:21,代碼來源:Schema.php

示例4: findByUsername

 public function findByUsername($username)
 {
     $this->bind();
     $entryDN = "uid={$username}," . $this->active_server['baseDn'];
     $this->log("Attempting to get username entry: {$entryDN} against the active ldap server");
     try {
         $hm = $this->ldap->getEntry($entryDN);
         $this->log("Raw Ldap Object: " . var_export($hm, true), 7);
         $this->log("Username entry lookup response: " . var_export($hm, true));
         return $hm;
     } catch (LdapException $exc) {
         return $exc->getMessage();
     }
 }
開發者ID:hlich,項目名稱:zfcuser-ldap,代碼行數:14,代碼來源:Ldap.php

示例5: fromLdap

 /**
  * Factory method to create an attached Zend\Ldap\Node for a given DN.
  *
  * @param  string|array|Dn $dn
  * @param  Ldap            $ldap
  * @return Node|null
  * @throws Exception\LdapException
  */
 public static function fromLdap($dn, Ldap $ldap)
 {
     if (is_string($dn) || is_array($dn)) {
         $dn = Dn::factory($dn);
     } elseif ($dn instanceof Dn) {
         $dn = clone $dn;
     } else {
         throw new Exception\LdapException(null, '$dn is of a wrong data type.');
     }
     $data = $ldap->getEntry($dn, ['*', '+'], true);
     if ($data === null) {
         return;
     }
     $entry = new static($dn, $data, true, $ldap);
     return $entry;
 }
開發者ID:GeeH,項目名稱:zend-ldap,代碼行數:24,代碼來源:Node.php


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