2006-03-27 05:37:27 +02:00
|
|
|
|
<?php
|
2006-07-11 16:48:04 +02:00
|
|
|
|
|
|
|
|
|
// Pandora - the Free monitoring system
|
|
|
|
|
// ====================================
|
|
|
|
|
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
|
2007-10-12 18:27:50 +02:00
|
|
|
|
// Copyright (c) 2005-2006 Artica Soluciones Tecnol<6F>gicas S.L, info@artica.es
|
2006-07-11 16:48:04 +02:00
|
|
|
|
// 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.
|
2006-03-27 05:37:27 +02:00
|
|
|
|
|
|
|
|
|
// Load global vars
|
|
|
|
|
require("include/config.php");
|
2006-07-11 16:48:04 +02:00
|
|
|
|
|
2006-03-27 05:37:27 +02:00
|
|
|
|
if (comprueba_login() == 0) {
|
|
|
|
|
|
|
|
|
|
$view_mode = 0;
|
|
|
|
|
$id_usuario = $_SESSION["id_usuario"];
|
|
|
|
|
|
|
|
|
|
if (isset ($_GET["ver"])){ // Only view mode,
|
|
|
|
|
$id = $_GET["ver"]; // ID given as parameter
|
|
|
|
|
if ($id_usuario == $id)
|
|
|
|
|
$view_mode = 0;
|
|
|
|
|
else
|
|
|
|
|
$view_mode = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$query1="SELECT * FROM tusuario WHERE id_usuario = '".$id."'";
|
|
|
|
|
$resq1=mysql_query($query1);
|
|
|
|
|
$rowdup=mysql_fetch_array($resq1);
|
|
|
|
|
$nombre=$rowdup["id_usuario"];
|
|
|
|
|
|
2006-07-11 16:48:04 +02:00
|
|
|
|
// Get user ID to modify data of current user.
|
2006-03-27 05:37:27 +02:00
|
|
|
|
|
|
|
|
|
if (isset ($_GET["modificado"])){
|
2007-10-12 18:27:50 +02:00
|
|
|
|
// Se realiza la modificaci<63>n
|
2006-03-27 05:37:27 +02:00
|
|
|
|
if (isset ($_POST["pass1"])){
|
2006-07-04 12:09:39 +02:00
|
|
|
|
if ( isset($_POST["nombre"]) && ($_POST["nombre"] != $_SESSION["id_usuario"])) {
|
2006-03-27 05:37:27 +02:00
|
|
|
|
audit_db($_SESSION["id_usuario"],$REMOTE_ADDR,"Security Alert. Trying to modify another user: (".$_POST['nombre'].") ","Security Alert");
|
|
|
|
|
no_permission;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// $nombre = $_POST["nombre"]; // Don't allow change name !!
|
|
|
|
|
$pass1 = entrada_limpia($_POST["pass1"]);
|
|
|
|
|
$pass2 = entrada_limpia($_POST["pass2"]);
|
|
|
|
|
$direccion = entrada_limpia($_POST["direccion"]);
|
|
|
|
|
$telefono = entrada_limpia($_POST["telefono"]);
|
|
|
|
|
$nombre_real = entrada_limpia($_POST["nombre_real"]);
|
|
|
|
|
if ($pass1 != $pass2) {
|
|
|
|
|
echo "<h3 class='error'>".$lang_label["pass_nomatch"]."</h3>";
|
|
|
|
|
}
|
|
|
|
|
else {echo "<h3 class='suc'>".$lang_label["update_user_ok"]."</h3>";}
|
2007-10-12 18:27:50 +02:00
|
|
|
|
//echo "<br>DEBUG for ".$nombre;
|
|
|
|
|
//echo "<br>Comments:".$comentarios;
|
2006-03-27 05:37:27 +02:00
|
|
|
|
$comentarios = entrada_limpia($_POST["comentarios"]);
|
|
|
|
|
if (dame_password($nombre)!=$pass1){
|
|
|
|
|
// Only when change password
|
|
|
|
|
$pass1=md5($pass1);
|
|
|
|
|
$sql = "UPDATE tusuario SET nombre_real = '".$nombre_real."', password = '".$pass1."', telefono ='".$telefono."', direccion ='".$direccion." ', comentarios = '".$comentarios."' WHERE id_usuario = '".$nombre."'";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
$sql = "UPDATE tusuario SET nombre_real = '".$nombre_real."', telefono ='".$telefono."', direccion ='".$direccion." ', comentarios = '".$comentarios."' WHERE id_usuario = '".$nombre."'";
|
|
|
|
|
$resq2=mysql_query($sql);
|
|
|
|
|
|
|
|
|
|
// Ahora volvemos a leer el registro para mostrar la info modificada
|
|
|
|
|
// $id is well known yet
|
|
|
|
|
$query1="SELECT * FROM tusuario WHERE id_usuario = '".$id."'";
|
|
|
|
|
$resq1=mysql_query($query1);
|
|
|
|
|
$rowdup=mysql_fetch_array($resq1);
|
|
|
|
|
$nombre=$rowdup["id_usuario"];
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "<h3 class='error'>".$lang_label["pass_nomatch"]."</h3>";
|
|
|
|
|
}
|
|
|
|
|
}
|
2007-05-27 04:55:55 +02:00
|
|
|
|
echo "<h2>".$lang_label["users_"]." > ";
|
2007-10-12 18:27:50 +02:00
|
|
|
|
echo $lang_label["user_edit_title"]."</h2>";
|
2006-03-27 05:37:27 +02:00
|
|
|
|
|
2006-07-11 16:48:04 +02:00
|
|
|
|
// Si no se obtiene la variable "modificado" es que se esta visualizando la informacion y
|
2006-03-27 05:37:27 +02:00
|
|
|
|
// preparandola para su modificacion, no se almacenan los datos
|
|
|
|
|
|
|
|
|
|
$nombre=$rowdup["id_usuario"];
|
|
|
|
|
if ($view_mode == 0)
|
|
|
|
|
$password=$rowdup["password"];
|
|
|
|
|
else
|
2006-06-26 18:09:20 +02:00
|
|
|
|
$password="This is not a good idea :-)";
|
2006-03-27 05:37:27 +02:00
|
|
|
|
|
|
|
|
|
$comentarios=$rowdup["comentarios"];
|
|
|
|
|
$direccion=$rowdup["direccion"];
|
|
|
|
|
$telefono=$rowdup["telefono"];
|
|
|
|
|
$nombre_real=$rowdup["nombre_real"];
|
|
|
|
|
|
|
|
|
|
?>
|
2007-06-13 Raul Mateos <raulofpandora@gmail.com>
* godmode/menu.php, operation/menu.php, include/pandora.css, include/op.css,
include/god.css: Updated with styles to avoid top and bottom border.
* godmode/groups/group_list.php, godmode/users/*.php, operation/users/*.php,
godmode/servers/*.php, operation/snmpconsole/snmp_alert.php,
godmode/reporting/map_builder.php, operation/messages/message.php:
Removed old raya style and changed to new style.
* include/languages/language_en.php: Changed some typing error.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@509 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-06-13 21:14:05 +02:00
|
|
|
|
<table cellpadding="4" cellspacing="4" class="databox_color" width="500px">
|
2006-03-27 05:37:27 +02:00
|
|
|
|
<?php
|
|
|
|
|
if ($view_mode == 0)
|
|
|
|
|
echo '<form name="user_mod" method="post" action="index.php?sec=usuarios&sec2=operation/users/user_edit&ver='.$id_usuario.'&modificado=1">';
|
|
|
|
|
else
|
|
|
|
|
echo '<form name="user_mod" method="post" action="">';
|
|
|
|
|
?>
|
2007-06-13 Raul Mateos <raulofpandora@gmail.com>
* godmode/menu.php, operation/menu.php, include/pandora.css, include/op.css,
include/god.css: Updated with styles to avoid top and bottom border.
* godmode/groups/group_list.php, godmode/users/*.php, operation/users/*.php,
godmode/servers/*.php, operation/snmpconsole/snmp_alert.php,
godmode/reporting/map_builder.php, operation/messages/message.php:
Removed old raya style and changed to new style.
* include/languages/language_en.php: Changed some typing error.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@509 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-06-13 21:14:05 +02:00
|
|
|
|
<tr>
|
|
|
|
|
<td class="datos"><?php echo $lang_label["id_user"] ?></td>
|
|
|
|
|
<td class="datos"><input class=input type="text" name="nombre" value="<?php echo $nombre ?>" disabled></td>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="datos2"><?php echo $lang_label["real_name"] ?></td>
|
|
|
|
|
<td class="datos2">
|
|
|
|
|
<input class=input type="text" name="nombre_real" value="<?php echo $nombre_real ?>"></td>
|
|
|
|
|
<tr><td class="datos"><?php echo $lang_label["password"] ?></td>
|
|
|
|
|
<td class="datos">
|
|
|
|
|
<input class=input type="password" name="pass1" value="<?php echo $password ?>"></td>
|
|
|
|
|
<tr><td class="datos2">
|
|
|
|
|
<?php echo $lang_label["password"]; echo " ".$lang_label["confirmation"]?>
|
|
|
|
|
<td class="datos2">
|
|
|
|
|
<input class=input type="password" name="pass2" value="<?php echo $password ?>"></td>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="datos">E-Mail
|
|
|
|
|
<td class="datos">
|
|
|
|
|
<input class=input type="text" name="direccion" size="40" value="<?php echo $direccion ?>">
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="datos2"><?php echo $lang_label["telefono"] ?>
|
2006-07-04 12:09:39 +02:00
|
|
|
|
<td class="datos2"><input class=input type="text" name="telefono" value="<?php echo $telefono ?>">
|
2006-03-27 05:37:27 +02:00
|
|
|
|
<tr><td class="datos" colspan="2"><?php echo $lang_label["comments"] ?>
|
2006-07-04 12:09:39 +02:00
|
|
|
|
<tr><td class="datos2" colspan="2"><textarea name="comentarios" cols="55" rows="4"><?php echo $comentarios ?></textarea>
|
2007-06-13 Raul Mateos <raulofpandora@gmail.com>
* godmode/menu.php, operation/menu.php, include/pandora.css, include/op.css,
include/god.css: Updated with styles to avoid top and bottom border.
* godmode/groups/group_list.php, godmode/users/*.php, operation/users/*.php,
godmode/servers/*.php, operation/snmpconsole/snmp_alert.php,
godmode/reporting/map_builder.php, operation/messages/message.php:
Removed old raya style and changed to new style.
* include/languages/language_en.php: Changed some typing error.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@509 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-06-13 21:14:05 +02:00
|
|
|
|
</table>
|
|
|
|
|
<table cellpadding="4" cellspacing="4" width="500px">
|
2006-03-27 05:37:27 +02:00
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
// Don't delete this!!
|
|
|
|
|
if ($view_mode ==0){
|
2006-06-26 18:09:20 +02:00
|
|
|
|
echo '<tr><td colspan="3" align="right">';
|
2007-06-13 Raul Mateos <raulofpandora@gmail.com>
* godmode/menu.php, operation/menu.php, include/pandora.css, include/op.css,
include/god.css: Updated with styles to avoid top and bottom border.
* godmode/groups/group_list.php, godmode/users/*.php, operation/users/*.php,
godmode/servers/*.php, operation/snmpconsole/snmp_alert.php,
godmode/reporting/map_builder.php, operation/messages/message.php:
Removed old raya style and changed to new style.
* include/languages/language_en.php: Changed some typing error.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@509 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-06-13 21:14:05 +02:00
|
|
|
|
echo "<input name='uptbutton' type='submit' class='sub upd' value='".$lang_label["update"]."'></td></tr>";
|
2006-03-27 05:37:27 +02:00
|
|
|
|
}
|
2007-06-13 Raul Mateos <raulofpandora@gmail.com>
* godmode/menu.php, operation/menu.php, include/pandora.css, include/op.css,
include/god.css: Updated with styles to avoid top and bottom border.
* godmode/groups/group_list.php, godmode/users/*.php, operation/users/*.php,
godmode/servers/*.php, operation/snmpconsole/snmp_alert.php,
godmode/reporting/map_builder.php, operation/messages/message.php:
Removed old raya style and changed to new style.
* include/languages/language_en.php: Changed some typing error.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@509 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-06-13 21:14:05 +02:00
|
|
|
|
echo '</table></form><br>';
|
2007-10-12 18:27:50 +02:00
|
|
|
|
echo '<h3>'.$lang_label["listGroupUser"].'</h3>';
|
2007-06-13 Raul Mateos <raulofpandora@gmail.com>
* godmode/menu.php, operation/menu.php, include/pandora.css, include/op.css,
include/god.css: Updated with styles to avoid top and bottom border.
* godmode/groups/group_list.php, godmode/users/*.php, operation/users/*.php,
godmode/servers/*.php, operation/snmpconsole/snmp_alert.php,
godmode/reporting/map_builder.php, operation/messages/message.php:
Removed old raya style and changed to new style.
* include/languages/language_en.php: Changed some typing error.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@509 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-06-13 21:14:05 +02:00
|
|
|
|
echo "<table width='500' cellpadding='4' cellspacing='4' class='databox'>";
|
2006-03-27 05:37:27 +02:00
|
|
|
|
$sql1='SELECT * FROM tusuario_perfil WHERE id_usuario = "'.$nombre.'"';
|
|
|
|
|
$result=mysql_query($sql1);
|
|
|
|
|
if (mysql_num_rows($result)){
|
2007-06-13 Raul Mateos <raulofpandora@gmail.com>
* godmode/menu.php, operation/menu.php, include/pandora.css, include/op.css,
include/god.css: Updated with styles to avoid top and bottom border.
* godmode/groups/group_list.php, godmode/users/*.php, operation/users/*.php,
godmode/servers/*.php, operation/snmpconsole/snmp_alert.php,
godmode/reporting/map_builder.php, operation/messages/message.php:
Removed old raya style and changed to new style.
* include/languages/language_en.php: Changed some typing error.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@509 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-06-13 21:14:05 +02:00
|
|
|
|
echo '<tr>';
|
2006-07-11 16:48:04 +02:00
|
|
|
|
$color=1;
|
2006-03-27 05:37:27 +02:00
|
|
|
|
while ($row=mysql_fetch_array($result)){
|
2006-07-11 16:48:04 +02:00
|
|
|
|
if ($color == 1){
|
2007-06-13 Raul Mateos <raulofpandora@gmail.com>
* godmode/menu.php, operation/menu.php, include/pandora.css, include/op.css,
include/god.css: Updated with styles to avoid top and bottom border.
* godmode/groups/group_list.php, godmode/users/*.php, operation/users/*.php,
godmode/servers/*.php, operation/snmpconsole/snmp_alert.php,
godmode/reporting/map_builder.php, operation/messages/message.php:
Removed old raya style and changed to new style.
* include/languages/language_en.php: Changed some typing error.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@509 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-06-13 21:14:05 +02:00
|
|
|
|
$tdcolor = "datos2";
|
2006-07-11 16:48:04 +02:00
|
|
|
|
$color = 0;
|
|
|
|
|
}
|
|
|
|
|
else {
|
2007-06-13 Raul Mateos <raulofpandora@gmail.com>
* godmode/menu.php, operation/menu.php, include/pandora.css, include/op.css,
include/god.css: Updated with styles to avoid top and bottom border.
* godmode/groups/group_list.php, godmode/users/*.php, operation/users/*.php,
godmode/servers/*.php, operation/snmpconsole/snmp_alert.php,
godmode/reporting/map_builder.php, operation/messages/message.php:
Removed old raya style and changed to new style.
* include/languages/language_en.php: Changed some typing error.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@509 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-06-13 21:14:05 +02:00
|
|
|
|
$tdcolor = "datos";
|
2006-07-11 16:48:04 +02:00
|
|
|
|
$color = 1;
|
|
|
|
|
}
|
|
|
|
|
echo '<td class="'.$tdcolor.'">';
|
2006-03-27 05:37:27 +02:00
|
|
|
|
echo "<b>".dame_perfil($row["id_perfil"])."</b> / ";
|
2006-07-11 16:48:04 +02:00
|
|
|
|
echo "<b>".dame_grupo($row["id_grupo"])."</b><tr>";
|
2006-03-27 05:37:27 +02:00
|
|
|
|
}
|
2007-06-13 Raul Mateos <raulofpandora@gmail.com>
* godmode/menu.php, operation/menu.php, include/pandora.css, include/op.css,
include/god.css: Updated with styles to avoid top and bottom border.
* godmode/groups/group_list.php, godmode/users/*.php, operation/users/*.php,
godmode/servers/*.php, operation/snmpconsole/snmp_alert.php,
godmode/reporting/map_builder.php, operation/messages/message.php:
Removed old raya style and changed to new style.
* include/languages/language_en.php: Changed some typing error.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@509 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-06-13 21:14:05 +02:00
|
|
|
|
} else {
|
|
|
|
|
echo '<div class="nf">'.$lang_label["no_profile"].'</div>';
|
2006-03-27 05:37:27 +02:00
|
|
|
|
}
|
2007-06-13 Raul Mateos <raulofpandora@gmail.com>
* godmode/menu.php, operation/menu.php, include/pandora.css, include/op.css,
include/god.css: Updated with styles to avoid top and bottom border.
* godmode/groups/group_list.php, godmode/users/*.php, operation/users/*.php,
godmode/servers/*.php, operation/snmpconsole/snmp_alert.php,
godmode/reporting/map_builder.php, operation/messages/message.php:
Removed old raya style and changed to new style.
* include/languages/language_en.php: Changed some typing error.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@509 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-06-13 21:14:05 +02:00
|
|
|
|
echo '</table>';
|
2006-03-27 05:37:27 +02:00
|
|
|
|
} // fin pagina
|
|
|
|
|
|
|
|
|
|
?>
|