the last checkin removed hostname from the address for autocomplete searches. This one allows it if explicitly added with a '@'. So 'mike' will find all mikes. 'mike@z' will find mike@zothub but not mike@popcorn.
This commit is contained in:
parent
91cb76aa99
commit
3983348b96
@ -30,7 +30,7 @@ function acl_init(&$a){
|
||||
|
||||
if ($search != "") {
|
||||
$sql_extra = " AND `name` LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
|
||||
$sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc($search) . "%@%'" ) . ") ";
|
||||
$sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc($search) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") ";
|
||||
|
||||
// This horrible mess is needed because position also returns 0 if nothing is found. W/ould be MUCH easier if it instead returned a very large value
|
||||
// Otherwise we could just order by LEAST(POSTION($search IN xchan_name),POSITION($search IN xchan_addr)).
|
||||
|
Reference in New Issue
Block a user