From 5a45e9d7c42219779e6a2a7ed777e7f85d3bd45c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 12 Aug 2019 19:21:10 -0600 Subject: [PATCH] Delete service_edit.php --- app/services/service_edit.php | 295 ---------------------------------- 1 file changed, 295 deletions(-) delete mode 100644 app/services/service_edit.php diff --git a/app/services/service_edit.php b/app/services/service_edit.php deleted file mode 100644 index 674a4aa45d..0000000000 --- a/app/services/service_edit.php +++ /dev/null @@ -1,295 +0,0 @@ - - Portions created by the Initial Developer are Copyright (C) 2008-2018 - the Initial Developer. All Rights Reserved. - - Contributor(s): - Mark J Crane - James Rose -*/ -require_once "root.php"; -require_once "resources/require.php"; -require_once "resources/check_auth.php"; -if (permission_exists('service_add') || permission_exists('service_edit')) { - //access granted -} -else { - echo "access denied"; - exit; -} - -//add multi-lingual support - $language = new text; - $text = $language->get(); - -//action add or update - if (isset($_REQUEST["id"])) { - $action = "update"; - $service_uuid = check_str($_REQUEST["id"]); - } - else { - $action = "add"; - } - -//get http post and set it to php variables - if (count($_POST)>0) { - $service_name = check_str($_POST["service_name"]); - $service_type = check_str($_POST["service_type"]); - $service_data = check_str($_POST["service_data"]); - $service_cmd_start = check_str($_POST["service_cmd_start"]); - $service_cmd_stop = check_str($_POST["service_cmd_stop"]); - $service_description = check_str($_POST["service_description"]); - } - -if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { - - $msg = ''; - if ($action == "update") { - $service_uuid = check_str($_POST["service_uuid"]); - } - - //check for all required data - //if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid
\n"; } - if (strlen($service_name) == 0) { $msg .= "Please provide: Name
\n"; } - //if (strlen($service_type) == 0) { $msg .= "Please provide: Type
\n"; } - //if (strlen($service_data) == 0) { $msg .= "Please provide: Data
\n"; } - //if (strlen($service_cmd_start) == 0) { $msg .= "Please provide: Start Command
\n"; } - //if (strlen($service_cmd_stop) == 0) { $msg .= "Please provide: Stop Command
\n"; } - //if (strlen($service_description) == 0) { $msg .= "Please provide: Description
\n"; } - if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { - require_once "resources/header.php"; - require_once "resources/persist_form_var.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('service_add')) { - $service_uuid = uuid(); - $sql = "insert into v_services "; - $sql .= "("; - $sql .= "domain_uuid, "; - $sql .= "service_uuid, "; - $sql .= "service_name, "; - $sql .= "service_type, "; - $sql .= "service_data, "; - $sql .= "service_cmd_start, "; - $sql .= "service_cmd_stop, "; - $sql .= "service_description "; - $sql .= ")"; - $sql .= "values "; - $sql .= "("; - $sql .= "'$domain_uuid', "; - $sql .= "'$service_uuid', "; - $sql .= "'$service_name', "; - $sql .= "'$service_type', "; - $sql .= "'$service_data', "; - $sql .= "'$service_cmd_start', "; - $sql .= "'$service_cmd_stop', "; - $sql .= "'$service_description' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); - - message::add($text['message-add']); - header("Location: services.php"); - return; - } //if ($action == "add") - - if ($action == "update" && permission_exists('service_edit')) { - $sql = "update v_services set "; - $sql .= "service_name = '$service_name', "; - $sql .= "service_type = '$service_type', "; - $sql .= "service_data = '$service_data', "; - $sql .= "service_cmd_start = '$service_cmd_start', "; - $sql .= "service_cmd_stop = '$service_cmd_stop', "; - $sql .= "service_description = '$service_description' "; - $sql .= "where service_uuid = '$service_uuid' "; - // $sql .= "and domain_uuid = '$domain_uuid'"; - $db->exec(check_sql($sql)); - unset($sql); - - message::add($text['message-update']); - header("Location: services.php"); - return; - } //if ($action == "update") - } //if ($_POST["persistformvar"] != "true") -} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) - -//pre-populate the form - if (count($_GET)>0 && $_POST["persistformvar"] != "true") { - $service_uuid = $_GET["id"]; - $sql = "select * from v_services "; - $sql .= "where service_uuid = '$service_uuid' "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); - foreach ($result as &$row) { - $domain_uuid = $row["domain_uuid"]; - $service_name = $row["service_name"]; - $service_type = $row["service_type"]; - $service_data = $row["service_data"]; - $service_cmd_start = $row["service_cmd_start"]; - $service_cmd_stop = $row["service_cmd_stop"]; - $service_description = $row["service_description"]; - break; //limit to 1 row - } - unset ($prep_statement); - } - -//show the header - require_once "resources/header.php"; - -//begin the content - echo "
\n"; - echo "\n"; - echo "\n"; - if ($action == "add") { - echo "\n"; - } - if ($action == "update") { - 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"; - - 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 " "; - echo "
".$text['title']."Service Edit"; - echo " "; - echo " \n"; - echo "
\n"; - echo $text['description']."

\n"; - echo "
\n"; - echo " ".$text['label-name']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-name']."\n"; - echo "
\n"; - echo " ".$text['label-type']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-type']."\n"; - echo "
\n"; - echo " ".$text['label-data']."\n"; - echo "\n"; - echo " \n"; - //echo " \n"; - echo "
\n"; - echo $text['description-data']."\n"; - echo "
\n"; - echo " ".$text['label-start_command']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-start_command']."\n"; - echo "
\n"; - echo " ".$text['label-stop_command']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-stop_command']."\n"; - echo "
\n"; - echo " ".$text['label-description']."\n"; - echo "\n"; - echo " \n"; - echo "
\n"; - echo $text['description-description']."\n"; - echo "
\n"; - if ($action == "update") { - echo " \n"; - } - echo "
"; - echo " \n"; - echo "
"; - echo "

"; - echo "
"; - -//show the footer - require_once "resources/footer.php"; -?>