ldap: correct query condition and determining of success

This commit is contained in:
Arthur Schiwon 2012-06-07 13:36:34 +02:00
parent 691f00eb39
commit f3f3c791ba
1 changed files with 12 additions and 2 deletions

View File

@ -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) {