|
@@ 202-219 (lines=18) @@
|
| 199 |
|
|
| 200 |
|
foreach ($searchProperties as $prop => $value) { |
| 201 |
|
switch ($prop) { |
| 202 |
|
case '{http://sabredav.org/ns}email-address': |
| 203 |
|
$query = $this->db->getQueryBuilder(); |
| 204 |
|
$query->select(['id', 'backend_id', 'resource_id', 'email', 'displayname', 'group_restrictions']) |
| 205 |
|
->from($this->dbTableName) |
| 206 |
|
->where($query->expr()->iLike('email', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($value) . '%'))); |
| 207 |
|
|
| 208 |
|
$stmt = $query->execute(); |
| 209 |
|
$principals = []; |
| 210 |
|
while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
| 211 |
|
if (!$this->isAllowedToAccessResource($row, $usersGroups)) { |
| 212 |
|
continue; |
| 213 |
|
} |
| 214 |
|
$principals[] = $this->rowToPrincipal($row)['uri']; |
| 215 |
|
} |
| 216 |
|
$results[] = $principals; |
| 217 |
|
|
| 218 |
|
$stmt->closeCursor(); |
| 219 |
|
break; |
| 220 |
|
|
| 221 |
|
case '{DAV:}displayname': |
| 222 |
|
$query = $this->db->getQueryBuilder(); |
|
@@ 221-238 (lines=18) @@
|
| 218 |
|
$stmt->closeCursor(); |
| 219 |
|
break; |
| 220 |
|
|
| 221 |
|
case '{DAV:}displayname': |
| 222 |
|
$query = $this->db->getQueryBuilder(); |
| 223 |
|
$query->select(['id', 'backend_id', 'resource_id', 'email', 'displayname', 'group_restrictions']) |
| 224 |
|
->from($this->dbTableName) |
| 225 |
|
->where($query->expr()->iLike('displayname', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($value) . '%'))); |
| 226 |
|
|
| 227 |
|
$stmt = $query->execute(); |
| 228 |
|
$principals = []; |
| 229 |
|
while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
| 230 |
|
if (!$this->isAllowedToAccessResource($row, $usersGroups)) { |
| 231 |
|
continue; |
| 232 |
|
} |
| 233 |
|
$principals[] = $this->rowToPrincipal($row)['uri']; |
| 234 |
|
} |
| 235 |
|
$results[] = $principals; |
| 236 |
|
|
| 237 |
|
$stmt->closeCursor(); |
| 238 |
|
break; |
| 239 |
|
|
| 240 |
|
default: |
| 241 |
|
$results[] = []; |