DENY this user from."; } elseif ($graph_policy == "2") { $policy_display = "Select the graphs you want ALLOW this user to view."; } $graphs = db_fetch_assoc("select ag.UserID, g.ID, g.Title from rrd_graph g left join auth_graph ag on (g.id=ag.graphid and ag.userid=$id) order by g.title"); $rows = sizeof($graphs); DrawFormHeader("Individual Graph Permissions","",false); DrawFormItem("", $policy_display); DrawMatrixCustom(""); DrawMatrixTableBegin("100%"); DrawMatrixRowBegin(); DrawMatrixCustom(""); if (sizeof($graphs) > 0) { foreach ($graphs as $graph) { if ($graph[UserID] == "") { $old_value = ""; }else{ $old_value = "on"; } $column1 = floor(($rows / 2) + ($rows % 2)); if ($i == $column1) { print ""; } DrawStrippedFormItemCheckBox("graph".$graph[ID], $old_value, $graph[Title],""); $i++; } } DrawMatrixCustom(""); DrawMatrixRowEnd(); DrawMatrixTableEnd(); /* ------------------- GRAPH HIERARCHIES ------------------- */ if ($graph_policy == "1") { $policy_display = "Select the graph hierarchies that you want to HIDE from this user."; } elseif ($graph_policy == "2") { $policy_display = "Select the graph hierarchies that you want to ALLOW this user to view."; } $graphs2 = db_fetch_assoc("select agh.UserID, gh.ID, gh.Name from graph_hierarchy gh left join auth_graph_hierarchy agh on (gh.id=agh.hierarchyid and agh.userid=$id) order by gh.name"); $rows = sizeof($graphs2); $i = 0; DrawFormItem("", $policy_display); DrawMatrixCustom(""); DrawMatrixTableBegin("100%"); DrawMatrixRowBegin(); DrawMatrixCustom(""); if (sizeof($graphs) > 0) { foreach ($graphs2 as $graph) { if ($graph[UserID] == "") { $old_value = ""; } else { $old_value = "on"; } $column1 = floor(($rows / 2) + ($rows % 2)); if ($i == $column1) { print "\n"; } DrawStrippedFormItemCheckBox("tree" . $graph[ID], $old_value, $graph[Name],""); $i++; } } DrawMatrixCustom(""); DrawMatrixRowEnd(); DrawMatrixTableEnd(); DrawFormSaveButton(); DrawFormItemHiddenIDField("ID",$id); DrawFormFooter(); break; } ?>