2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora - The Free Monitoring System
|
|
|
|
// This code is protected by GPL license.
|
|
|
|
// Este codigo esta protegido por la licencia GPL.
|
|
|
|
// Sancho Lerena <slerena@gmail.com>, 2003-2006
|
|
|
|
// Raul Mateos <raulofpandora@gmail.com>, 2005-2006
|
|
|
|
|
|
|
|
// Load global vars
|
2008-07-16 23:04:31 +02:00
|
|
|
require ("include/config.php");
|
|
|
|
check_login ();
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2008-07-16 23:04:31 +02:00
|
|
|
if ((give_acl($id_user, 0, "DM")==1) or (dame_admin($id_user)==1)) {
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2008-07-16 23:04:31 +02:00
|
|
|
require("godmode/db/times_incl.php");
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2008-07-16 23:04:31 +02:00
|
|
|
$datos_rango3=0;
|
|
|
|
$datos_rango2=0;
|
|
|
|
$datos_rango1=0;
|
2006-03-27 05:37:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
# ADQUIRE DATA PASSED AS FORM PARAMETERS
|
|
|
|
# ======================================
|
|
|
|
# Purge data using dates
|
|
|
|
# Purge data using dates
|
2008-07-16 23:04:31 +02:00
|
|
|
if (isset ($_POST["date_purge"])){
|
|
|
|
$from_date = mysql_real_esape_string ($_POST["date_purge"]);
|
|
|
|
$query = sprintf ("DELETE FROM `tevento` WHERE `timestamp` < '%s'",$from_date);
|
|
|
|
mysql_query ($query);
|
2006-03-27 05:37:27 +02:00
|
|
|
}
|
|
|
|
# End of get parameters block
|
|
|
|
|
2007-05-27 04:55:55 +02:00
|
|
|
echo "<h2>".$lang_label["dbmain_title"]." > ";
|
2007-10-12 18:27:50 +02:00
|
|
|
echo $lang_label["db_purge_event"]."</h2>";
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2007-06-06 18:23:24 +02:00
|
|
|
echo "<table cellpadding='4' cellspacing='4' class='databox'>";
|
2007-10-12 18:27:50 +02:00
|
|
|
echo "<tr><td class='datos'>";
|
2008-07-16 23:04:31 +02:00
|
|
|
$row = get_db_row_sql ("SELECT COUNT(*) AS total, MIN(timestamp) AS first_date, MAX(timestamp) AS latest_date FROM tevento");
|
|
|
|
|
2006-03-27 05:37:27 +02:00
|
|
|
echo "<b>".$lang_label["total"]."</b>";
|
2008-07-16 23:04:31 +02:00
|
|
|
echo "<td class='datos'>".$row["total"]." ".$lang_label["records"]."</td>";
|
2006-03-27 05:37:27 +02:00
|
|
|
|
|
|
|
echo "<tr>";
|
2007-06-06 18:23:24 +02:00
|
|
|
echo "<td class='datos2'><b>".$lang_label["first_date"]."</b></td>";
|
2008-07-16 23:04:31 +02:00
|
|
|
echo "<td class='datos2'>".$row["first_date"]."</td></tr>";
|
2006-03-27 05:37:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
echo "<tr><td class='datos'>";
|
|
|
|
echo "<b>".$lang_label["latest_date"]."</b>";
|
2008-07-16 23:04:31 +02:00
|
|
|
echo "<td class='datos'>".$row["latest_date"]."</td>";
|
2006-03-27 05:37:27 +02:00
|
|
|
echo "</table>";
|
|
|
|
?>
|
|
|
|
|
|
|
|
<h3><?php echo $lang_label["purge_data"] ?></h3>
|
|
|
|
<form name="db_audit" method="post" action="index.php?sec=gdbman&sec2=godmode/db/db_event">
|
2007-06-06 18:23:24 +02:00
|
|
|
<table width='300' cellpadding='4' cellspacing='4' class='databox'>
|
2006-03-27 05:37:27 +02:00
|
|
|
<tr><td class='datos'>
|
2007-04-18 23:45:03 +02:00
|
|
|
<select name="date_purge" width="255px">
|
2006-03-27 05:37:27 +02:00
|
|
|
<option value="<?php echo $month3 ?>"><?php echo $lang_label["purge_event_90day"] ?>
|
|
|
|
<option value="<?php echo $month ?>"><?php echo $lang_label["purge_event_30day"] ?>
|
|
|
|
<option value="<?php echo $week2 ?>"><?php echo $lang_label["purge_event_14day"] ?>
|
|
|
|
<option value="<?php echo $week ?>"><?php echo $lang_label["purge_event_7day"] ?>
|
|
|
|
<option value="<?php echo $d3 ?>"><?php echo $lang_label["purge_event_3day"] ?>
|
|
|
|
<option value="<?php echo $d1 ?>"><?php echo $lang_label["purge_event_1day"] ?>
|
|
|
|
<option value="<?php echo $all_data ?>"><?php echo $lang_label["purge_event_all"] ?>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<td class="datos">
|
2007-06-06 18:23:24 +02:00
|
|
|
<input class="sub wand" type="submit" name="purgedb" value="<?php echo $lang_label["doit"] ?>" onClick="if (!confirm('<?php echo $lang_label["are_you_sure"] ?>')) return false;">
|
2006-03-27 05:37:27 +02:00
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<?php
|
2008-07-16 23:04:31 +02:00
|
|
|
} else {
|
|
|
|
audit_db ($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Database Management Event");
|
2006-03-27 05:37:27 +02:00
|
|
|
require ("general/noaccess.php");
|
2008-07-16 23:04:31 +02:00
|
|
|
}
|
|
|
|
?>
|