diff --git a/app/devices/device_profile_delete.php b/app/devices/device_profile_delete.php deleted file mode 100644 index 6a20146b37..0000000000 --- a/app/devices/device_profile_delete.php +++ /dev/null @@ -1,100 +0,0 @@ - - Copyright (C) 2019 All Rights Reserved. - - Contributor(s): - Mark J Crane -*/ - -//includes - require_once "root.php"; - require_once "resources/require.php"; - require_once "resources/check_auth.php"; - -//add multi-lingual support - $language = new text; - $text = $language->get(); - -//delete the message - message::add($text['message-delete']); - -//delete the data - if (isset($_GET["id"]) && is_uuid($_GET["id"]) && permission_exists('device_profile_delete')) { - - //get the id - $id = $_GET["id"]; - - //delete the data - $array['device_profile_keys'][]['device_profile_uuid'] = $id; - $array['device_profile_settings'][]['device_profile_uuid'] = $id; - $array['device_profiles'][]['device_profile_uuid'] = $id; - $database = new database; - $database->app_name = 'devices'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; - $database->delete($array); - unset($array); - - //redirect the user - header('Location: device_profiles.php'); - } - -//delete the child data - if (isset($_REQUEST["device_profile_key_uuid"]) && is_uuid($_REQUEST["device_profile_key_uuid"]) && permission_exists('device_profile_key_delete')) { - //select from v_device_profile_keys - $sql = "select device_profile_uuid from v_device_profile_keys "; - $sql .= "where device_profile_key_uuid = :device_profile_key_uuid "; - $parameters['device_profile_key_uuid'] = $_REQUEST["device_profile_key_uuid"]; - $database = new database; - $device_profile_uuid = $database->select($sql, $parameters, 'column'); - unset($sql, $parameters); - - //delete the row - $array['device_profile_keys'][]['device_profile_key_uuid'] = $_REQUEST["device_profile_key_uuid"]; - $database = new database; - $database->app_name = 'devices'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; - $database->delete($array); - - //redirect the user - header('Location: device_profile_edit.php?id='.urlencode($device_profile_uuid)); - } - -//delete the child data - if (isset($_REQUEST["device_profile_setting_uuid"]) && is_uuid($_REQUEST["device_profile_setting_uuid"]) && permission_exists('device_profile_setting_delete')) { - //select from v_device_profile_settings - $sql = "select device_profile_uuid from v_device_profile_settings "; - $sql .= "where device_profile_setting_uuid = :device_profile_setting_uuid "; - $parameters['device_profile_setting_uuid'] = $_REQUEST["device_profile_setting_uuid"]; - $database = new database; - $device_profile_uuid = $database->select($sql, $parameters, 'column'); - unset($sql, $parameters); - - //delete the row - $array['device_profile_settings'][]['device_profile_setting_uuid'] = $_REQUEST["device_profile_setting_uuid"]; - $database = new database; - $database->app_name = 'devices'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; - $database->delete($array); - - //redirect the user - header('Location: device_profile_edit.php?id='.urlencode($device_profile_uuid)); - } - -?>