Ejemplo n.º 1
0
		print "<strong><font size='+1' color='FF0000'>YOU DO NOT HAVE RIGHTS FOR TREE VIEW</font></strong>"; exit;
	}

	/* if cacti's builtin authentication is turned on then make sure to take
	graph permissions into account here. if a user does not have rights to a
	particular graph; do not show it. they will get an access denied message
	if they try and view the graph directly. */

	$access_denied = false;
	$tree_parameters = array();

	if ((!isset($_GET["tree_id"])) && (isset($_SESSION['dhtml_tree']))) {
		unset($_SESSION["dhtml_tree"]);
	}

	$tree_dropdown_html = draw_tree_dropdown((isset($_GET["tree_id"]) ? $_GET["tree_id"] : "0"));

	/* don't even print the table if there is not >1 tree */
	if ((!empty($tree_dropdown_html)) && (read_graph_config_option("default_tree_view_mode") == "1")) {
		print "
		<br>
		<table width='100%' style='background-color: #f5f5f5; border: 1px solid #bbbbbb;' align='center' cellpadding='3'>
			<tr>
				$tree_dropdown_html
			</tr>
		</table>\n";
	}

	if (isset($_SESSION["sess_view_tree_id"])) {
		if (read_config_option("auth_method") != 0) {
			/* take tree permissions into account here, if the user does not have permission
Ejemplo n.º 2
0
            db_execute('insert into settings_tree (graph_tree_item_id,user_id,status) values (' . $_REQUEST['branch_id'] . ',' . $_SESSION['sess_user_id'] . ',' . $_REQUEST['hide'] . ')');
        }
    }
}
switch ($_REQUEST['action']) {
    case 'tree':
        include_once './include/top_graph_header.php';
        validate_tree_vars();
        if (read_config_option('auth_method') != 0 && empty($current_user['show_tree'])) {
            print "<strong><font size='+1' color='FF0000'>YOU DO NOT HAVE RIGHTS FOR TREE VIEW</font></strong>";
            exit;
        }
        if (!isset($_REQUEST['tree_id']) && isset($_SESSION['dhtml_tree'])) {
            unset($_SESSION['dhtml_tree']);
        }
        $tree_dropdown_html = draw_tree_dropdown(isset($_REQUEST['tree_id']) ? $_REQUEST['tree_id'] : '0');
        /* don't even print the table if there is not >1 tree */
        if (!empty($tree_dropdown_html) && read_graph_config_option('default_tree_view_mode') == '1') {
            print "\n\t\t<table width='100%' style='background-color: #f5f5f5; border: 1px solid #bbbbbb;' align='center' cellpadding='3'>\n\t\t\t<tr>\n\t\t\t\t{$tree_dropdown_html}\n\t\t\t</tr>\n\t\t</table>\n";
        }
        if (read_graph_config_option('default_tree_view_mode') == '1') {
            $tree_parameters = array();
            grow_graph_tree($_SESSION['sess_view_tree_id'], !empty($start_branch) ? $start_branch : 0, isset($_SESSION['sess_user_id']) ? $_SESSION['sess_user_id'] : 0, $tree_parameters);
        }
        include_once './include/bottom_footer.php';
        break;
    case 'tree_content':
        validate_tree_vars();
        if (read_config_option('auth_method') != 0 && empty($current_user['show_tree'])) {
            print "<strong><font size='+1' color='FF0000'>YOU DO NOT HAVE RIGHTS FOR TREE VIEW</font></strong>";
            exit;