Skip to content

Commit

Permalink
Telsearch queries now also work when db lookups disabled issue #5
Browse files Browse the repository at this point in the history
  • Loading branch information
a-schild committed Sep 5, 2018
1 parent b9f368d commit 1f1a009
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ There are two components at the moment:
- v2.4 Solved searching with non-ascii characters issue #6
Cleanup logging issue #13
Fixed uninitialized message issue #8
- v2.5 Telsearch queries now also work when db lookups disabled issue #5

(C) Aarboard AG, www.aarboard.ch, 2018

Expand Down
17 changes: 16 additions & 1 deletion ldap-server/InnoLdapServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ sub search
}
else
{
loginfo("Not query for equality1");
logdebug("Not query for equality1");
}
}
elsif (defined($mySubstrings))
Expand Down Expand Up @@ -981,6 +981,21 @@ sub lookupNumber()

if ($useTelSearch == 1 && !$isSpeedDial)
{
if (index($qNumber, '+') == 0)
{
# $qNumber= substr($qNumber, 1);
}
else
{
if (index($qNumber, "000") ==0)
{
$qNumber= '+'. substr($qNumber, 3);
}
elsif (index($qNumber, "00") ==0)
{
$qNumber= "+41".substr($qNumber, 2);
}
}
if ($entryFound == 0 && index($qNumber, '+41') == 0 && length($qNumber) > 10 && length($qNumber) < 14 )
{
logdebug("Query tel.search for $qNumber");
Expand Down

0 comments on commit 1f1a009

Please sign in to comment.