当前位置: 首页>>代码示例>>PHP>>正文


PHP ldap_next_entry函数代码示例

本文整理汇总了PHP中ldap_next_entry函数的典型用法代码示例。如果您正苦于以下问题:PHP ldap_next_entry函数的具体用法?PHP ldap_next_entry怎么用?PHP ldap_next_entry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ldap_next_entry函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: verify

 function verify($cert, $dn)
 {
     $conn = ldap_connect($this->LDAP_HOST);
     if (!$conn) {
         return false;
     }
     if (!ldap_bind($conn)) {
         return false;
     }
     $resultset = ldap_search($conn, "c=EE", "(serialNumber=38212200301)");
     if (!$resultset) {
         echo "No recs";
         return false;
     }
     $rec = ldap_first_entry($conn, $resultset);
     while ($rec !== false) {
         $values = ldap_get_values($conn, $rec, 'usercertificate;binary');
         $certificate = "-----BEGIN CERTIFICATE-----\n" . chunk_split(base64_encode($values[0]), 64, "\n") . "-----END CERTIFICATE-----\n";
         if (strcmp($cert, $certificate) == 0) {
             return "Found";
         }
         $rec = ldap_next_entry($conn, $rec);
     }
     // Not found a record with a matching certificate
     return false;
 }
开发者ID:raisty,项目名称:eid-webauth-samples,代码行数:26,代码来源:ldap.php

示例2: fetchEntry

 /**
  * @return mixed resource
  */
 public function fetchEntry()
 {
     if (!$this->result_resource) {
         return null;
     }
     if (null === $this->entry_resource) {
         $this->entry_resource = ldap_first_entry($this->resource, $this->result_resource);
     } else {
         $this->entry_resource = ldap_next_entry($this->resource, $this->entry_resource);
     }
     if (!$this->entry_resource) {
         return null;
     }
     $dn = ldap_get_dn($this->resource, $this->entry_resource);
     $rawAttributes = ldap_get_attributes($this->resource, $this->entry_resource);
     $count = $rawAttributes['count'];
     $attributes = array();
     for ($i = 0; $i < $count; $i++) {
         $attribute = $rawAttributes[$i];
         $values = array();
         $subCount = $rawAttributes[$attribute]['count'];
         for ($j = 0; $j < $subCount; $j++) {
             $values[] = $rawAttributes[$attribute][$j];
         }
         $attributes[$attribute] = $values;
     }
     $object = new Object($dn, $attributes);
     return $object;
 }
开发者ID:heiglandreas,项目名称:ldap,代码行数:32,代码来源:SearchResultProxy.php

示例3: fetch_row

 public function fetch_row()
 {
     if ($this->get_opt('fetch_pos')) {
         return ldap_next_entry($this->handle, $this->resource);
     } else {
         return ldap_first_entry($this->handle, $this->resource);
     }
 }
开发者ID:codifyllc,项目名称:phpopenfw,代码行数:8,代码来源:dr_ldap.class.php

示例4: nextEntry

 /**
  * @return Entry|null
  * @throws EntryRetrievalFailureException
  */
 public function nextEntry()
 {
     if (!($entry = ldap_next_entry($this->link, $this->entry))) {
         if (0 !== ($errNo = ldap_errno($this->link))) {
             throw new EntryRetrievalFailureException(ldap_error($this->link), $errNo);
         }
         return null;
     }
     return new Entry($this->link, $entry);
 }
开发者ID:daverandom,项目名称:ldapi,代码行数:14,代码来源:Entry.php

示例5: readUsers

 public static function readUsers($ldapconn)
 {
     $users = array();
     $search = ldap_list($ldapconn, USER_DN, User::FILTER_USERS, array("cn", "mail", "displayName", "sn", "givenName", "memberOf"));
     if (ldap_count_entries($ldapconn, $search) > 0) {
         $entry = ldap_first_entry($ldapconn, $search);
         do {
             $users[] = User::readFromLdapEntry($ldapconn, $entry);
         } while ($entry = ldap_next_entry($ldapconn, $entry));
     }
     return $users;
 }
