Since the the MAC address has been normalized need to add this for compatibility. A better solution in the future the extension provisioning_list will get its own table.

This commit is contained in:
Mark Crane 2012-07-05 18:56:26 +00:00
parent 4cc8b89fe5
commit 6528f53986
2 changed files with 10 additions and 4 deletions

View File

@ -295,10 +295,13 @@ require_once "includes/require.php";
$file_contents = str_replace("{v_time_zone_offset}", $time_zone_offset, $file_contents);
}
//create a mac address with back slashes for backwards compatability
$mac_dash = substr($mac, 0,2).'-'.substr($mac, 2,2).'-'.substr($mac, 4,2).'-'.substr($mac, 6,2).'-'.substr($mac, 8,2).'-'.substr($mac, 10,2);
//lookup the provisioning information for this MAC address.
$sql = "select * from v_extensions ";
$sql .= "where provisioning_list like '%|".$mac.":%' ";
$sql .= "and domain_uuid = '$domain_uuid' ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and (provisioning_list like '%|".$mac.":%' or provisioning_list like '%|".$mac_dash.":%') ";
$sql .= "and enabled = 'true' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();

View File

@ -193,10 +193,13 @@ else {
}
}
//create a mac address with back slashes for backwards compatability
$mac_dash = substr($phone_mac_address, 0,2).'-'.substr($phone_mac_address, 2,2).'-'.substr($phone_mac_address, 4,2).'-'.substr($phone_mac_address, 6,2).'-'.substr($phone_mac_address, 8,2).'-'.substr($phone_mac_address, 10,2);
//lookup the provisioning information for this MAC address.
$sql2 = "select * from v_extensions ";
$sql2 .= "where provisioning_list like '%$phone_mac_address%' ";
$sql2 .= "and domain_uuid = '$domain_uuid' ";
$sql2 .= "where domain_uuid = '$domain_uuid' ";
$sql2 .= "and (provisioning_list like '%|".$phone_mac_address.":%' or provisioning_list like '%|".$mac_dash.":%') ";
$sql2 .= "and enabled = 'true' ";
$prep_statement_2 = $db->prepare(check_sql($sql2));
$prep_statement_2->execute();