// Additions to Pandora FMS 1.2 graph code and new XML reporting template management // Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es // // 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; version 2 // 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. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Load global vars require("include/config.php"); if (comprueba_login ()) { audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Group Management2"); require ("general/noaccess.php"); return; } if (! give_acl ($config['id_user'], 0, "PM")) { audit_db ($id_user, $REMOTE_ADDR, "ACL Violation", "Trying to access Group Management2"); require ("general/noaccess.php"); return; } // Init vars $icon = ""; $name = ""; $id_parent = 0; $alerts_disabled = 0; $create_group = (bool) get_parameter ('create_group'); $id_group = (int) get_parameter ('id_group'); if ($id_group) { $group = get_db_row ('tgrupo', 'id_grupo', $id_group); if ($group) { $name = $group["nombre"]; $icon = $group["icon"].'.png'; $alerts_isabled = $group["disabled"]; $id_parent = $group["parent"]; } else { echo "

".$lang_label["group_error"]."

"; echo ""; include ("general/footer.php"); exit; } } echo "

".$lang_label["group_management"]." > "; if ($id_group) { echo $lang_label["update_group"]; } else { echo $lang_label["create_group"]; } echo "

"; $table->width = '450px'; $table->data = array (); $table->data[0][0] = lang_string ('name'); $table->data[0][1] = print_input_text ('name', $name, '', 35, 100, true); $table->data[1][0] = lang_string ('icon'); $files = list_files ('images/groups_small/', "png", 1, 0); $table->data[1][1] = print_select ($files, 'icon', $icon, '', 'None', '', true); $table->data[1][1] .= ' '; if ($icon) { $table->data[1][1] .= ''; } $table->data[1][1] .= ''; $table->data[2][0] = lang_string ('parent'); $sql = 'SELECT * FROM tgrupo '; if ($id_group) $sql .= sprintf ('WHERE id_grupo != %d', $id_group); $table->data[2][1] = print_select_from_sql ($sql, 'parent', $id_parent, '', 'None', 0, true); $table->data[2][1] .= ' '; if ($id_parent) { echo ''; } echo''; $table->data[3][0] = lang_string ('alerts'); $table->data[3][1] = print_checkbox ('alerts_enabled', 1, ! $alerts_disabled, true); echo '
'; print_table ($table); echo '
'; if ($id_group) { print_input_hidden ('update_group', 1); print_input_hidden ('id_group', $id_group); print_submit_button (lang_string ('update'), 'updbutton', false, 'class="sub upd"'); } else { print_input_hidden ('create_group', 1); print_submit_button (lang_string ('create'), 'crtbutton', false, 'class="sub wand"'); } echo '
'; echo '
'; ?>