diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2012-06-07 15:36:34 +0400 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2012-06-07 15:40:26 +0400 |
commit | f3f3c791bae3fa9836cf2951ed1cd33a1e7767d1 (patch) | |
tree | 0eb3896e67edbb10acc6d07781266b0c40805fc0 /apps | |
parent | 691f00eb3976f6ccf4a2c1a20e1264190d64e142 (diff) |
ldap: correct query condition and determining of success
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/lib_ldap.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/user_ldap/lib_ldap.php b/apps/user_ldap/lib_ldap.php index 6f4c0b0aad9..753243f2c4a 100644 --- a/apps/user_ldap/lib_ldap.php +++ b/apps/user_ldap/lib_ldap.php @@ -380,12 +380,22 @@ class OC_LDAP { SELECT 1 FROM '.$table.' WHERE ldap_dn = ? - AND owncloud_name = ? ) + OR owncloud_name = ? ) '); $res = $insert->execute(array($dn, $ocname, $dn, $ocname)); - return !OCP\DB::isError($res); + if(OCP\DB::isError($res)) { + return false; + } + + $insRows = $res->numRows(); + + if($insRows == 0) { + return false; + } + + return true; } static public function fetchListOfUsers($filter, $attr) { |