Source for file Search.php
Documentation is available at Search.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +--------------------------------------------------------------------------+
// +--------------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +--------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +--------------------------------------------------------------------------+
// | Authors: Tarjej Huse |
// +--------------------------------------------------------------------------+
// $Id: Search.php,v 1.4.2.3 2005/03/01 12:27:43 jw Exp $
* Result set of an LDAP search
* @version $Revision: 1.4.2.3 $
* Search result identifier
* Result entry identifier
* The errorcode the search got
* Some errorcodes might be of interest, but might not be best handled as errors.
* examples: 4 - LDAP_SIZELIMIT_EXCEEDED - indecates a huge search.
* Incomplete results are returned. If you just want to check if there's anything in the search.
* than this is a point to handle.
* 32 - no such object - search here returns a count of 0.
var $_errorCode = 0; // if not set - sucess!
* @param resource Search result identifier
* @param resource Link identifier
$this->_setSearch ($search, $link);
$this->_errorCode = ldap_errno ($link);
* Returns an assosiative array of entry objects
* @return array Array of entry objects.
if ($this->count() == 0 ) {
$this->_elink = @ldap_first_entry ( $this->_link,$this->_search);
@ldap_get_dn ($this->_link, $this->_elink),
@ldap_get_attributes ($this->_link, $this->_elink));
while ($this->_elink = @ldap_next_entry ($this->_link,$this->_elink)) {
@ldap_get_dn ($this->_link, $this->_elink),
@ldap_get_attributes ($this->_link, $this->_elink));
* Get the next entry in the searchresult.
* @return mixed Net_LDAP_Entry object or false
if ($this->count() == 0 ) {
$this->_elink = @ldap_first_entry ($this->_link, $this->_search);
ldap_get_dn ($this->_link, $this->_elink),
ldap_get_attributes ($this->_link, $this->_elink));
if (!$this->_elink = ldap_next_entry ($this->_link, $this->_elink)) {
ldap_get_dn ($this->_link,$this->_elink),
ldap_get_attributes ($this->_link,$this->_elink));
* alias function of shiftEntry() for perl-ldap interface
* Retrieve the last entry of the searchset. NOT IMPLEMENTED
* @return object Net_LDAP_Error
$this->raiseError ("Not implemented");
* Return entries sorted NOT IMPLEMENTED
* @param array Array of sort attributes
* @return object Net_LDAP_Error
function sorted ($attrs = array ())
$this->raiseError ("Not impelented");
* Return entries as object NOT IMPLEMENTED
* @return object Net_LDAP_Error
$this->raiseError ("Not implemented");
* Set the searchobjects resourcelinks
* @param resource Search result identifier
* @param resource Resource link identifier
function _setSearch (&$search,&$link)
$this->_search = $search;
* Returns the number of entries in the searchresult
* @return int Number of entries in search.
/* this catches the situation where OL returned errno 32 = no such object! */
return @ldap_count_entries ($this->_link, $this->_search);
* Get the errorcode the object got in its search.
* @return int The ldap error number.
return $this->_errorCode;
@ldap_free_result ($this->_search);
Documentation generated on Mon, 11 Mar 2019 14:26:18 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|