开发者ID:tmaex,项目名称:useradmin,代码行数:12,代码来源:user.inc.php

示例6: getNextEntry

 /**
  * Returns the next entry in the result set or false wether there are no more entries.
  * 
  * @return \gossi\ldap\LdapEntry The new LdapEntry.
  */
 public function getNextEntry()
 {
     if ($this->pointer == null) {
         return $this->getFirstEntry();
     }
     $this->pointer = ldap_next_entry($this->conn, $this->pointer);
     if ($this->pointer) {
         return new LdapEntry($this->conn, $this->pointer);
     } else {
         return false;
     }
 }
开发者ID:gossi,项目名称:ldap,代码行数:17,代码来源:LdapResult.php

示例7: iterarEntradas

 /**
  * Auxiliar directo de busqueda. Dado un ldap result, itera por el para conseguir sus datos
  * 
  * @param ldap result $busquedaLdap
  * @param array $atributos
  * @return boolean
  */
 private function iterarEntradas($busquedaLdap, array $atributos)
 {
     $datos = array();
     if ($entrada = ldap_first_entry($this->conexionLdap, $busquedaLdap)) {
         do {
             // Ejecutamos al menos una vez el mapeo de entradas con sus atributos, a menos
             // que no haya nada
             $datos[] = $this->mapa($atributos, $entrada);
         } while ($entrada = ldap_next_entry($this->conexionLdap, $entrada));
         return $datos;
     } else {
         return FALSE;
     }
 }
开发者ID:vtacius,项目名称:ldappm,代码行数:21,代码来源:ldapOperations.php

示例8: ldap_flatresults

 function ldap_flatresults($ad, $sr, $key = false)
 {
     for ($entry = ldap_first_entry($ad, $sr); $entry != false; $entry = ldap_next_entry($ad, $entry)) {
         $user = array();
         $attributes = ldap_get_attributes($ad, $entry);
         for ($i = $attributes['count']; $i-- > 0;) {
             $user[strtolower($attributes[$i])] = $attributes[$attributes[$i]][0];
         }
         if ($key && $user[$key]) {
             $users[strtolower($user[$key])] = $user;
         } else {
             $users[] = $user;
         }
     }
     return $users;
 }
开发者ID:bazo,项目名称:diplomovka,代码行数:16,代码来源:LDAPModel.php

示例9: getIterator

 public function getIterator()
 {
     $con = $this->connection->getResource();
     $search = $this->search->getResource();
     $current = ldap_first_entry($con, $search);
     if (0 === $this->count()) {
         return;
     }
     if (false === $current) {
         throw new LdapException(sprintf('Could not rewind entries array: %s', ldap_error($con)));
     }
     (yield $this->getSingleEntry($con, $current));
     while (false !== ($current = ldap_next_entry($con, $current))) {
         (yield $this->getSingleEntry($con, $current));
     }
 }
开发者ID:ayoah,项目名称:symfony,代码行数:16,代码来源:Collection.php

示例10: next

 /**
  * Retrieves next available entry from the search result set
  *
  * @return EntryInterface next entry if available, null otherwise
  */
 public function next()
 {
     if ($this->isEndReached) {
         return null;
     }
     if (null === $this->previous) {
         $this->previous = @ldap_first_entry($this->connection, $this->resultSet);
     } else {
         $this->previous = @ldap_next_entry($this->connection, $this->previous);
     }
     if (false === $this->previous) {
         $this->previous = null;
         $this->isEndReached = true;
         return null;
     }
     return new Entry($this->connection, $this->previous);
 }
开发者ID:81square,项目名称:ldap,代码行数:22,代码来源:Search.php

示例11: getUsers

 public function getUsers($filter = null)
 {
     if ($filter !== null) {
         $filter = "(&(objectClass=inetOrgPerson)(uid=" . addcslashes($filter, '()\\') . "))";
     } else {
         $filter = "(objectClass=inetOrgPerson)";
     }
     $resource = ldap_search($this->ldapconn, $this->ldapbasedn, $filter);
     ldap_sort($this->ldapconn, $resource, "uid");
     $entry = ldap_first_entry($this->ldapconn, $resource);
     $users = array();
     while ($entry) {
         $attributes = ldap_get_attributes($this->ldapconn, $entry);
         $users[] = $attributes["uid"][0];
         $entry = ldap_next_entry($this->ldapconn, $entry);
     }
     return $users;
 }
