Exemplo n.º 1
0
function input_remove()
{
    if (read_config_option("remove_verification") == "on" && !isset($_GET["confirm"])) {
        require_once CACTI_BASE_PATH . "/include/top_header.php";
        form_confirm(_("Are You Sure?"), _("Are you sure you want to delete the input item") . " <strong>'" . db_fetch_cell("select name from graph_template_item_input where id=" . $_GET["id"]) . "'</strong>? NOTE: Deleting this input will <strong>not</strong> affect graphs that use this template.", "graph_templates.php?action=edit&id=" . $_GET["graph_template_id"], "graph_templates_inputs.php?action=remove&id=" . $_GET["id"] . "&graph_template_id=" . $_GET["graph_template_id"]);
        require_once CACTI_BASE_PATH . "/include/bottom_footer.php";
        exit;
    }
    if (read_config_option("remove_verification") == "" || isset($_GET["confirm"])) {
        api_graph_template_item_input_remove($_GET["id"]);
    }
}
Exemplo n.º 2
0
function gprint_presets_remove()
{
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var("id"));
    /* ==================================================== */
    if (read_config_option("deletion_verification") == "on" && !isset($_GET["confirm"])) {
        include_once "./include/top_header.php";
        form_confirm("Are You Sure?", "Are you sure you want to delete the GPRINT preset <strong>'" . htmlspecialchars(db_fetch_cell("select name from graph_templates_gprint where id=" . $_GET["id"])) . "'</strong>? This could affect every graph that uses this preset, make sure you know what you are doing first!", htmlspecialchars("gprint_presets.php"), htmlspecialchars("gprint_presets.php?action=remove&id=" . $_GET["id"]));
        exit;
    }
    if (read_config_option("deletion_verification") == "" || isset($_GET["confirm"])) {
        db_execute("delete from graph_templates_gprint where id=" . $_GET["id"]);
    }
}
Exemplo n.º 3
0
function host_remove()
{
    if (read_config_option("remove_verification") == "on" && !isset($_GET["confirm"])) {
        require_once CACTI_BASE_PATH . "/include/top_header.php";
        form_confirm(_("Are You Sure?"), _("Are you sure you want to delete the host <strong>'") . db_fetch_cell("select description from host where id=" . $_GET["id"]) . "'</strong>?", "devices.php", "devices.php?action=remove&id=" . $_GET["id"]);
        require_once CACTI_BASE_PATH . "/include/bottom_footer.php";
        exit;
    }
    if (read_config_option("remove_verification") == "" || isset($_GET["confirm"])) {
        api_device_remove($_GET["id"]);
    }
}
Exemplo n.º 4
0
function mactrack_site_remove()
{
    global $config;
    /* ================= input validation ================= */
    get_filter_request_var('site_id');
    /* ==================================================== */
    if (read_config_option('remove_verification') == 'on' && !isset_request_var('confirm')) {
        top_header();
        form_confirm(__('Are You Sure?'), __("Are you sure you want to delete the site <strong>'%s'</strong>?", db_fetch_cell('SELECT description FROM host WHERE id=' . get_request_var('device_id'))), 'mactrack_sites.php', 'mactrack_sites.php?action=remove&site_id=' . get_request_var('site_id'));
        bottom_footer();
        exit;
    }
    if (read_config_option('remove_verification') == '' || isset_request_var('confirm')) {
        api_mactrack_site_remove(get_request_var('site_id'));
    }
}
Exemplo n.º 5
0
function host_remove() {
	global $config;

	if ((read_config_option("remove_verification") == "on") && (!isset($_GET["confirm"]))) {
		include("./include/top_header.php");
		form_confirm("Are You Sure?", "Are you sure you want to delete the host <strong>'" . db_fetch_cell("select description from host where id=" . $_GET["id"]) . "'</strong>?", "host.php", "host.php?action=remove&id=" . $_GET["id"]);
		include("./include/bottom_footer.php");
		exit;
	}

	if ((read_config_option("remove_verification") == "") || (isset($_GET["confirm"]))) {
		api_device_remove($_GET["id"]);
	}
}
Exemplo n.º 6
0
function data_query_remove() {
	if ((read_config_option("remove_verification") == "on") && (!isset($_GET["confirm"]))) {
		include("./include/top_header.php");
		form_confirm("Are You Sure?", "Are you sure you want to delete the Data Query <strong>'" . db_fetch_cell("select name from snmp_query where id=" . $_GET["id"]) . "'</strong>?", "data_queries.php", "data_queries.php?action=remove&id=" . $_GET["id"]);
		include("./include/bottom_footer.php");
		exit;
	}

	if ((read_config_option("remove_verification") == "") || (isset($_GET["confirm"]))) {
		$snmp_query_graph = db_fetch_assoc("select id from snmp_query_graph where snmp_query_id=" . $_GET["id"]);

		if (sizeof($snmp_query_graph) > 0) {
		foreach ($snmp_query_graph as $item) {
			db_execute("delete from snmp_query_graph_rrd where snmp_query_graph_id=" . $item["id"]);
		}
		}

		db_execute("delete from snmp_query where id=" . $_GET["id"]);
		db_execute("delete from snmp_query_graph where snmp_query_id=" . $_GET["id"]);
		db_execute("delete from host_template_snmp_query where snmp_query_id=" . $_GET["id"]);
		db_execute("delete from host_snmp_query where snmp_query_id=" . $_GET["id"]);
		db_execute("delete from host_snmp_cache where snmp_query_id=" . $_GET["id"]);
	}
}
Exemplo n.º 7
0
function user_remove() {
	if ((read_config_option("remove_verification") == "on") && (!isset($_GET["confirm"]))) {
		include("./include/top_header.php");
		form_confirm("Are You Sure?", "Are you sure you want to delete the user <strong>'" . db_fetch_cell("select username from user_auth where id=" . $_GET["id"]) . "'</strong>?", "user_admin.php", "user_admin.php?action=user_remove&id=" . $_GET["id"]);
		include("./include/bottom_footer.php");
		exit;
	}

	if ((read_config_option("remove_verification") == "") || (isset($_GET["confirm"]))) {
		db_execute("delete from user_auth where id=" . $_GET["id"]);
		db_execute("delete from user_auth_realm where user_id=" . $_GET["id"]);
		db_execute("delete from user_auth_perms where user_id=" . $_GET["id"]);
		db_execute("delete from settings_graphs where user_id=" . $_GET["id"]);
	}
}
Exemplo n.º 8
0
function item_remove()
{
    if (read_config_option("remove_verification") == "on" && !isset($_GET["confirm"])) {
        $graph_tree_item = db_fetch_row("select title,local_graph_id,host_id from graph_tree_items where id=" . $_GET["id"]);
        if (!empty($graph_tree_item["local_graph_id"])) {
            $text = "Are you sure you want to delete the graph item <strong>'" . db_fetch_cell("select title_cache from graph where id=" . $graph_tree_item["local_graph_id"]) . "'</strong>?";
        } elseif ($graph_tree_item["title"] != "") {
            $text = "Are you sure you want to delete the header item <strong>'" . $graph_tree_item["title"] . "'</strong>?";
        } elseif (!empty($graph_tree_item["host_id"])) {
            $text = "Are you sure you want to delete the host item <strong>'" . db_fetch_cell("select CONCAT_WS('',description,' (',hostname,')') as hostname from host where id=" . $graph_tree_item["host_id"]) . "'</strong>?";
        }
        require_once CACTI_BASE_PATH . "/include/top_header.php";
        form_confirm("Are You Sure?", $text, "graph_trees.php?action=edit&id=" . $_GET["tree_id"], "graph_trees.php?action=item_remove&id=" . $_GET["id"] . "&tree_id=" . $_GET["tree_id"]);
        require_once CACTI_BASE_PATH . "/include/bottom_footer.php";
        exit;
    }
    if (read_config_option("remove_verification") == "" || isset($_GET["confirm"])) {
        delete_branch($_GET["id"]);
    }
    header("Location: graph_trees.php?action=edit&id=" . $_GET["tree_id"]);
    exit;
}
Exemplo n.º 9
0
function cdef_remove()
{
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var("id"));
    /* ==================================================== */
    if (read_config_option("remove_verification") == "on" && !isset($_GET["confirm"])) {
        include "./include/top_header.php";
        form_confirm("Are You Sure?", "Are you sure you want to delete the CDEF <strong>'" . db_fetch_cell("select name from cdef where id=" . $_GET["id"]) . "'</strong>?", "cdef.php", "cdef.php?action=remove&id=" . $_GET["id"]);
        include "./include/bottom_footer.php";
        exit;
    }
    if (read_config_option("remove_verification") == "" || isset($_GET["confirm"])) {
        db_execute("delete from cdef where id=" . $_GET["id"]);
        db_execute("delete from cdef_items where cdef_id=" . $_GET["id"]);
    }
}
Exemplo n.º 10
0
function rra_remove() {
	if ((read_config_option("remove_verification") == "on") && (!isset($_GET["confirm"]))) {
		include_once("./include/top_header.php");
		form_confirm("Are You Sure?", "Are you sure you want to delete the round robin archive <strong>'" . db_fetch_cell("select name from rra where id=" . $_GET["id"]) . "'</strong>?", "rra.php", "rra.php?action=remove&id=" . $_GET["id"]);
		exit;
	}

	if ((read_config_option("remove_verification") == "") || (isset($_GET["confirm"]))) {
		db_execute("delete from rra where id=" . $_GET["id"]);
		db_execute("delete from rra_cf where rra_id=" . $_GET["id"]);
    	}
}
Exemplo n.º 11
0
function cdef_remove() {
	if ((read_config_option("remove_verification") == "on") && (!isset($_GET["confirm"]))) {
		include("./include/top_header.php");
		form_confirm("Are You Sure?", "Are you sure you want to delete the CDEF <strong>'" . db_fetch_cell("select name from cdef where id=" . $_GET["id"]) . "'</strong>?", "cdef.php", "cdef.php?action=remove&id=" . $_GET["id"]);
		include("./include/bottom_footer.php");
		exit;
	}

	if ((read_config_option("remove_verification") == "") || (isset($_GET["confirm"]))) {
		db_execute("delete from cdef where id=" . $_GET["id"]);
		db_execute("delete from cdef_items where cdef_id=" . $_GET["id"]);
	}
}
Exemplo n.º 12
0
function host_remove()
{
    global $config;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var("id"));
    /* ==================================================== */
    /* modify for multi user start */
    if (!check_host($_GET["id"])) {
        access_denied();
    }
    /* modify for multi user end */
    if (read_config_option("deletion_verification") == "on" && !isset($_GET["confirm"])) {
        include "./include/top_header.php";
        form_confirm("Are You Sure?", "Are you sure you want to delete the host <strong>'" . htmlspecialchars(db_fetch_cell("select description from host where id=" . $_GET["id"])) . "'</strong>?", htmlspecialchars("host.php"), htmlspecialchars("host.php?action=remove&id=" . $_GET["id"]));
        include "./include/bottom_footer.php";
        exit;
    }
    if (read_config_option("deletion_verification") == "" || isset($_GET["confirm"])) {
        api_device_remove($_GET["id"]);
    }
}
Exemplo n.º 13
0
function mactrack_utilities_recreate_aggregated_data() {
	global $config, $colors;

	if ((read_config_option("remove_verification") == "on") && (!isset($_GET["confirm"]))) {
		include("./include/top_header.php");
		form_confirm("Are You Sure?", "Are you sure you want to delete and recreate all the Aggregated Port to MAC to IP results from the system?", "mactrack_utilities.php", "mactrack_utilities.php?action=mactrack_utilities_recreate_aggregated_data");
		include("./include/bottom_footer.php");
		exit;
	}


	if ((read_config_option("remove_verification") == "") || (isset($_GET["confirm"]))) {
		$old_rows = db_fetch_cell("SELECT COUNT(*) FROM mac_track_aggregated_ports");
		db_execute("TRUNCATE TABLE mac_track_aggregated_ports");

		db_execute("INSERT INTO mac_track_aggregated_ports
			(site_id, device_id, hostname, device_name,
			vlan_id, vlan_name, mac_address, vendor_mac, ip_address, dns_hostname,
			port_number, port_name, date_last, first_scan_date, count_rec, authorized)
			SELECT site_id, device_id, hostname, device_name,
			vlan_id, vlan_name, mac_address, vendor_mac, ip_address, dns_hostname,
			port_number, port_name, max(scan_date), min(scan_date), count(*), authorized
			FROM mac_track_ports
			GROUP BY site_id,device_id, mac_address, port_number, ip_address, vlan_id, authorized");

		$new_rows = db_fetch_cell("SELECT COUNT(*) FROM mac_track_aggregated_ports");

		include("./include/top_header.php");
		mactrack_utilities();
		html_start_box("<strong>Device Tracking Database Results</strong>", "100%", $colors["header"], "3", "center", "");
		?>
		<td>
			The following number of records have been removed from the aggergated table: <?php print $old_rows;?>. And <?php print $new_rows;?> number of record will be added.
		</td>
		<?php
		html_end_box();
	}
}
Exemplo n.º 14
0
function mactrack_site_remove() {
	global $config;

	/* ================= input validation ================= */
	input_validate_input_number(get_request_var("site_id"));
	/* ==================================================== */

	if ((read_config_option("remove_verification") == "on") && (!isset($_GET["confirm"]))) {
		include("./include/top_header.php");
		form_confirm("Are You Sure?", "Are you sure you want to delete the site <strong>'" . db_fetch_cell("select description from host where id=" . $_GET["device_id"]) . "'</strong>?", "mactrack_sites.php", "mactrack_sites.php?action=remove&site_id=" . $_GET["site_id"]);
		include("./include/bottom_footer.php");
		exit;
	}

	if ((read_config_option("remove_verification") == "") || (isset($_GET["confirm"]))) {
		api_mactrack_site_remove($_GET["site_id"]);
	}
}
Exemplo n.º 15
0
function mactrack_device_remove()
{
    global $config;
    /* ================= input validation ================= */
    get_filter_request_var('device_id');
    get_filter_request_var('type_id');
    /* ==================================================== */
    if (read_config_option('remove_verification') == 'on' && !isset_request_var('confirm')) {
        top_header();
        form_confirm(__('Are You Sure?'), __('Are you sure you want to delete the host %s', db_fetch_cell_prepared('SELECT device_name FROM host WHERE id = ?', array(get_request_var('device_id')))), 'mactrack_devices.php', 'mactrack_devices.php?action=remove&id=' . get_request_var('device_id'));
        bottom_footer();
        exit;
    }
    if (read_config_option('remove_verification') == '' || isset_request_var('confirm')) {
        api_mactrack_device_remove(get_request_var('device_id'));
    }
}
Exemplo n.º 16
0
function site_remove() {
	global $config;

	/* ================= input validation ================= */
	input_validate_input_number(get_request_var("id"));
	/* ==================================================== */

	$devices = db_fetch_cell("SELECT COUNT(*) FROM device WHERE site_id='" . $_REQUEST["site_id"] . "'");

	if ($devices == 0) {
		if ((read_config_option("remove_verification") == CHECKED) && (!isset($_GET["confirm"]))) {
			include("./include/top_header.php");
			form_confirm(__("Are You Sure?"), __("Are you sure you want to delete the site") . " <strong>'" . db_fetch_cell("select description from device where id=" . get_request_var("device_id")) . "'</strong>?", "sites.php", "sites.php?action=remove&id=" . get_request_var("id"));
			include("./include/bottom_footer.php");
			exit;
		}

		if ((read_config_option("remove_verification") == "") || (isset($_GET["confirm"]))) {
			api_site_remove(get_request_var("id"));
		}
	}else{
		display_custom_error_message(__("You can not delete this site while there are devices associated with it."));
	}
}
Exemplo n.º 17
0
function mactrack_snmp_remove()
{
    /* ================= input validation ================= */
    get_filter_request_var('id');
    /* ==================================================== */
    if (read_config_option('deletion_verification') == 'on' && !isset_request_var('confirm')) {
        general_header();
        form_confirm(__('Are You Sure?'), __('Are you sure you want to delete the SNMP Option Set(s) %s?', db_fetch_cell_prepared('SELECT name FROM mactrack WHERE id = ?', array(get_request_var('id')))), 'mactrack_snmp.php', 'mactrack_snmp.php?action=remove&id=' . get_request_var('id'));
        bottom_footer();
        exit;
    }
    if (read_config_option('deletion_verification') == '' || isset_request_var('confirm')) {
        db_execute_prepared('DELETE FROM mac_track_snmp_items WHERE snmp_id = ?', array(get_request_var('id')));
        db_execute_prepared('DELETE FROM mac_track_snmp WHERE id = ?', array(get_request_var('id')));
    }
}
Exemplo n.º 18
0
function input_remove()
{
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var("id"));
    input_validate_input_number(get_request_var("graph_template_id"));
    /* ==================================================== */
    if (read_config_option("deletion_verification") == "on" && !isset($_GET["confirm"])) {
        include "./include/top_header.php";
        form_confirm("Are You Sure?", "Are you sure you want to delete the input item <strong>'" . db_fetch_cell("select name from graph_template_input where id=" . $_GET["id"]) . "'</strong>? NOTE: Deleting this item will NOT affect graphs that use this template.", htmlspecialchars("graph_templates.php?action=template_edit&id=" . $_GET["graph_template_id"]), htmlspecialchars("graph_templates_inputs.php?action=input_remove&id=" . $_GET["id"] . "&graph_template_id=" . $_GET["graph_template_id"]));
        include "./include/bottom_footer.php";
        exit;
    }
    if (read_config_option("deletion_verification") == "" || isset($_GET["confirm"])) {
        db_execute("delete from graph_template_input where id=" . $_GET["id"]);
        db_execute("delete from graph_template_input_defs where graph_template_input_id=" . $_GET["id"]);
    }
}
Exemplo n.º 19
0
function field_remove()
{
    global $registered_cacti_names;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_request('id'));
    input_validate_input_number(get_request_var_request('data_input_id'));
    /* ==================================================== */
    if (read_config_option('deletion_verification') == 'on' && !isset($_REQUEST['confirm'])) {
        top_header();
        form_confirm('Are You Sure?', "Are you sure you want to delete the field <strong>'" . htmlspecialchars(db_fetch_cell_prepared('SELECT name FROM data_input_fields WHERE id = ?', array(get_request_var_request('id'))), ENT_QUOTES) . "'</strong>?", htmlspecialchars('data_input.php?action=edit&id=' . $_REQUEST['data_input_id']), htmlspecialchars('data_input.php?action=field_remove&id=' . $_REQUEST['id'] . '&data_input_id=' . $_REQUEST['data_input_id']));
        bottom_footer();
        exit;
    }
    if (read_config_option('deletion_verification') == '' || isset($_REQUEST['confirm'])) {
        /* get information about the field we're going to delete so we can re-order the seqs */
        $field = db_fetch_row_prepared('SELECT input_output,data_input_id FROM data_input_fields WHERE id = ?', array(get_request_var_request('id')));
        db_execute_prepared('DELETE FROM data_input_fields WHERE id = ?', array(get_request_var_request('id')));
        db_execute_prepared('DELETE FROM data_input_data WHERE data_input_field_id = ?', array(get_request_var_request('id')));
        /* when a field is deleted; we need to re-order the field sequences */
        if ($field['input_output'] == 'in' && preg_match_all('/<([_a-zA-Z0-9]+)>/', db_fetch_cell_prepared('SELECT input_string FROM data_input WHERE id = ?', array($field['data_input_id'])), $matches)) {
            $j = 0;
            for ($i = 0; $i < count($matches[1]); $i++) {
                if (in_array($matches[1][$i], $registered_cacti_names) == false) {
                    $j++;
                    db_execute_prepared("UPDATE data_input_fields SET sequence = ? WHERE data_input_id = ? AND input_output = 'in' AND data_name = ?", array($j, $field['data_input_id'], $matches[1][$i]));
                }
            }
        }
    }
}
Exemplo n.º 20
0
function mactrack_utilities_recreate_aggregated_data()
{
    global $config;
    if (read_config_option('remove_verification') == 'on' && !isset_request_var('confirm')) {
        top_header();
        form_confirm(__('Are You Sure?'), __('Are you sure you want to delete and recreate all the Aggregated Port to MAC to IP results from the system?'), 'mactrack_utilities.php', 'mactrack_utilities.php?action=mactrack_utilities_recreate_aggregated_data');
        bottom_footer();
        exit;
    }
    if (read_config_option('remove_verification') == '' || isset_request_var('confirm')) {
        $old_rows = db_fetch_cell('SELECT COUNT(*) FROM mac_track_aggregated_ports');
        db_execute('TRUNCATE TABLE mac_track_aggregated_ports');
        db_execute('INSERT INTO mac_track_aggregated_ports
			(site_id, device_id, hostname, device_name,
			vlan_id, vlan_name, mac_address, vendor_mac, ip_address, dns_hostname,
			port_number, port_name, date_last, first_scan_date, count_rec, authorized)
			SELECT site_id, device_id, hostname, device_name,
			vlan_id, vlan_name, mac_address, vendor_mac, ip_address, dns_hostname,
			port_number, port_name, max(scan_date), min(scan_date), count(*), authorized
			FROM mac_track_ports
			GROUP BY site_id,device_id, mac_address, port_number, ip_address, vlan_id, authorized');
        $new_rows = db_fetch_cell('SELECT COUNT(*) FROM mac_track_aggregated_ports');
        top_header();
        mactrack_utilities();
        html_start_box('Device Tracking Database Results', '100%', '', '3', 'center', '');
        ?>
		<td>
			The following number of records have been removed from the aggergated table: <?php 
        print $old_rows;
        ?>
. And <?php 
        print $new_rows;
        ?>
 number of record will be added.
		</td>
		<?php 
        html_end_box();
    }
}
Exemplo n.º 21
0
function host_remove()
{
    global $config;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var("id"));
    /* ==================================================== */
    if (read_config_option("deletion_verification") == "on" && !isset($_GET["confirm"])) {
        include "./include/top_header.php";
        form_confirm("Are You Sure?", "Are you sure you want to delete the host <strong>'" . db_fetch_cell("select description from host where id=" . $_GET["id"]) . "'</strong>?", "host.php", "host.php?action=remove&id=" . $_GET["id"]);
        include "./include/bottom_footer.php";
        exit;
    }
    if (read_config_option("deletion_verification") == "" || isset($_GET["confirm"])) {
        api_device_remove($_GET["id"]);
    }
}
Exemplo n.º 22
0
function field_remove()
{
    global $registered_cacti_names;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var("id"));
    input_validate_input_number(get_request_var("data_input_id"));
    /* ==================================================== */
    if (read_config_option("deletion_verification") == "on" && !isset($_GET["confirm"])) {
        include "./include/top_header.php";
        form_confirm("Are You Sure?", "Are you sure you want to delete the field <strong>'" . db_fetch_cell("select name from data_input_fields where id=" . $_GET["id"]) . "'</strong>?", "data_input.php?action=edit&id=" . $_GET["data_input_id"], "data_input.php?action=field_remove&id=" . $_GET["id"] . "&data_input_id=" . $_GET["data_input_id"]);
        include "./include/bottom_footer.php";
        exit;
    }
    if (read_config_option("deletion_verification") == "" || isset($_GET["confirm"])) {
        /* get information about the field we're going to delete so we can re-order the seqs */
        $field = db_fetch_row("select input_output,data_input_id from data_input_fields where id=" . $_GET["id"]);
        db_execute("delete from data_input_fields where id=" . $_GET["id"]);
        db_execute("delete from data_input_data where data_input_field_id=" . $_GET["id"]);
        /* when a field is deleted; we need to re-order the field sequences */
        if ($field["input_output"] == "in" && preg_match_all("/<([_a-zA-Z0-9]+)>/", db_fetch_cell("select input_string from data_input where id=" . $field["data_input_id"]), $matches)) {
            $j = 0;
            for ($i = 0; $i < count($matches[1]); $i++) {
                if (in_array($matches[1][$i], $registered_cacti_names) == false) {
                    $j++;
                    db_execute("update data_input_fields set sequence={$j} where data_input_id=" . $field["data_input_id"] . " and input_output='in' and data_name='" . $matches[1][$i] . "'");
                }
            }
        }
    }
}
Exemplo n.º 23
0
function data_query_item_remove() {
	/* ================= input validation ================= */
	input_validate_input_number(get_request_var("id"));
	input_validate_input_number(get_request_var("snmp_query_id"));
	/* ==================================================== */

	if ((read_config_option("deletion_verification") == "on") && (!isset($_GET["confirm"]))) {
		include("./include/top_header.php");
		form_confirm("Are You Sure?", "Are you sure you want to delete the Data Query Graph <strong>'" . db_fetch_cell("select name from snmp_query_graph where id=" . $_GET["id"]) . "'</strong>?", "data_queries.php?action=edit&id=" . $_GET["snmp_query_id"], "data_queries.php?action=item_remove&id=" . $_GET["id"] . "&snmp_query_id=" . $_GET["snmp_query_id"]);
		include("./include/bottom_footer.php");
		exit;
	}

	if ((read_config_option("deletion_verification") == "") || (isset($_GET["confirm"]))) {
		db_execute("delete from snmp_query_graph where id=" . $_GET["id"]);
		db_execute("delete from snmp_query_graph_rrd where snmp_query_graph_id=" . $_GET["id"]);
		db_execute("delete from snmp_query_graph_rrd_sv where snmp_query_graph_id=" . $_GET["id"]);
		db_execute("delete from snmp_query_graph_sv where snmp_query_graph_id=" . $_GET["id"]);
	}
}
Exemplo n.º 24
0
function data_query_item_remove()
{
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_request('id'));
    input_validate_input_number(get_request_var_request('snmp_query_id'));
    /* ==================================================== */
    if (read_config_option('deletion_verification') == 'on' && !isset($_REQUEST['confirm'])) {
        top_header();
        form_confirm('Are You Sure?', "Are you sure you want to delete the Data Query Graph <strong>'" . htmlspecialchars(db_fetch_cell_prepared('SELECT name FROM snmp_query_graph WHERE id = ?', array($_REQUEST['id'])), ENT_QUOTES) . "'</strong>?", htmlspecialchars('data_queries.php?action=edit&id=' . $_REQUEST['snmp_query_id']), htmlspecialchars('data_queries.php?action=item_remove&id=' . $_REQUEST['id'] . '&snmp_query_id=' . $_REQUEST['snmp_query_id']));
        bottom_footer();
        exit;
    }
    if (read_config_option('deletion_verification') == '' || isset($_REQUEST['confirm'])) {
        db_execute_prepared('DELETE FROM snmp_query_graph WHERE id = ?', array($_REQUEST['id']));
        db_execute_prepared('DELETE FROM snmp_query_graph_rrd WHERE snmp_query_graph_id = ?', array($_REQUEST['id']));
        db_execute_prepared('DELETE FROM snmp_query_graph_rrd_sv WHERE snmp_query_graph_id = ?', array($_REQUEST['id']));
        db_execute_prepared('DELETE FROM snmp_query_graph_sv WHERE snmp_query_graph_id = ?', array($_REQUEST['id']));
    }
}
Exemplo n.º 25
0
function input_remove() {
	if ((read_config_option("remove_verification") == "on") && (!isset($_GET["confirm"]))) {
		include("./include/top_header.php");
		form_confirm("Are You Sure?", "Are you sure you want to delete the input item <strong>'" . db_fetch_cell("select name from graph_template_input where id=" . $_GET["id"]) . "'</strong>? NOTE: Deleting this item will NOT affect graphs that use this template.", "graph_templates.php?action=template_edit&id=" . $_GET["graph_template_id"], "graph_templates_inputs.php?action=input_remove&id=" . $_GET["id"] . "&graph_template_id=" . $_GET["graph_template_id"]);
		include("./include/bottom_footer.php");
		exit;
	}

	if ((read_config_option("remove_verification") == "") || (isset($_GET["confirm"]))) {
		db_execute("delete from graph_template_input where id=" . $_GET["id"]);
		db_execute("delete from graph_template_input_defs where graph_template_input_id=" . $_GET["id"]);
	}
}
Exemplo n.º 26
0
function tree_remove()
{
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var("id"));
    /* ==================================================== */
    if (read_config_option("deletion_verification") == "on" && !isset($_GET["confirm"])) {
        include "./include/top_header.php";
        form_confirm("Are You Sure?", "Are you sure you want to delete the tree <strong>'" . db_fetch_cell("select name from graph_tree where id=" . $_GET["id"]) . "'</strong>?", "tree.php", "tree.php?action=remove&id=" . $_GET["id"]);
        include "./include/bottom_footer.php";
        exit;
    }
    if (read_config_option("deletion_verification") == "" || isset($_GET["confirm"])) {
        db_execute("delete from graph_tree where id=" . $_GET["id"]);
        db_execute("delete from graph_tree_items where graph_tree_id=" . $_GET["id"]);
    }
    /* clear graph tree cache on save - affects current user only, other users should see changes in <5 minutes */
    if (isset($_SESSION['dhtml_tree'])) {
        unset($_SESSION['dhtml_tree']);
    }
}
Exemplo n.º 27
0
function tree_remove() {
	/* ================= input validation ================= */
	input_validate_input_number(get_request_var("id"));
	/* ==================================================== */

	if ((read_config_option("remove_verification") == "on") && (!isset($_GET["confirm"]))) {
		include("./include/top_header.php");
		form_confirm("Are You Sure?", "Are you sure you want to delete the tree <strong>'" . db_fetch_cell("select name from graph_tree where id=" . $_GET["id"]) . "'</strong>?", "tree.php", "tree.php?action=remove&id=" . $_GET["id"]);
		include("./include/bottom_footer.php");
		exit;
	}

	if ((read_config_option("remove_verification") == "") || (isset($_GET["confirm"]))) {
		db_execute("delete from graph_tree where id=" . $_GET["id"]);
		db_execute("delete from graph_tree_items where graph_tree_id=" . $_GET["id"]);
	}
}
Exemplo n.º 28
0
function user_remove()
{
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var("id"));
    /* ==================================================== */
    if (read_config_option("remove_verification") == "on" && !isset($_GET["confirm"])) {
        include "./include/top_header.php";
        form_confirm("Are You Sure?", "Are you sure you want to delete the user <strong>'" . db_fetch_cell("select username from user_auth where id=" . $_GET["id"]) . "'</strong>?", "user_admin.php", "user_admin.php?action=user_remove&id=" . $_GET["id"]);
        include "./include/bottom_footer.php";
        exit;
    }
    if (read_config_option("remove_verification") == "" || isset($_GET["confirm"])) {
        db_execute("delete from user_auth where id=" . $_GET["id"]);
        db_execute("delete from user_auth_realm where user_id=" . $_GET["id"]);
        db_execute("delete from user_auth_perms where user_id=" . $_GET["id"]);
        db_execute("delete from settings_graphs where user_id=" . $_GET["id"]);
    }
}
Exemplo n.º 29
0
Arquivo: host.php Projeto: MrWnn/cacti
function host_remove()
{
    global $config;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_request('id'));
    /* ==================================================== */
    if (read_config_option('deletion_verification') == 'on' && !isset($_REQUEST['confirm'])) {
        top_header();
        form_confirm('Are You Sure?', "Are you sure you want to delete the host <strong>'" . htmlspecialchars(db_fetch_cell_prepared('SELECT description FROM host WHERE id = ?', array($_REQUEST['id']))) . "'</strong>?", htmlspecialchars('host.php'), htmlspecialchars('host.php?action=remove&id=' . $_REQUEST['id']));
        bottom_footer();
        exit;
    }
    if (read_config_option('deletion_verification') == '' || isset($_REQUEST['confirm'])) {
        api_device_remove($_REQUEST['id']);
    }
}
Exemplo n.º 30
0
function rra_remove()
{
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var("id"));
    /* ==================================================== */
    if (read_config_option("deletion_verification") == "on" && !isset($_GET["confirm"])) {
        include_once "./include/top_header.php";
        form_confirm("Are You Sure?", "Are you sure you want to delete the round robin archive <strong>'" . htmlspecialchars(db_fetch_cell("select name from rra where id=" . $_GET["id"])) . "'</strong>?", htmlspecialchars("rra.php"), htmlspecialchars("rra.php?action=remove&id=" . $_GET["id"]));
        exit;
    }
    if (read_config_option("deletion_verification") == "" || isset($_GET["confirm"])) {
        db_execute("delete from rra where id=" . $_GET["id"]);
        db_execute("delete from rra_cf where rra_id=" . $_GET["id"]);
    }
}