Get the destination_number when needed

If the user doesn't have permission to set the destination_number then get it from the database
This commit is contained in:
FusionPBX 2023-04-10 12:09:14 -06:00 committed by GitHub
parent 800e742387
commit dbeb793710
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -171,6 +171,16 @@
$destination_number = trim($destination_number);
}
//if the user doesn't have permission to set the destination_number then get it from the database
if (is_uuid($destination_uuid) && !permission_exists('destination_number')) {
$sql = "select destination_number from v_destinations ";
$sql .= "where destination_uuid = :destination_uuid ";
$parameters['destination_uuid'] = $destination_uuid;
$database = new database;
$destination_number = $database->select($sql, $parameters, 'column');
unset($sql, $parameters, $num_rows);
}
//check for all required data
$msg = '';
if (strlen($destination_type) == 0) { $msg .= $text['message-required']." ".$text['label-destination_type']."<br>\n"; }