From d36523f51b826dffec90d04901cf683e4d540158 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 2 Oct 2019 12:28:11 -0600 Subject: [PATCH] Delete ring_group_destination_edit.php --- .../ring_group_destination_edit.php | 282 ------------------ 1 file changed, 282 deletions(-) delete mode 100644 app/ring_groups/ring_group_destination_edit.php diff --git a/app/ring_groups/ring_group_destination_edit.php b/app/ring_groups/ring_group_destination_edit.php deleted file mode 100644 index 2ed48fcc95..0000000000 --- a/app/ring_groups/ring_group_destination_edit.php +++ /dev/null @@ -1,282 +0,0 @@ - - Portions created by the Initial Developer are Copyright (C) 2013 - the Initial Developer. All Rights Reserved. - - Contributor(s): - Mark J Crane -*/ -require_once "root.php"; -require_once "resources/require.php"; -require_once "resources/check_auth.php"; -if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) { - //access granted -} -else { - echo "access denied"; - exit; -} - -//add multi-lingual support - $language = new text; - $text = $language->get(); - -//action add or update - if (is_uuid($_REQUEST["id"])) { - $action = "update"; - $ring_group_destination_uuid = $_REQUEST["id"]; - } - else { - $action = "add"; - } - -//set the parent uuid - if (is_uuid($_GET["ring_group_uuid"])) { - $ring_group_uuid = $_GET["ring_group_uuid"]; - } - -//get http post variables and set them to php variables - if (count($_POST)>0) { - $ring_group_uuid = $_POST["ring_group_uuid"]; - $destination_number = $_POST["destination_number"]; - $destination_delay = $_POST["destination_delay"]; - $destination_timeout = $_POST["destination_timeout"]; - $destination_prompt = $_POST["destination_prompt"]; - } - -//define the destination_select function - function destination_select($select_name, $select_value, $select_default) { - if (strlen($select_value) == 0) { $select_value = $select_default; } - echo " \n"; - } - -if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { - - $msg = ''; - if ($action == "update") { - $ring_group_destination_uuid = $_POST["ring_group_destination_uuid"]; - } - - //validate the token - $token = new token; - if (!$token->validate($_SERVER['PHP_SELF'])) { - message::add($text['message-invalid_token'],'negative'); - header('Location: ring_groups.php'); - exit; - } - - //check for all required data - //if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."
\n"; } - //if (strlen($ring_group_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-ring_group_uuid']."
\n"; } - //if (strlen($destination_number) == 0) { $msg .= $text['message-required']." ".$text['label-destination_number']."
\n"; } - //if (strlen($destination_delay) == 0) { $msg .= $text['message-required']." ".$text['label-destination_delay']."
\n"; } - //if (strlen($destination_timeout) == 0) { $msg .= $text['message-required']." ".$text['label-destination_timeout']."
\n"; } - //if (strlen($destination_prompt) == 0) { $msg .= $text['message-required']." ".$text['label-destination_prompt']."
\n"; } - if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { - require_once "resources/header.php"; - require_once "resources/persistformvar.php"; - echo "
\n"; - echo "
\n"; - echo $msg."
"; - echo "
\n"; - persistformvar($_POST); - echo "
\n"; - require_once "resources/footer.php"; - return; - } - - //add or update the database - if ($_POST["persistformvar"] != "true") { - if ($action == "add" && permission_exists('ring_group_add')) { - //begin array - $ring_group_destination_uuid = uuid(); - $array['ring_group_destinations'][0]['ring_group_destination_uuid'] = $ring_group_destination_uuid; - //grant temporary permissions - $p = new permissions; - $p->add('ring_group_destination_add', 'temp'); - //set message - message::add($text['message-add']); - } - - if ($action == "update" && permission_exists('ring_group_edit')) { - //begin array - $array['ring_group_destinations'][0]['ring_group_destination_uuid'] = $ring_group_destination_uuid; - //grant temporary permissions - $p = new permissions; - $p->add('ring_group_destination_edit', 'temp'); - //set message - message::add($text['message-update']); - } - - if (is_array($array) && @sizeof($array) != 0) { - //add common array elements - $array['ring_group_destinations'][0]['domain_uuid'] = $domain_uuid; - $array['ring_group_destinations'][0]['ring_group_uuid'] = $ring_group_uuid; - $array['ring_group_destinations'][0]['destination_number'] = $destination_number; - $array['ring_group_destinations'][0]['destination_delay'] = $destination_delay; - $array['ring_group_destinations'][0]['destination_timeout'] = $destination_timeout; - $array['ring_group_destinations'][0]['destination_prompt'] = strlen($destination_prompt) != 0 ? $destination_prompt : null; - //execute insert/update - $database = new database; - $database->app_name = 'ring_groups'; - $database->app_uuid = '1d61fb65-1eec-bc73-a6ee-a6203b4fe6f2'; - $database->save($array); - unset($array); - //revoke temporary permissions - $p->delete('ring_group_destination_add', 'temp'); - $p->delete('ring_group_destination_edit', 'temp'); - //redirect - header("Location: ring_group_edit.php?id=".$ring_group_uuid); - exit; - } - } - -} - -//pre-populate the form - if (count($_GET)>0 && $_POST["persistformvar"] != "true") { - $ring_group_destination_uuid = $_GET["id"]; - $sql = "select * from v_ring_group_destinations "; - $sql .= "where domain_uuid = :domain_uuid "; - $sql .= "and ring_group_destination_uuid = :ring_group_destination_uuid "; - $parameters['domain_uuid'] = $domain_uuid; - $parameters['ring_group_destination_uuid'] = $ring_group_destination_uuid; - $database = new database; - $row = $database->select($sql, $parameters, 'row'); - if (is_array($row) && @sizeof($row) != 0) { - $ring_group_uuid = $row["ring_group_uuid"]; - $destination_number = $row["destination_number"]; - $destination_delay = $row["destination_delay"]; - $destination_timeout = $row["destination_timeout"]; - $destination_prompt = $row["destination_prompt"]; - } - unset($sql, $parameters, $row); - } - -//create token - $object = new token; - $token = $object->create($_SERVER['PHP_SELF']); - -//show the header - require_once "resources/header.php"; - -//show the content - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - if (permission_exists('ring_group_prompt')) { - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - echo " \n"; - echo " \n"; - echo " "; - echo "
".$text['title-ring_group_destination'].""; - echo " "; - echo " \n"; - echo "
\n"; - echo " ".$text['label-destination_number']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-destination_number']."\n"; - echo "
\n"; - echo " ".$text['label-destination_delay']."\n"; - echo "\n"; - destination_select('destination_delay', $destination_delay, '0'); - //echo " \n"; - echo "
\n"; - echo $text['description-destination_delay']."\n"; - echo "
\n"; - echo " ".$text['label-destination_timeout']."\n"; - echo "\n"; - destination_select('destination_timeout', $destination_timeout, '30'); - //echo " \n"; - echo "
\n"; - echo $text['description-destination_timeout']."\n"; - echo "
\n"; - echo " ".$text['label-destination_prompt']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-destination_prompt']."\n"; - echo "
\n"; - echo " \n"; - if ($action == "update") { - echo " \n"; - } - echo " \n"; - echo "
"; - echo " \n"; - echo "
"; - echo "

"; - echo "
"; - -//include the footer - require_once "resources/footer.php"; - -?> \ No newline at end of file