Update provision.php (#2753)

Some extensions are accessible to multiple users.  Sort the list to select best directory name match for extension.
This commit is contained in:
Dean Montgomery 2017-09-01 08:30:50 -07:00 committed by FusionPBX
parent 301397c832
commit 7825423719
1 changed files with 1 additions and 0 deletions

View File

@ -366,6 +366,7 @@ include "root.php";
$sql .= "AND e.enabled = 'true' ";
$sql .= "AND e.directory_visible = 'true' "; # TODO: not right field but it works for our district.
$sql .= "AND e.directory_exten_visible = 'true' "; # TODO: not right field but it works for our district.
$sql .= "ORDER BY CASE WHEN directory_full_name LIKE '%".$contact['contact_name_given']."%' THEN 1 ELSE 2 END DESC ";
$prep_statement = $this->db->prepare(check_sql($sql));
$prep_statement->execute();
$user_extentions = $prep_statement->fetchAll(PDO::FETCH_NAMED);