2008-06-26 Esteban Sanchez <estebans@artica.es>
* general/logon_ok.php: Use pandora functions to show last sessions. * index.php: Tab and blankspaces style correction. * godmode/reporting/map_builder.php: Fixed field name when inserting a layout_data. Fixed group icon on list. * operation/visual_console/render_view.php: Deleted firebug debug which was causing not to work on browsers without that extension. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@900 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e28ac09264
commit
39dcecd957
|
@ -1,3 +1,15 @@
|
||||||
|
2008-06-26 Esteban Sanchez <estebans@artica.es>
|
||||||
|
|
||||||
|
* general/logon_ok.php: Use pandora functions to show last sessions.
|
||||||
|
|
||||||
|
* index.php: Tab and blankspaces style correction.
|
||||||
|
|
||||||
|
* godmode/reporting/map_builder.php: Fixed field name when inserting a
|
||||||
|
layout_data. Fixed group icon on list.
|
||||||
|
|
||||||
|
* operation/visual_console/render_view.php: Deleted firebug debug
|
||||||
|
which was causing not to work on browsers without that extension.
|
||||||
|
|
||||||
2008-06-26 Esteban Sanchez <estebans@artica.es>
|
2008-06-26 Esteban Sanchez <estebans@artica.es>
|
||||||
|
|
||||||
* ajax.php: Sed id_user in config array.
|
* ajax.php: Sed id_user in config array.
|
||||||
|
|
|
@ -158,44 +158,36 @@ echo "</table>";
|
||||||
echo "<div id='activity'>";
|
echo "<div id='activity'>";
|
||||||
// Show last activity from this user
|
// Show last activity from this user
|
||||||
echo "<h2>" . $lang_label["user_last_activity"] . "</h2>";
|
echo "<h2>" . $lang_label["user_last_activity"] . "</h2>";
|
||||||
// Show table header
|
|
||||||
echo '<table cellpadding="4" cellspacing="4" width="700" class="databox"><tr>';
|
|
||||||
echo '<th>' . $lang_label["user"] . '</th>';
|
|
||||||
echo '<th>' . $lang_label["action"] . '</th>';
|
|
||||||
echo '<th width="130px">' . $lang_label["date"] . '</th>';
|
|
||||||
echo '<th>' . $lang_label["src_address"] . '</th>';
|
|
||||||
echo '<th width="200px">' . $lang_label["comments"] . '</th></tr>';
|
|
||||||
|
|
||||||
// Skip offset records
|
|
||||||
$query1="SELECT * FROM tsesion WHERE (TO_DAYS(fecha) > TO_DAYS(NOW()) - 7)
|
|
||||||
AND ID_usuario = '" . $nick . "' ORDER BY fecha DESC limit 15";
|
|
||||||
|
|
||||||
$result = mysql_query ($query1);
|
|
||||||
$contador = 5; // Max items
|
|
||||||
$color = 1;
|
$color = 1;
|
||||||
while ($row = mysql_fetch_array ($result) && $contador > 0) {
|
|
||||||
|
|
||||||
if ($color == 1){
|
$table->width = '700px';
|
||||||
$tdcolor = "datos";
|
$table->data = array ();
|
||||||
$color = 0;
|
$table->size = array ();
|
||||||
} else {
|
$table->size[2] = '130px';
|
||||||
$tdcolor = "datos2";
|
$table->size[4] = '200px';
|
||||||
$color = 1;
|
$table->head = array ();
|
||||||
}
|
$table->head[0] = lang_string ('user');
|
||||||
|
$table->head[1] = lang_string ('action');
|
||||||
|
$table->head[2] = lang_string ('date');
|
||||||
|
$table->head[3] = lang_string ('src_address');
|
||||||
|
$table->head[4] = lang_string ('comments');
|
||||||
|
|
||||||
$usuario = $row["ID_usuario"];
|
$sql = sprintf ('SELECT * FROM tsesion WHERE (TO_DAYS(fecha) > TO_DAYS(NOW()) - 7)
|
||||||
echo '<tr>';
|
AND ID_usuario = "%s" ORDER BY fecha DESC LIMIT 5', $nick);
|
||||||
echo '<td class="' . $tdcolor . 'f9"><b>' . $usuario . '</b></td>';
|
$sessions = get_db_all_rows_sqlfree ($sql);
|
||||||
echo '<td class="' . $tdcolor . 'f9">' . $row["accion"]. '</td>';
|
foreach ($sessions as $session) {
|
||||||
echo '<td class="' . $tdcolor . 'f9">' . $row["fecha"]. '</td>';
|
$data = array ();
|
||||||
echo '<td class="' . $tdcolor . 'f9">' . $row["IP_origen"]. '</td>';
|
|
||||||
echo '<td class="' . $tdcolor . 'f9">' . $row["descripcion"]. '</td>';
|
|
||||||
echo '</tr>';
|
|
||||||
|
|
||||||
$contador--;
|
$data[0] = '<strong>'.$session['ID_usuario'].'</strong>';
|
||||||
|
$data[1] = $session['accion'];
|
||||||
|
$data[2] = $session['fecha'];
|
||||||
|
$data[3] = $session['IP_origen'];
|
||||||
|
$data[4] = $session['descripcion'];
|
||||||
|
|
||||||
|
array_push ($table->data, $data);
|
||||||
}
|
}
|
||||||
|
print_table ($table);
|
||||||
echo "</table>";
|
|
||||||
echo "</div>"; // activity
|
echo "</div>"; // activity
|
||||||
|
|
||||||
echo '</div>'; // class "jus"
|
echo '</div>'; // class "jus"
|
||||||
|
|
|
@ -147,7 +147,7 @@ if ($create_layout_data) {
|
||||||
$layout_data_map_linked = (int) get_parameter ("map_linked");
|
$layout_data_map_linked = (int) get_parameter ("map_linked");
|
||||||
|
|
||||||
$sql = sprintf ('INSERT INTO tlayout_data (id_layout, label, id_layout_linked,
|
$sql = sprintf ('INSERT INTO tlayout_data (id_layout, label, id_layout_linked,
|
||||||
label_color, image, type, id_agente_modulo, parent_item, period, link_color)
|
label_color, image, type, id_agente_modulo, parent_item, period, no_link_color)
|
||||||
VALUES (%d, "%s", %d, "%s", "%s", %d, %d, %d, %d, 1)',
|
VALUES (%d, "%s", %d, "%s", "%s", %d, %d, %d, %d, 1)',
|
||||||
$id_layout, $layout_data_label,
|
$id_layout, $layout_data_label,
|
||||||
$layout_data_map_linked,
|
$layout_data_map_linked,
|
||||||
|
@ -259,7 +259,7 @@ if (! $edit_layout && ! $id_layout) {
|
||||||
$data = array ();
|
$data = array ();
|
||||||
|
|
||||||
$data[0] = '<a href="index.php?sec=greporting&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'">'.$map['name'].'</a>';
|
$data[0] = '<a href="index.php?sec=greporting&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'">'.$map['name'].'</a>';
|
||||||
$data[1] = '<img src="images/'.dame_grupo_icono ($map['id_group']).'" /> ';
|
$data[1] = '<img src="images/'.dame_grupo_icono ($map['id_group']).'.png" /> ';
|
||||||
$data[1] .= dame_nombre_grupo ($map['id_group']);
|
$data[1] .= dame_nombre_grupo ($map['id_group']);
|
||||||
$data[2] = '<a href="index.php?sec=greporting&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&delete_layout=1">
|
$data[2] = '<a href="index.php?sec=greporting&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&delete_layout=1">
|
||||||
<img src="images/cross.png"></a>';
|
<img src="images/cross.png"></a>';
|
||||||
|
|
|
@ -115,145 +115,143 @@ require "include/functions_db.php";
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Show custom background
|
// Show custom background
|
||||||
if ($config["pure"] == 0)
|
if ($config["pure"] == 0)
|
||||||
echo '<body bgcolor="#555555">';
|
echo '<body bgcolor="#555555">';
|
||||||
else
|
else
|
||||||
echo '<body bgcolor="#FFFFFF">';
|
echo '<body bgcolor="#FFFFFF">';
|
||||||
|
|
||||||
$REMOTE_ADDR = getenv ("REMOTE_ADDR");
|
$REMOTE_ADDR = getenv ("REMOTE_ADDR");
|
||||||
|
|
||||||
// Login process
|
// Login process
|
||||||
if ( (! isset ($_SESSION['id_usuario'])) AND (isset ($_GET["login"]))) {
|
if ( (! isset ($_SESSION['id_usuario'])) && (isset ($_GET["login"]))) {
|
||||||
$nick = get_parameter_post ("nick");
|
$nick = get_parameter_post ("nick");
|
||||||
$pass = get_parameter_post ("pass");
|
$pass = get_parameter_post ("pass");
|
||||||
|
|
||||||
// Connect to Database
|
// Connect to Database
|
||||||
$sql1 = 'SELECT * FROM tusuario WHERE id_usuario = "'.$nick.'"';
|
$sql1 = 'SELECT * FROM tusuario WHERE id_usuario = "'.$nick.'"';
|
||||||
$result = mysql_query ($sql1);
|
$result = mysql_query ($sql1);
|
||||||
|
|
||||||
// For every registry
|
// For every registry
|
||||||
if ($row = mysql_fetch_array ($result)){
|
if ($row = mysql_fetch_array ($result)){
|
||||||
if ($row["password"] == md5 ($pass)){
|
if ($row["password"] == md5 ($pass)){
|
||||||
// Login OK
|
// Login OK
|
||||||
// Nick could be uppercase or lowercase (select in MySQL
|
// Nick could be uppercase or lowercase (select in MySQL
|
||||||
// is not case sensitive)
|
// is not case sensitive)
|
||||||
// We get DB nick to put in PHP Session variable,
|
// We get DB nick to put in PHP Session variable,
|
||||||
// to avoid problems with case-sensitive usernames.
|
// to avoid problems with case-sensitive usernames.
|
||||||
// Thanks to David Muñiz for Bug discovery :)
|
// Thanks to David Muñiz for Bug discovery :)
|
||||||
$nick = $row["id_usuario"];
|
$nick = $row["id_usuario"];
|
||||||
unset ($_GET["sec2"]);
|
unset ($_GET["sec2"]);
|
||||||
$_GET["sec"] = "general/logon_ok";
|
$_GET["sec"] = "general/logon_ok";
|
||||||
update_user_contact ($nick);
|
update_user_contact ($nick);
|
||||||
logon_db ($nick, $REMOTE_ADDR);
|
logon_db ($nick, $REMOTE_ADDR);
|
||||||
$_SESSION['id_usuario'] = $nick;
|
$_SESSION['id_usuario'] = $nick;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Login failed (bad password)
|
// Login failed (bad password)
|
||||||
unset ($_GET["sec2"]);
|
|
||||||
include "general/logon_failed.php";
|
|
||||||
// change password to do not show all string
|
|
||||||
$primera = substr ($pass,0,1);
|
|
||||||
$ultima = substr ($pass, strlen ($pass) - 1, 1);
|
|
||||||
$pass = $primera . "****" . $ultima;
|
|
||||||
audit_db ($nick, $REMOTE_ADDR, "Logon Failed",
|
|
||||||
"Incorrect password: " . $nick . " / " . $pass);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// User not known
|
|
||||||
unset ($_GET["sec2"]);
|
unset ($_GET["sec2"]);
|
||||||
include "general/logon_failed.php";
|
include "general/logon_failed.php";
|
||||||
$primera = substr ($pass, 0, 1);
|
// change password to do not show all string
|
||||||
|
$primera = substr ($pass,0,1);
|
||||||
$ultima = substr ($pass, strlen ($pass) - 1, 1);
|
$ultima = substr ($pass, strlen ($pass) - 1, 1);
|
||||||
$pass = $primera . "****" . $ultima;
|
$pass = $primera . "****" . $ultima;
|
||||||
audit_db ($nick, $REMOTE_ADDR, "Logon Failed",
|
audit_db ($nick, $REMOTE_ADDR, "Logon Failed",
|
||||||
"Invalid username: " . $nick . " / " . $pass);
|
"Incorrect password: " . $nick . " / " . $pass);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
} elseif (! isset ($_SESSION['id_usuario'])) {
|
}
|
||||||
// There is no user connected
|
else {
|
||||||
include "general/login_page.php";
|
// User not known
|
||||||
|
unset ($_GET["sec2"]);
|
||||||
|
include "general/logon_failed.php";
|
||||||
|
$primera = substr ($pass, 0, 1);
|
||||||
|
$ultima = substr ($pass, strlen ($pass) - 1, 1);
|
||||||
|
$pass = $primera . "****" . $ultima;
|
||||||
|
audit_db ($nick, $REMOTE_ADDR, "Logon Failed",
|
||||||
|
"Invalid username: " . $nick . " / " . $pass);
|
||||||
exit;
|
exit;
|
||||||
|
}
|
||||||
|
} elseif (! isset ($_SESSION['id_usuario'])) {
|
||||||
|
// There is no user connected
|
||||||
|
include "general/login_page.php";
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
// There is session for id_usuario
|
||||||
|
$config["id_user"] = $_SESSION["id_usuario"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Log off
|
||||||
|
if (isset ($_GET["bye"])) {
|
||||||
|
include "general/logoff.php";
|
||||||
|
$iduser = $_SESSION["id_usuario"];
|
||||||
|
logoff_db ($iduser, $REMOTE_ADDR);
|
||||||
|
session_unregister ("id_usuario");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$pagina = "";
|
||||||
|
if (isset ($_GET["sec2"])){
|
||||||
|
$sec2 = get_parameter_get ('sec2');
|
||||||
|
$sec2 = parameter_extra_clean ($sec2);
|
||||||
|
$pagina = $sec2;
|
||||||
|
} else
|
||||||
|
$sec2 = "";
|
||||||
|
|
||||||
|
if (isset ($_GET["sec"])){
|
||||||
|
$sec = get_parameter_get ('sec');
|
||||||
|
$sec = parameter_extra_clean ($sec);
|
||||||
|
$pagina = $sec2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$sec = "";
|
||||||
|
// http://es2.php.net/manual/en/ref.session.php#64525
|
||||||
|
// Session locking concurrency speedup!
|
||||||
|
session_write_close();
|
||||||
|
|
||||||
|
// Header
|
||||||
|
if ($config["pure"] == 0){
|
||||||
|
echo '<div id="container">';
|
||||||
|
echo '<div id="head">';
|
||||||
|
require("general/header.php");
|
||||||
|
echo '</div>';
|
||||||
|
echo '<div id="page">';
|
||||||
|
echo ' <div id="menu">';
|
||||||
|
require ("general/main_menu.php");
|
||||||
|
echo ' </div>';
|
||||||
|
} else {
|
||||||
|
echo '<div id="main_pure">';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main block of content
|
||||||
|
if ($config["pure"] == 0){
|
||||||
|
echo '<div id="main">';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Page loader / selector
|
||||||
|
if ($pagina != ""){
|
||||||
|
if (file_exists ($pagina . ".php")) {
|
||||||
|
require ($pagina . ".php");
|
||||||
} else {
|
} else {
|
||||||
// There is session for id_usuario
|
echo "<br><b class='error'>".lang_string("Sorry! I can't find the page!")."</b>";
|
||||||
$config["id_user"] = $_SESSION["id_usuario"];
|
|
||||||
//$id_usuario = entrada_limpia ($_SESSION["id_usuario"]);
|
|
||||||
//$id_user = entrada_limpia ($_SESSION["id_usuario"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Log off
|
|
||||||
if (isset ($_GET["bye"])) {
|
|
||||||
include "general/logoff.php";
|
|
||||||
$iduser = $_SESSION["id_usuario"];
|
|
||||||
logoff_db ($iduser, $REMOTE_ADDR);
|
|
||||||
session_unregister ("id_usuario");
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
$pagina = "";
|
} else
|
||||||
if (isset ($_GET["sec2"])){
|
require ("general/logon_ok.php"); //default
|
||||||
$sec2 = get_parameter_get ('sec2');
|
|
||||||
$sec2 = parameter_extra_clean ($sec2);
|
|
||||||
$pagina = $sec2;
|
|
||||||
} else
|
|
||||||
$sec2 = "";
|
|
||||||
|
|
||||||
if (isset ($_GET["sec"])){
|
if ($config["pure"] == 0){
|
||||||
$sec = get_parameter_get ('sec');
|
echo '</div>'; // main
|
||||||
$sec = parameter_extra_clean ($sec);
|
echo '<div style="clear:both"></div>';
|
||||||
$pagina = $sec2;
|
echo '</div>'; // page
|
||||||
}
|
} else {
|
||||||
else
|
echo "</div>";
|
||||||
$sec = "";
|
}
|
||||||
// http://es2.php.net/manual/en/ref.session.php#64525
|
|
||||||
// Session locking concurrency speedup!
|
|
||||||
session_write_close();
|
|
||||||
|
|
||||||
// Header
|
if ($config["pure"] == 0) {
|
||||||
if ($config["pure"] == 0){
|
echo '<div id="foot">';
|
||||||
echo '<div id="container">';
|
require("general/footer.php");
|
||||||
echo '<div id="head">';
|
echo '</div>';
|
||||||
require("general/header.php");
|
echo '</div>';
|
||||||
echo '</div>';
|
}
|
||||||
echo '<div id="page">';
|
|
||||||
echo ' <div id="menu">';
|
|
||||||
require ("general/main_menu.php");
|
|
||||||
echo ' </div>';
|
|
||||||
} else {
|
|
||||||
echo '<div id="main_pure">';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Main block of content
|
echo '</body></html>';
|
||||||
if ($config["pure"] == 0){
|
|
||||||
echo '<div id="main">';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Page loader / selector
|
|
||||||
if ($pagina != ""){
|
|
||||||
if (file_exists ($pagina . ".php")) {
|
|
||||||
require ($pagina . ".php");
|
|
||||||
} else {
|
|
||||||
echo "<br><b class='error'>".lang_string("Sorry! I can't find the page!")."</b>";
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
require ("general/logon_ok.php"); //default
|
|
||||||
|
|
||||||
if ($config["pure"] == 0){
|
|
||||||
echo '</div>'; // main
|
|
||||||
echo '<div style="clear:both"></div>';
|
|
||||||
echo '</div>'; // page
|
|
||||||
} else {
|
|
||||||
echo "</div>";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($config["pure"] == 0){
|
|
||||||
echo '<div id="foot">';
|
|
||||||
require("general/footer.php");
|
|
||||||
echo '</div>';
|
|
||||||
echo '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '</body></html>';
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -120,7 +120,6 @@ $(document).ready (function () {
|
||||||
<?php if ($refr) : ?>
|
<?php if ($refr) : ?>
|
||||||
t = new Date();
|
t = new Date();
|
||||||
t.setTime (t.getTime() + <?=$refr * 1000?>);
|
t.setTime (t.getTime() + <?=$refr * 1000?>);
|
||||||
console.log (t);
|
|
||||||
$.countdown.setDefaults($.countdown.regional["<?=$config['language']?>"]);
|
$.countdown.setDefaults($.countdown.regional["<?=$config['language']?>"]);
|
||||||
$("#countdown").countdown({until: t, format: 'MS', description: '<?=lang_string ("Until refresh")?>'});
|
$("#countdown").countdown({until: t, format: 'MS', description: '<?=lang_string ("Until refresh")?>'});
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
Loading…
Reference in New Issue