diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2013-08-20 12:39:24 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-09-27 13:34:15 +0200 |
commit | 52454e39b7e04869f2cb3253d6978bbef5ece7fc (patch) | |
tree | acb6ee9b633dfbab5c468ba93d8be66394b7bc96 /apps/user_ldap/lib/access.php | |
parent | d34fbf3a8647806779d908b599068b9000d0c4e4 (diff) | |
download | nextcloud-server-52454e39b7e04869f2cb3253d6978bbef5ece7fc.tar.gz nextcloud-server-52454e39b7e04869f2cb3253d6978bbef5ece7fc.zip |
LDAP: move is_resource check to ldap wrapper to make it mockable
Diffstat (limited to 'apps/user_ldap/lib/access.php')
-rw-r--r-- | apps/user_ldap/lib/access.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index d09571a8a66..6cdeff36677 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -54,14 +54,14 @@ abstract class Access extends BackendBase { return false; } $cr = $this->connection->getConnectionResource(); - if(!is_resource($cr)) { + if(!$this->ldap->isResource($cr)) { //LDAP not available \OCP\Util::writeLog('user_ldap', 'LDAP resource not available.', \OCP\Util::DEBUG); return false; } $dn = $this->DNasBaseParameter($dn); $rr = @$this->ldap->read($cr, $dn, $filter, array($attr)); - if(!is_resource($rr)) { + if(!$this->ldap->isResource($rr)) { if(!empty($attr)) { //do not throw this message on userExists check, irritates \OCP\Util::writeLog('user_ldap', 'readAttribute failed for DN '.$dn, \OCP\Util::DEBUG); @@ -74,7 +74,7 @@ abstract class Access extends BackendBase { return array(); } $er = $this->ldap->first_entry($cr, $rr); - if(!is_resource($er)) { + if(!$this->ldap->isResource($er)) { //did not match the filter, return false return false; } @@ -653,7 +653,7 @@ abstract class Access extends BackendBase { // See if we have a resource, in case not cancel with message $link_resource = $this->connection->getConnectionResource(); - if(!is_resource($link_resource)) { + if(!$this->ldap->isResource($link_resource)) { // Seems like we didn't find any resource. // Return an empty array just like before. \OCP\Util::writeLog('user_ldap', 'Could not search, because resource is missing.', \OCP\Util::DEBUG); |