nowrap='nowrap' width='150' align='center' class='tab'> User Configuration nowrap='nowrap' width='160' align='center' class='tab'> Graph Permissions
"Allow", 2 => "Deny"); if (!empty($_GET["id"])) { $policy = db_fetch_row("select policy_graphs,policy_trees,policy_hosts,policy_graph_templates from user_auth where id=" . $_GET["id"]); $header_label = "[edit: " . db_fetch_cell("select username from user_auth where id=" . $_GET["id"]) . "]"; } /* draw user admin nav tabs */ draw_user_form_tabs(); ?>
Graph policies will be evaluated in the order shown until a match is found.
Graph Permissions", "98%", $colors["header"], "3", "center", ""); $graphs = db_fetch_assoc("select graph_templates_graph.local_graph_id, graph_templates_graph.title_cache from graph_templates_graph left join user_auth_perms on (graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1) where graph_templates_graph.local_graph_id > 0 and user_auth_perms.user_id=" . (empty($_GET["id"]) ? "0" : $_GET["id"]) . " order by graph_templates_graph.title_cache"); ?>
"> Default Policy
The default allow/deny graph policy for this user. 0) { foreach ($graphs as $item) { $i++; print " \n"; } }else{ print ""; } ?>
$i) " . $item["title_cache"] . " Delete 
No Graphs
Add Graph:  0 order by title_cache"),"title_cache","local_graph_id","","","");?>  

Host Permissions", "98%", $colors["header"], "3", "center", ""); $hosts = db_fetch_assoc("select host.id, CONCAT_WS('',host.description,' (',host.hostname,')') as name from host left join user_auth_perms on (host.id=user_auth_perms.item_id and user_auth_perms.type=3) where user_auth_perms.user_id=" . (empty($_GET["id"]) ? "0" : $_GET["id"]) . " order by host.description,host.hostname"); ?> "> Default Policy
The default allow/deny graph policy for this user. 0) { foreach ($hosts as $item) { $i++; print " \n"; } }else{ print ""; } ?>
$i) " . $item["name"] . " Delete 
No Hosts
Add Host:   

Graph Template Permissions", "98%", $colors["header"], "3", "center", ""); $graph_templates = db_fetch_assoc("select graph_templates.id, graph_templates.name from graph_templates left join user_auth_perms on (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4) where user_auth_perms.user_id=" . (empty($_GET["id"]) ? "0" : $_GET["id"]) . " order by graph_templates.name"); ?> "> Default Policy
The default allow/deny graph policy for this user. 0) { foreach ($graph_templates as $item) { $i++; print " \n"; } }else{ print ""; } ?>
$i) " . $item["name"] . " Delete 
No Graph Templates
Add Graph Template:   

Tree Permissions", "98%", $colors["header"], "3", "center", ""); $trees = db_fetch_assoc("select graph_tree.id, graph_tree.name from graph_tree left join user_auth_perms on (graph_tree.id=user_auth_perms.item_id and user_auth_perms.type=2) where user_auth_perms.user_id=" . (empty($_GET["id"]) ? "0" : $_GET["id"]) . " order by graph_tree.name"); ?> "> Default Policy
The default allow/deny graph policy for this user. 0) { foreach ($trees as $item) { $i++; print " \n"; } }else{ print ""; } ?>
$i) " . $item["name"] . " Delete 
No Trees
Add Tree:   

'" . db_fetch_cell("select username from user_auth where id=" . $_GET["id"]) . "'?", $_SERVER["HTTP_REFERER"], "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_hosts where user_id=" . $_GET["id"]); db_execute("delete from user_auth_graph where user_id=" . $_GET["id"]); db_execute("delete from user_auth_tree where user_id=" . $_GET["id"]); db_execute("delete from settings_graphs where user_id=" . $_GET["id"]); } } function user_edit() { global $colors, $tabs_graphs, $settings_graphs, $graph_views, $graph_tree_views, $fields_user_user_edit_host, $user_auth_realms; if (!empty($_GET["id"])) { $user = db_fetch_row("select * from user_auth where id=" . $_GET["id"]); $header_label = "[edit: " . $user["username"] . "]"; }else{ $header_label = "[new]"; } if (!empty($_GET["id"])) { /* draw user admin nav tabs */ draw_user_form_tabs(); } start_box("User Management $header_label", "98%", $colors["header"], "3", "center", ""); draw_edit_form(array( "config" => array("form_name" => "chk"), "fields" => inject_form_variables($fields_user_user_edit_host, (isset($user) ? $user : array())) )); end_box(); start_box("", "98%", $colors["header"], "3", "center", ""); print " Realm Permissions \n \n"; $realms = db_fetch_assoc("select user_auth_realm.user_id, user_realm.id, user_realm.name from user_realm left join user_auth_realm on (user_realm.id=user_auth_realm.realm_id and user_auth_realm.user_id=" . (empty($_GET["id"]) ? "0" : $_GET["id"]) . ") order by user_realm.name"); ?>
0) { $old_value = "on"; }else{ $old_value = ""; } $column1 = floor((sizeof($user_auth_realms) / 2) + (sizeof($user_auth_realms) % 2)); if ($i == $column1) { print ""; } form_checkbox("section" . $realm_id, $old_value, $realm_name, "", (!empty($_GET["id"]) ? 1 : 0)); print "
"; $i++; } ?>
"> Graph Settings [] $tab_fields[$field_name]); $form_array[$field_name]["value"] = db_fetch_cell("select value from settings_graphs where name='$field_name' and user_id=" . (isset($_GET["id"]) ? $_GET["id"] : "0")); } draw_edit_form( array( "config" => array( "no_form_tag" => true ), "fields" => $form_array ) ); } end_box(); form_save_button("user_admin.php"); } function user() { global $colors, $auth_realms; start_box("User Management", "98%", $colors["header"], "3", "center", "user_admin.php?action=user_edit"); print ""; DrawMatrixHeaderItem("User Name",$colors["header_text"],1); DrawMatrixHeaderItem("Full Name",$colors["header_text"],1); DrawMatrixHeaderItem("Realm",$colors["header_text"],1); DrawMatrixHeaderItem("Default Graph Policy",$colors["header_text"],1); DrawMatrixHeaderItem("Last Login",$colors["header_text"],2); print ""; $user_list = db_fetch_assoc("select id, user_auth.username, full_name, realm, policy_graphs, DATE_FORMAT(max(time),'%M %e %Y %H:%i:%s') as time from user_auth left join user_log on user_auth.id = user_log.user_id group by id"); $i = 0; if (sizeof($user_list) > 0) { foreach ($user_list as $user) { form_alternate_row_color($colors["alternate"],$colors["light"],$i); ?> "> ">Delete