cvs: pear /DB_ldap ldap.php
| From: | Piotr Roszatycki | Date: | Thu, 07 Nov 2002 16:45:22 +0000 |
| Subject: | cvs: pear /DB_ldap ldap.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-7305@lists.php.net to get a copy of this message | ||
dexter Thu Nov 7 11:45:22 2002 EDT
Modified files:
/pear/DB_ldap ldap.php
Log:
Better handling of connect errors
Index: pear/DB_ldap/ldap.php
diff -u pear/DB_ldap/ldap.php:1.15 pear/DB_ldap/ldap.php:1.16
--- pear/DB_ldap/ldap.php:1.15 Thu Nov 7 07:04:51 2002
+++ pear/DB_ldap/ldap.php Thu Nov 7 11:45:21 2002
@@ -23,7 +23,7 @@
// - Piotr Roszatycki <dexter@debian.org>
// DB_ldap::base() method, support for LDAP sequences, various fixes
//
-// $Id: ldap.php,v 1.15 2002/11/07 12:04:51 dexter Exp $
+// $Id: ldap.php,v 1.16 2002/11/07 16:45:21 dexter Exp $
//
require_once 'DB/common.php';
@@ -381,7 +381,7 @@
function connect($dsninfo, $persistent = false)
{
if (!DB::assertExtension('ldap'))
- return $this->ldapRaiseError(DB_ERROR_EXTENSION_NOT_FOUND);
+ return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
$this->dsn = $dsninfo;
$user = $dsninfo['username'];
@@ -390,7 +390,7 @@
$this->base = $dsninfo['database'];
if ($host) {
- $conn = ldap_connect($host);
+ $conn = @ldap_connect($host);
} else {
return $this->raiseError("unknown host $host");
}
@@ -398,9 +398,9 @@
return $this->raiseError(DB_ERROR_CONNECT_FAILED);
}
if ($user && $pw) {
- $bind = ldap_bind($conn, $user, $pw);
+ $bind = @ldap_bind($conn, $user, $pw);
} else {
- $bind = ldap_bind($conn);
+ $bind = @ldap_bind($conn);
}
if (!$bind) {
return $this->raiseError(DB_ERROR_BIND_FAILED);