From 47729bc71d17c9cea7cb82e52fe7543c66d5292f Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 6 Sep 2019 05:28:27 -0600 Subject: [PATCH] Update destination_edit.php --- app/destinations/destination_edit.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index ec0f72e5ec..55060bf939 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -218,15 +218,21 @@ unset($sql, $parameters, $row); } - //get the destination_number - if ($action == 'update' && !permission_exists('destination_number') && is_uuid($destination_uuid)) { + //if the user doesn't have the correct permission then + //override destination_number and destination_context values + if ($action == 'update' && is_uuid($destination_uuid)) { $sql = "select * from v_destinations "; $sql .= "where destination_uuid = :destination_uuid "; $parameters['destination_uuid'] = $destination_uuid; $database = new database; $row = $database->select($sql, $parameters, 'row'); if (is_array($row) && @sizeof($row) != 0) { - $destination_number = $row["destination_number"]; + if (!permission_exists('destination_number')) { + $destination_number = $row["destination_number"]; + } + if (!permission_exists('destination_context')) { + $destination_context = $row["destination_context"]; + } } unset($sql, $parameters, $row); }