diff --git a/app/calls/call_edit.php b/app/calls/call_edit.php index b8f49bce95..070eae7eff 100644 --- a/app/calls/call_edit.php +++ b/app/calls/call_edit.php @@ -113,10 +113,10 @@ unset ($prep_statement); //process post vars - if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { + if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //get http post variables and set them to php variables - if (count($_POST)>0) { + if (count($_POST) > 0) { $forward_all_enabled = check_str($_POST["forward_all_enabled"]); $forward_all_destination = check_str($_POST["forward_all_destination"]); $forward_busy_enabled = check_str($_POST["forward_busy_enabled"]); @@ -246,6 +246,10 @@ $array['follow_me'][] = $follow_me; } + //add the dialplan permission + $p = new permissions; + $p->add("extension_edit", "temp"); + //save the data $database = new database; $database->app_name = 'call_routing'; @@ -253,6 +257,9 @@ $database->save($array); //$message = $database->message; + //remove the temporary permission + $p->delete("extension_edit", "temp"); + //delete empty destination records if (is_array($follow_me_delete_uuids) && sizeof($follow_me_delete_uuids) > 0) { $sql = "delete from v_follow_me_destinations where follow_me_destination_uuid in ('".implode("','", $follow_me_delete_uuids)."') ";