Update extension_edit.php (#3473)

Added code to update device_key_label on devices that have the extension set as BLF/etc. when an extensions effective_caller_id_name is changed.
This commit is contained in:
dougstamp 2019-01-05 10:02:31 -06:00 committed by FusionPBX
parent 868ee6cd28
commit a3f1df75fe
1 changed files with 9 additions and 1 deletions

View File

@ -452,7 +452,15 @@
$db->exec(check_sql($sql));
unset($sql);
}
//update device key label
if (strlen($effective_caller_id_name) > 0) {
$sql = "update v_device_keys set ";
$sql .= "device_key_label = '".$effective_caller_id_name."' ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and device_key_value = '".$extension."' ";
$db->exec(check_sql($sql));
unset($sql);
}
//assign the user to the extension
if ($action == "update" && strlen($_POST["extension_users"][0]["user_uuid"]) > 0) {
$array["extension_users"][0]["extension_user_uuid"] = uuid();