ldap: correct query condition and determining of success
This commit is contained in:
parent
470cb17f90
commit
6894882ca9
|
@ -380,12 +380,22 @@ class OC_LDAP {
|
||||||
SELECT 1
|
SELECT 1
|
||||||
FROM '.$table.'
|
FROM '.$table.'
|
||||||
WHERE ldap_dn = ?
|
WHERE ldap_dn = ?
|
||||||
AND owncloud_name = ? )
|
OR owncloud_name = ? )
|
||||||
');
|
');
|
||||||
|
|
||||||
$res = $insert->execute(array($dn, $ocname, $dn, $ocname));
|
$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) {
|
static public function fetchListOfUsers($filter, $attr) {
|
||||||
|
|
Loading…
Reference in New Issue