开发者ID:jungepiraten,项目名称:ucp,代码行数:18,代码来源:UserDatabase.class.php

示例12: fetch

 /**
  * Fetch the next record or return false if there's none.
  * 
  * @return Record 
  */
 public function fetch()
 {
     if (!isset($this->_numEntry)) {
         $this->_numEntry = 0;
         $this->_entryId = ldap_first_entry($this->_ldapConn->getLink(), $this->_searchId);
     } else {
         $this->_numEntry++;
         $this->_entryId = ldap_next_entry($this->_ldapConn->getLink(), $this->_entryId);
     }
     if (!$this->_entryId) {
         return false;
     }
     $record = new $this->fetchClass($this->_ldapConn, $this->_entryId);
     if (!is_a($record, 'GO\\Base\\Ldap\\Record')) {
         throw new Exception($this->fetchClass . ' is not a GO\\Base\\Ldap\\Record subclass');
     }
     return $record;
 }
开发者ID:ajaboa,项目名称:crmpuan,代码行数:23,代码来源:Result.php

示例13: next

 /**
  * Get the next LDAP entry from search results.
  *
  * @return Entry|null
  *   Next LDAP entry or null if no entries left.
  */
 public function next()
 {
     if ($this->entryID === null) {
         $this->entryID = ldap_first_entry($this->ds, $this->sr);
     } else {
         $this->entryID = ldap_next_entry($this->ds, $this->entryID);
     }
     if (!$this->entryID) {
         return null;
     }
     $data = Utils::readEntry($this->ds, $this->entryID, $this->binaryFields);
     if (array_key_exists('nsRole', $data)) {
         $data['roles'] = Utils::getRoles($this->ds, $data);
     }
     $dn = ldap_get_dn($this->ds, $this->entryID);
     $rdn = Utils::getRDN($dn, $this->baseDN);
     return new Entry($this->ds, $rdn, $dn, $data);
 }
开发者ID:grom358,项目名称:php-ldap,代码行数:24,代码来源:SearchResults.php

示例14: next

 /**
  * @see ResultSet::next()
  */
 public function next()
 {
     if (!$this->entry) {
         $this->entry = ldap_first_entry($this->conn->getResource(), $this->result);
     }
     $this->entry = ldap_next_entry($this->conn->getResource(), $this->entry);
     if (!$this->entry) {
         $errno = mysql_errno($this->conn->getResource());
         if (!$errno) {
             // We've advanced beyond end of recordset.
             $this->afterLast();
             return false;
         } else {
             throw new SQLException("Error fetching result", mysql_error($this->conn->getResource()));
         }
     }
     $this->cursorPos++;
     return $this->entry;
 }
开发者ID:nmicht,项目名称:tlalokes-in-acst,代码行数:22,代码来源:LdapResultSet.php

示例15: get_ldap_attribute_for_various_data

 public function get_ldap_attribute_for_various_data($pAttributes, $ldapRequest)
 {
     $allResults = array();
     $ldapc = $this->ldap_conn;
     //ldap connection
     if (!is_array($pAttributes)) {
         throw new Exception("Argument is not an array", E_PARAM);
     }
     //search for multiple ldap attributes
     //search string is prefix notation
     $search = ldap_search($ldapc, LDAP_O . ", " . LDAP_C, $ldapRequest, $pAttributes);
     //get ldap attributes
     for ($entryID = ldap_first_entry($ldapc, $search); $entryID != false; $entryID = ldap_next_entry($ldapc, $entryID)) {
         foreach ($pAttributes as $attribute) {
             $value = ldap_get_values($ldapc, $entryID, $attribute);
             $result[$attribute] = $value[0];
         }
         $allResults[] = $result;
     }
     return $allResults;
 }
开发者ID:rolwi,项目名称:koala,代码行数:21,代码来源:lms_ldap.class.php


注:本文中的ldap_next_entry函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。