Skip to content

Commit

Permalink
search on alt_name
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed Jul 28, 2020
1 parent 075b60c commit 2691464
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Db/CirclesRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ public function getCircles(
$circles = [];
$cursor = $qb->execute();
while ($data = $cursor->fetch()) {
if ($name === '' || stripos(strtolower($data['name']), strtolower($name)) !== false) {
if ($name === '' || stripos(strtolower($data['name']), strtolower($name)) !== false
|| stripos(strtolower($data['alt_name']), strtolower($name)) !== false) {
$circles[] = $this->parseCirclesSelectSql($data);
}
}
Expand Down
1 change: 1 addition & 0 deletions lib/Db/CirclesRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ private function generateLimitSecret(IQueryBuilder $qb, $circleUniqueId, $type,

$orX = $expr->orX($expr->gte('u.level', $qb->createNamedParameter(Member::LEVEL_MEMBER)));
$orX->add($expr->eq('c.name', $qb->createNamedParameter($name)))
->add($expr->eq('c.alt_name', $qb->createNamedParameter($name)))
->add($expr->eq('c.unique_id', $qb->createNamedParameter($circleUniqueId)));

if ($this->leftJoinedNCGroupAndUser) {
Expand Down

0 comments on commit 2691464

Please sign in to comment.