[Pkg-owncloud-commits] [owncloud] 82/394: LDAP: check if search was successful (fixes a PHP warning), provide meaningful log output
David Prévot
taffit at alioth.debian.org
Fri Nov 8 23:11:33 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.
commit 2d110f25f73ddf628542e38e759e52fba71162a3
Author: Arthur Schiwon <blizzz at owncloud.com>
Date: Fri Nov 9 22:53:56 2012 +0100
LDAP: check if search was successful (fixes a PHP warning), provide meaningful log output
---
apps/user_ldap/lib/access.php | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index b8e50d8..e24f045 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -516,6 +516,12 @@ abstract class Access {
$link_resource = $this->connection->getConnectionResource();
if(is_resource($link_resource)) {
$sr = ldap_search($link_resource, $base, $filter, $attr);
+ if(!is_resource($sr)) {
+ $errmsg = '('.ldap_errno($link_resource).') ' . ldap_error($link_resource);
+ $errmsg .= ', search filter: ' . $filter;
+ \OCP\Util::writeLog('user_ldap', 'Search: no result resource, LDAP error message: ' . $errmsg, \OCP\Util::ERROR);
+ return array();
+ }
$findings = ldap_get_entries($link_resource, $sr );
// if we're here, probably no connection resource is returned.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list