86 lines
3.5 KiB
PHP
86 lines
3.5 KiB
PHP
<?php
|
|
|
|
// Pandora - the Free monitoring system
|
|
// ====================================
|
|
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
|
|
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas S.L, info@artica.es
|
|
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
|
|
// 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.
|
|
// 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() == 0)
|
|
$id_user = $_SESSION["id_usuario"];
|
|
if (give_acl($id_user, 0, "PM")==1) {
|
|
// Inic vars
|
|
$id_grupo = "";
|
|
$nombre = "";
|
|
|
|
|
|
if (isset($_GET["creacion_grupo"])){ //
|
|
$creacion_grupo = entrada_limpia($_GET["creacion_grupo"]);
|
|
} else
|
|
$creacion_grupo = 0;
|
|
|
|
if (isset($_GET["id_grupo"])){
|
|
// Conecto con la BBDD
|
|
$id_grupo = entrada_limpia($_GET["id_grupo"]);
|
|
$sql1='SELECT * FROM tgrupo WHERE id_grupo = '.$id_grupo;
|
|
$result=mysql_query($sql1);
|
|
if ($row=mysql_fetch_array($result)){
|
|
$nombre = $row["nombre"];
|
|
$icono = $row["icon"];
|
|
} else
|
|
{
|
|
echo "<h3 class='error'>".$lang_label["group_error"]."</h3>";
|
|
echo "</table>";
|
|
include ("general/footer.php");
|
|
exit;
|
|
}
|
|
}
|
|
|
|
echo "<h2>".$lang_label["group_management"]."</h2>";
|
|
if (isset($_GET["creacion_grupo"])) {echo "<h3>".$lang_label["create_group"]."<a href='help/".$help_code."/chap3.php#31' target='_help' class='help'> <span>".$lang_label["help"]."</span></a></h3>";}
|
|
if (isset($_GET["id_grupo"])) {echo "<h3>".$lang_label["update_group"]."<a href='help/".$help_code."/chap3.php#31' target='_help' class='help'> <span>".$lang_label["help"]."</span></a></h3>";}
|
|
|
|
?>
|
|
<table width="450">
|
|
|
|
<form name="grupo" method="post" action="index.php?sec=gagente&sec2=godmode/grupos/lista_grupos">
|
|
|
|
<?php
|
|
if ($creacion_grupo == 1)
|
|
echo "<input type='hidden' name='crear_grupo' value='1'>";
|
|
else {
|
|
echo "<input type='hidden' name='update_grupo' value='1'>";
|
|
echo "<input type='hidden' name='id_grupo' value='".$id_grupo."'>";
|
|
}
|
|
?>
|
|
<tr><td class='lb' rowspan='3' width='5'>
|
|
<tr><td class="datos"><?php echo $lang_label["group_name"] ?><td class="datos"><input type="text" name="nombre" size="35" value="<?php echo $nombre ?>">
|
|
<tr><td class="datos2"><?php echo $lang_label["icon"] ?><td class="datos2"><input type="icon" name="icon" size="25" value="<?php if (isset($icono)){echo $icono;} ?>">
|
|
<tr><td colspan='3'><div class='raya'></div></td></tr>
|
|
<tr><td colspan="3" align="right"><?php if (isset($_GET["creacion_grupo"])){echo "<input name='crtbutton' type='submit' class='sub' value='".$lang_label["create"]."'>";}
|
|
else {echo "<input name='uptbutton' type='submit' class='sub' value='".$lang_label["update"]."'>";} ?>
|
|
</form>
|
|
|
|
</table>
|
|
|
|
<?php
|
|
} // fin pagina
|
|
else {
|
|
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Group Management2");
|
|
require ("general/noaccess.php");
|
|
}
|
|
?>
|