mirror of
https://github.com/Cacti/cacti.git
synced 2026-11-08 21:16:17 +09:00
git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/trunk/cacti@546 860744bd-22fc-0310-8c96-e9fe5004b5ca
586 lines
20 KiB
PHP
586 lines
20 KiB
PHP
<?php
|
|
/*
|
|
+-------------------------------------------------------------------------+
|
|
| Copyright (C) 2003 Ian Berry |
|
|
| |
|
|
| This program is free software; you can redistribute it and/or |
|
|
| modify it under the terms of the GNU General Public License |
|
|
| as published by the Free Software Foundation; either version 2 |
|
|
| of the License, or (at your option) any later version. |
|
|
| |
|
|
| This program is distributed in the hope that it will be useful, |
|
|
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
| GNU General Public License for more details. |
|
|
+-------------------------------------------------------------------------+
|
|
| cacti: a php-based graphing solution |
|
|
+-------------------------------------------------------------------------+
|
|
| Most of this code has been designed, written and is maintained by |
|
|
| Ian Berry. See about.php for specific developer credit. Any questions |
|
|
| or comments regarding this code should be directed to: |
|
|
| - iberry@raxnet.net |
|
|
+-------------------------------------------------------------------------+
|
|
| - raXnet - http://www.raxnet.net/ |
|
|
+-------------------------------------------------------------------------+
|
|
*/
|
|
|
|
include ('include/auth.php');
|
|
include ("include/config_settings.php");
|
|
include_once ("include/form.php");
|
|
|
|
/* set default action */
|
|
if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
|
|
|
|
switch ($_REQUEST["action"]) {
|
|
case 'save':
|
|
form_save();
|
|
|
|
break;
|
|
case 'user_remove':
|
|
user_remove();
|
|
|
|
header ("Location: user_admin.php");
|
|
break;
|
|
case 'graph_config_edit':
|
|
include_once ("include/top_header.php");
|
|
|
|
graph_config_edit();
|
|
|
|
include_once ("include/bottom_footer.php");
|
|
break;
|
|
case 'graph_perms_edit':
|
|
include_once ("include/top_header.php");
|
|
|
|
graph_perms_edit();
|
|
|
|
include_once ("include/bottom_footer.php");
|
|
break;
|
|
case 'user_edit':
|
|
include_once ("include/top_header.php");
|
|
|
|
user_edit();
|
|
|
|
include_once ("include/bottom_footer.php");
|
|
break;
|
|
default:
|
|
include_once ("include/top_header.php");
|
|
|
|
user();
|
|
|
|
include_once ("include/bottom_footer.php");
|
|
break;
|
|
}
|
|
|
|
/* --------------------------
|
|
Global Form Functions
|
|
-------------------------- */
|
|
|
|
function draw_user_form_select() {
|
|
global $colors; ?>
|
|
<tr bgcolor="#<?php print $colors["panel"];?>">
|
|
</form>
|
|
<form name="form_user">
|
|
<td>
|
|
<select name="cbo_user" onChange="window.location=document.form_user.cbo_user.options[document.form_user.cbo_user.selectedIndex].value">
|
|
<option value="user_admin.php?action=user_edit&id=<?php print $_GET["id"];?>"<?php if ($_GET["action"] == "user_edit") {?> selected<?php }?>>User Configuration</option>
|
|
<option value="user_admin.php?action=graph_perms_edit&id=<?php print $_GET["id"];?>"<?php if ($_GET["action"] == "graph_perms_edit") {?> selected<?php }?>>Individual Graph Permissions</option>
|
|
<option value="user_admin.php?action=graph_config_edit&id=<?php print $_GET["id"];?>"<?php if ($_GET["action"] == "graph_config_edit") {?> selected<?php }?>>User Graph Settings</option>
|
|
</select>
|
|
</td>
|
|
</form>
|
|
</tr>
|
|
<?php }
|
|
|
|
/* --------------------------
|
|
The Save Function
|
|
-------------------------- */
|
|
|
|
function form_save() {
|
|
global $settings_graphs;
|
|
|
|
/* user management save */
|
|
if (isset($_POST["save_component_user"])) {
|
|
if (($_POST["password"] == "") && ($_POST["password_confirm"] == "")) {
|
|
$password = db_fetch_cell("select password from user where id=" . $_POST["id"]);
|
|
}else{
|
|
$password = "PASSWORD('" . $_POST["password"] . "')";
|
|
}
|
|
|
|
/* check to make sure the passwords match; if not error */
|
|
if ($_POST["password"] != $_POST["password_confirm"]) {
|
|
$array_error_fields = unserialize($_SESSION["sess_error_fields"]);
|
|
$array_error_fields["password"] = "password";
|
|
$array_error_fields["password_confirm"] = "password_confirm";
|
|
$_SESSION["sess_error_fields"] = serialize($array_error_fields);
|
|
|
|
raise_message(4);
|
|
}
|
|
|
|
form_input_validate($_POST["password"], "password", "" . $_POST["password_confirm"] . "", true, 4);
|
|
form_input_validate($_POST["password_confirm"], "password_confirm", "" . $_POST["password"] . "", true, 4);
|
|
|
|
$save["id"] = $_POST["id"];
|
|
$save["username"] = form_input_validate($_POST["username"], "username", "^[A-Za-z_0-9]+$", false, 3);
|
|
$save["full_name"] = form_input_validate($_POST["full_name"], "full_name", "", true, 3);
|
|
$save["password"] = $password;
|
|
$save["must_change_password"] = form_input_validate((isset($_POST["must_change_password"]) ? $_POST["must_change_password"] : ""), "must_change_password", "", true, 3);
|
|
$save["show_tree"] = form_input_validate((isset($_POST["show_tree"]) ? $_POST["show_tree"] : ""), "show_tree", "", true, 3);
|
|
$save["show_list"] = form_input_validate((isset($_POST["show_list"]) ? $_POST["show_list"] : ""), "show_list", "", true, 3);
|
|
$save["show_preview"] = form_input_validate((isset($_POST["show_preview"]) ? $_POST["show_preview"] : ""), "show_preview", "", true, 3);
|
|
$save["graph_settings"] = form_input_validate((isset($_POST["graph_settings"]) ? $_POST["graph_settings"] : ""), "graph_settings", "", true, 3);
|
|
$save["login_opts"] = form_input_validate($_POST["login_opts"], "login_opts", "", true, 3);
|
|
$save["graph_policy"] = form_input_validate($_POST["graph_policy"], "graph_policy", "", true, 3);
|
|
|
|
if (!is_error_message()) {
|
|
$user_id = sql_save($save, "user");
|
|
|
|
if ($user_id) {
|
|
raise_message(1);
|
|
}else{
|
|
raise_message(2);
|
|
}
|
|
|
|
db_execute("delete from user_auth_realm where user_id=$user_id");
|
|
|
|
while (list($var, $val) = each($_POST)) {
|
|
if (eregi("^[section]", $var)) {
|
|
if (substr($var, 0, 7) == "section") {
|
|
db_execute ("replace into user_auth_realm (user_id,realm_id) values($user_id," . substr($var, 7) . ")");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/* graph permissions */
|
|
if ((isset($_POST["save_component_graph_perms"])) && (!is_error_message())) {
|
|
db_execute ("delete from user_auth_graph where user_id=$user_id");
|
|
db_execute ("delete from user_auth_tree where user_id=$user_id");
|
|
|
|
reset($_POST);
|
|
|
|
while (list($var, $val) = each($_POST)) {
|
|
if (eregi("^[graph|tree]", $var)) {
|
|
if (substr($var, 0, 5) == "graph") {
|
|
db_execute ("replace into user_auth_graph (user_id,local_graph_id) values($user_id," . substr($var, 5) . ")");
|
|
}elseif (substr($var, 0, 4) == "tree") {
|
|
db_execute ("replace into user_auth_tree (user_id,tree_id) values($user_id," . substr($var, 4) . ")");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/* per-user graph permissions */
|
|
if ((isset($_POST["save_component_graph_config"])) && (!is_error_message())) {
|
|
if (sizeof($settings_graphs) > 0) {
|
|
foreach (array_keys($settings_graphs) as $setting) {
|
|
db_execute("replace into settings_graphs (user_id,name,value) values (" . $_SESSION["sess_user_id"]. ",'$setting', '" . $_POST[$setting] . "')");
|
|
}
|
|
}
|
|
|
|
/* reset local settings cache so the user sees the new settings */
|
|
session_unregister("sess_graph_config_array");
|
|
}
|
|
|
|
/* redirect to the appropriate page */
|
|
if (is_error_message()) {
|
|
header ("Location: user_admin.php?action=user_edit&id=" . (empty($user_id) ? $_POST["id"] : $user_id));
|
|
}else{
|
|
header ("Location: user_admin.php");
|
|
}
|
|
}
|
|
|
|
/* --------------------------
|
|
Graph Permissions
|
|
-------------------------- */
|
|
|
|
function graph_perms_edit() {
|
|
global $colors;
|
|
|
|
$graph_policy = "1";
|
|
|
|
if (!empty($_GET["id"])) {
|
|
$graph_policy = db_fetch_cell("select graph_policy from user where id=" . $_GET["id"]);
|
|
|
|
if ($graph_policy == "1") {
|
|
$graph_policy_text = "DENIED";
|
|
}elseif ($graph_policy == "2") {
|
|
$graph_policy_text = "ALLOWED";
|
|
}
|
|
|
|
$header_label = "[edit: " . db_fetch_cell("select username from user where id=" . $_GET["id"]) . "]";
|
|
}
|
|
|
|
if (read_config_option("full_view_user_admin") == "") {
|
|
start_box("<strong>User Management</strong> $header_label", "98%", $colors["header"], "3", "center", "");
|
|
draw_user_form_select();
|
|
end_box();
|
|
}
|
|
|
|
$header_label = "<strong>Graph Permissions</strong> [policy: " . (($graph_policy == "1") ? "ALLOW" : "DENY") . "]";
|
|
|
|
start_box($header_label, "98%", $colors["header"], "3", "center", "");
|
|
|
|
$graphs = db_fetch_assoc("select
|
|
user_auth_graph.user_id,
|
|
graph_templates_graph.local_graph_id,
|
|
graph_templates_graph.title
|
|
from graph_templates_graph
|
|
left join user_auth_graph on (graph_templates_graph.local_graph_id=user_auth_graph.local_graph_id and user_auth_graph.user_id=" . (empty($_GET["id"]) ? "0" : $_GET["id"]) . ")
|
|
where graph_templates_graph.local_graph_id > 0
|
|
order by graph_templates_graph.title");
|
|
|
|
?>
|
|
<form method="post" action="user_admin.php">
|
|
|
|
<tr>
|
|
<td colspan="2" width="100%">
|
|
<table width="100%">
|
|
<tr>
|
|
<td align="top" width="50%">
|
|
<?php
|
|
$i = 0;
|
|
if (sizeof($graphs) > 0) {
|
|
foreach ($graphs as $graph) {
|
|
if ($graph["user_id"] == "") {
|
|
$old_value = "";
|
|
}else{
|
|
$old_value = "on";
|
|
}
|
|
|
|
$column1 = floor((sizeof($graphs) / 2) + (sizeof($graphs) % 2));
|
|
|
|
if ($i == $column1) {
|
|
print "</td><td valign='top' width='50%'>";
|
|
}
|
|
|
|
form_base_checkbox("graph" . $graph["local_graph_id"], $old_value, $graph["title"], "", (!empty($_GET["id"]) ? 1 : 0), true);
|
|
$i++;
|
|
}
|
|
}
|
|
?>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
|
|
<?php
|
|
end_box();
|
|
|
|
form_hidden_id("user_id",(isset($_GET["id"]) ? $_GET["id"] : "0"));
|
|
form_hidden_box("save_component_graph_perms","1","");
|
|
|
|
if (read_config_option("full_view_user_admin") == "") {
|
|
form_save_button("user_admin.php");
|
|
}
|
|
}
|
|
|
|
/* --------------------------
|
|
Per-User Graph Config
|
|
-------------------------- */
|
|
|
|
function graph_config_edit() {
|
|
include ("include/config_arrays.php");
|
|
include_once ("include/functions.php");
|
|
|
|
global $colors, $tabs_graphs, $settings_graphs;
|
|
|
|
if (!empty($_GET["id"])) {
|
|
$header_label = "[edit: " . db_fetch_cell("select username from user where id=" . $_GET["id"]) . "]";
|
|
}
|
|
|
|
if (read_config_option("full_view_user_admin") == "") {
|
|
start_box("<strong>User Management</strong> $header_label", "98%", $colors["header"], "3", "center", "");
|
|
draw_user_form_select();
|
|
end_box();
|
|
}
|
|
|
|
print "<form method='post' action='user_admin.php'>\n";
|
|
|
|
start_box("", "98%", $colors["header"], "3", "center", "");
|
|
|
|
if (sizeof($tabs_graphs) > 0) {
|
|
foreach (array_keys($tabs_graphs) as $tab_short_name) {
|
|
?>
|
|
<tr>
|
|
<td colspan="2" bgcolor="#<?php print $colors["header"];?>">
|
|
<span class="textHeaderDark"><strong>Graph Settings</strong> [<?php print $tabs_graphs[$tab_short_name];?>]</span>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
|
|
reset($settings_graphs);
|
|
|
|
$i = 0;
|
|
if (sizeof($settings_graphs) > 0) {
|
|
foreach (array_keys($settings_graphs) as $setting) {
|
|
/* make sure to skip group members here; only parents are allowed */
|
|
if (($settings_graphs[$setting]["method"] != "internal") && ($settings_graphs[$setting]["tab"] == $tab_short_name)) {
|
|
form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],$i);
|
|
|
|
/* draw the acual header and textbox on the form */
|
|
form_item_label($settings_graphs[$setting]["friendly_name"],$settings_graphs[$setting]["description"]);
|
|
|
|
$current_value = db_fetch_cell("select value from settings_graphs where name='$setting' and user_id=" . (isset($_GET["id"]) ? $_GET["id"] : "0"));
|
|
|
|
/* choose what kind of item this is */
|
|
switch ($settings_graphs[$setting]["method"]) {
|
|
case 'textbox':
|
|
form_text_box($setting,$current_value,$settings_graphs[$setting]["default"],"");
|
|
break;
|
|
case 'drop_sql':
|
|
form_dropdown($setting,db_fetch_assoc($settings_graphs[$setting]["sql"]),"name","id",$current_value,"",$settings_graphs[$setting]["default"]);
|
|
break;
|
|
case 'drop_array':
|
|
form_dropdown($setting,${$settings_graphs[$setting]["array_name"]},"","",$current_value,"",$settings_graphs[$setting]["default"]);
|
|
break;
|
|
}
|
|
|
|
$i++;
|
|
|
|
print "</tr>\n";
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
end_box();
|
|
|
|
form_hidden_id("user_id",(isset($user) ? $user["id"] : "0"));
|
|
form_hidden_box("save_component_graph_config","1","");
|
|
|
|
form_save_button("user_admin.php");
|
|
}
|
|
|
|
/* --------------------------
|
|
User Administration
|
|
-------------------------- */
|
|
|
|
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 where id=" . $_GET["id"]) . "'</strong>?", getenv("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 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;
|
|
|
|
if (!empty($_GET["id"])) {
|
|
$user = db_fetch_row("select * from user where id=" . $_GET["id"]);
|
|
$header_label = "[edit: " . $user["username"] . "]";
|
|
}else{
|
|
$header_label = "[new]";
|
|
}
|
|
|
|
if (read_config_option("full_view_user_admin") == "") {
|
|
start_box("<strong>User Management</strong> $header_label", "98%", $colors["header"], "3", "center", "");
|
|
draw_user_form_select();
|
|
end_box();
|
|
}
|
|
|
|
start_box("<strong>User Management</strong> $header_label", "98%", $colors["header"], "3", "center", "");
|
|
|
|
?>
|
|
<form method="post" action="user_admin.php">
|
|
<?php
|
|
|
|
form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],0); ?>
|
|
<td width="50%">
|
|
<font class="textEditTitle">User Name</font><br>
|
|
The login name for this user.
|
|
</td>
|
|
<?php form_text_box('username',(isset($user) ? $user["username"] : ""),"","");?>
|
|
</tr>
|
|
|
|
<?php form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],1); ?>
|
|
<td width="50%">
|
|
<font class="textEditTitle">Full Name</font><br>
|
|
A more descriptive name for this user, that can include spaces or special characters.
|
|
</td>
|
|
<?php form_text_box('full_name',(isset($user) ? $user["full_name"] : ""),"","");?>
|
|
</tr>
|
|
|
|
<?php form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],0); ?>
|
|
<td width="50%">
|
|
<font class="textEditTitle">Password</font><br>
|
|
Enter the password for this user twice. Remember that passwords are case sensitive!
|
|
</td>
|
|
<td>
|
|
<?php form_base_password_box("password","","","","40");?><br>
|
|
<?php form_base_password_box("password_confirm","","","","40");?>
|
|
</td>
|
|
</tr>
|
|
|
|
<?php form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],1); ?>
|
|
<td width="50%">
|
|
<font class="textEditTitle">Account Options</font><br>
|
|
Set any user account-specific options here.
|
|
</td>
|
|
<td>
|
|
<?php
|
|
form_base_checkbox("must_change_password", (isset($user) ? $user["must_change_password"] : ""), "User Must Change Password at Next Login", "", (!empty($_GET["id"]) ? 1 : 0), true);
|
|
form_base_checkbox("graph_settings", (isset($user) ? $user["graph_settings"] : ""), "Allow this User to Keep Custom Graph Settings", "on", (!empty($_GET["id"]) ? 1 : 0), true);
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<?php form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],0); ?>
|
|
<td width="50%">
|
|
<font class="textEditTitle">Graph Options</font><br>
|
|
Set any graph-specific options here.
|
|
</td>
|
|
<td>
|
|
<?php
|
|
form_base_checkbox("show_tree", (isset($user) ? $user["show_tree"] : ""), "User Has Rights to View Tree Mode", "on", (!empty($_GET["id"]) ? 1 : 0), true);
|
|
form_base_checkbox("show_list", (isset($user) ? $user["show_list"] : ""), "User Has Rights to View List Mode", "on", (!empty($_GET["id"]) ? 1 : 0), true);
|
|
form_base_checkbox("show_preview", (isset($user) ? $user["show_preview"] : ""), "User Has Rights to View Tree Mode", "on", (!empty($_GET["id"]) ? 1 : 0), true);
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<?php form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],1); ?>
|
|
<td width="50%">
|
|
<font class="textEditTitle">Default Policy</font><br>
|
|
The default allow/deny graph policy for this user.
|
|
</td>
|
|
<?php
|
|
$graph_policy = array(
|
|
1 => "Allow",
|
|
2 => "Deny");
|
|
|
|
form_dropdown("graph_policy",$graph_policy,"","",(isset($user) ? $user["graph_policy"] : ""),"","");
|
|
?>
|
|
</tr>
|
|
|
|
<?php form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],0); ?>
|
|
<td width="50%">
|
|
<font class="textEditTitle">Login Options</font><br>
|
|
What to do when this user logs in.
|
|
</td>
|
|
<td>
|
|
<?php
|
|
form_base_radio_button("login_opts", (isset($user) ? $user["login_opts"] : ""), "1", "Show the page that user pointed their browser to.","1",true);
|
|
form_base_radio_button("login_opts", (isset($user) ? $user["login_opts"] : ""), "2", "Show the default console screen.","1",true);
|
|
form_base_radio_button("login_opts", (isset($user) ? $user["login_opts"] : ""), "3", "Show the default graph screen.","1",true);
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<?php
|
|
end_box();
|
|
start_box("<strong>Realm Permissions</strong>", "98%", $colors["header"], "3", "center", "");
|
|
|
|
$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");
|
|
|
|
?>
|
|
|
|
<tr>
|
|
<td colspan="2" width="100%">
|
|
<table width="100%">
|
|
<tr>
|
|
<td align="top" width="50%">
|
|
<?php
|
|
$i = 0;
|
|
if (sizeof($realms) > 0) {
|
|
foreach ($realms as $realm) {
|
|
if ($realm["user_id"] == "") {
|
|
$old_value = "";
|
|
}else{
|
|
$old_value = "on";
|
|
}
|
|
|
|
$column1 = floor((sizeof($realms) / 2) + (sizeof($realms) % 2));
|
|
|
|
if ($i == $column1) {
|
|
print "</td><td valign='top' width='50%'>";
|
|
}
|
|
|
|
form_base_checkbox("section" . $realm["id"], $old_value, $realm["name"], "", (!empty($_GET["id"]) ? 1 : 0), true);
|
|
|
|
$i++;
|
|
}
|
|
}
|
|
?>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
|
|
<?php
|
|
end_box();
|
|
|
|
form_hidden_id("id",(isset($user) ? $user["id"] : "0"));
|
|
form_hidden_box("save_component_user","1","");
|
|
|
|
if (read_config_option("full_view_user_admin") == "") {
|
|
form_save_button("user_admin.php");
|
|
}
|
|
|
|
if (read_config_option("full_view_user_admin") == "on") {
|
|
graph_perms_edit();
|
|
graph_config_edit();
|
|
}
|
|
}
|
|
|
|
function user() {
|
|
global $colors;
|
|
|
|
start_box("<strong>User Management</strong>", "98%", $colors["header"], "3", "center", "user_admin.php?action=user_edit");
|
|
|
|
print "<tr bgcolor='#" . $colors["header_panel"] . "'>";
|
|
DrawMatrixHeaderItem("User Name",$colors["header_text"],1);
|
|
DrawMatrixHeaderItem("Full Name",$colors["header_text"],1);
|
|
DrawMatrixHeaderItem("Default Graph Policy",$colors["header_text"],2);
|
|
print "</tr>";
|
|
|
|
$user_list = db_fetch_assoc("select id,username,full_name,graph_policy from user order by username");
|
|
|
|
$i = 0;
|
|
if (sizeof($user_list) > 0) {
|
|
foreach ($user_list as $user) {
|
|
form_alternate_row_color($colors["alternate"],$colors["light"],$i);
|
|
?>
|
|
<td>
|
|
<a class="linkEditMain" href="user_admin.php?action=user_edit&id=<?php print $user["id"];?>"><?php print $user["username"];?></a>
|
|
</td>
|
|
<td>
|
|
<?php print $user["full_name"];?>
|
|
</td>
|
|
<td>
|
|
<?php if ($user["graph_policy"] == "1") { print "ALLOW"; }else{ print "DENY"; }?>
|
|
</td>
|
|
<td width="1%" align="right">
|
|
<a href="user_admin.php?action=user_remove&id=<?php print $user["id"];?>"><img src="images/delete_icon.gif" width="10" height="10" border="0" alt="Delete"></a>
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
$i++;
|
|
}
|
|
}
|
|
end_box();
|
|
}
|
|
?>
|