cvs: pear /Net_LDAP LDAP.php package.xml /Net_LDAP/LDAP Entry.php
| From: | Tarjei Huse | Date: | Thu, 13 Nov 2003 09:06:58 +0000 |
| Subject: | cvs: pear /Net_LDAP LDAP.php package.xml /Net_LDAP/LDAP Entry.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-14241@lists.php.net to get a copy of this message | ||
tarjei Thu Nov 13 04:06:58 2003 EDT
Modified files:
/pear/Net_LDAP LDAP.php package.xml
/pear/Net_LDAP/LDAP Entry.php
Log:
Minor bugfix
Index: pear/Net_LDAP/LDAP.php
diff -u pear/Net_LDAP/LDAP.php:1.13 pear/Net_LDAP/LDAP.php:1.14
--- pear/Net_LDAP/LDAP.php:1.13 Wed Nov 12 05:53:13 2003
+++ pear/Net_LDAP/LDAP.php Thu Nov 13 04:06:57 2003
@@ -5,7 +5,7 @@
* (the perl Net::LDAP way)
*
* @author Tarjei Huse
- * @version $Id: LDAP.php,v 1.13 2003/11/12 10:53:13 jw Exp $
+ * @version $Id: LDAP.php,v 1.14 2003/11/13 09:06:57 tarjei Exp $
* @package Net_LDAP
*/
@@ -540,10 +540,20 @@
*/
function dnExists($dn)
{
- $base = $dn;
- $filter = '(objectclass=*)';
- $result = ldap_list( $this -> _link, $base,$filter, array(),1,1);
- if (ldap_count_entries($result)>0) {
+ $dns = explode(",",$dn);
+ $filter = array_shift($dns);
+ $base= implode($dns,',');
+ //$base = $dn;
+ //$filter = '(objectclass=*)';
+
+ $result = @ldap_list( $this -> _link, $base,$filter, array(),1,1);
+ if (ldap_errno($this -> _link) == 32) {
+ return false;
+ }
+ if (ldap_errno($this -> _link) != 0) {
+ $this -> raiseError( ldap_error($this->_link),ldap_errno($this -> _link));
+ }
+ if (@ldap_count_entries($this->_link, $result)) {
return true;
}
return false;
Index: pear/Net_LDAP/package.xml
diff -u pear/Net_LDAP/package.xml:1.8 pear/Net_LDAP/package.xml:1.9
--- pear/Net_LDAP/package.xml:1.8 Wed Nov 12 07:54:19 2003
+++ pear/Net_LDAP/package.xml Thu Nov 13 04:06:57 2003
@@ -113,7 +113,6 @@
The new Net_ldap_entry::modify() method seems to work very nice now.
</notes>
</release>
- <release>
<release>
<version>0.6</version>
<state>beta</state>
Index: pear/Net_LDAP/LDAP/Entry.php
diff -u pear/Net_LDAP/LDAP/Entry.php:1.11 pear/Net_LDAP/LDAP/Entry.php:1.12
--- pear/Net_LDAP/LDAP/Entry.php:1.11 Wed Nov 12 05:53:13 2003
+++ pear/Net_LDAP/LDAP/Entry.php Thu Nov 13 04:06:58 2003
@@ -5,7 +5,7 @@
*
* @package Net_LDAP
* @author Tarjei Huse
- * @version $Id: Entry.php,v 1.11 2003/11/12 10:53:13 jw Exp $
+ * @version $Id: Entry.php,v 1.12 2003/11/13 09:06:58 tarjei Exp $
*/
/**
@@ -210,7 +210,7 @@
if ($v == '') continue;
if ($this->exists($k)) {
if (!is_array($this->_attrs[$k])) {
- $this->raiseError("Possible malformed array as parameter to
Net_LDAP::add().");
+ return $this->raiseError("Possible malformed array as parameter to
Net_LDAP::add().");
}
array_push($this->_attrs[$k],$v);
$this->_attrs[$k]['count']++;