mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
2011-04-20 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_events.php include/functions_reporting.php include/functions_alerts.php operation/incidents/incident_detail.php operation/agentes/status_events.php operation/agentes/tactical.php operation/integria_incidents/incident_detail.php operation/events/events_validate.php operation/events/events_list.php operation/events/events.php operation/reporting/reporting_xml.php: Functions in functions_events.php have "events_" prefix. * index.php: Added some "db_" prefixes that I forgot in my last commit. Functions in functions_events.php have "events_" prefix. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4260 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
a7fdc8fa26
commit
e0b62c0733
@ -1,3 +1,20 @@
|
|||||||
|
2011-04-20 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
|
* include/functions_events.php
|
||||||
|
include/functions_reporting.php
|
||||||
|
include/functions_alerts.php
|
||||||
|
operation/incidents/incident_detail.php
|
||||||
|
operation/agentes/status_events.php
|
||||||
|
operation/agentes/tactical.php
|
||||||
|
operation/integria_incidents/incident_detail.php
|
||||||
|
operation/events/events_validate.php
|
||||||
|
operation/events/events_list.php
|
||||||
|
operation/events/events.php
|
||||||
|
operation/reporting/reporting_xml.php: Functions in functions_events.php have "events_"
|
||||||
|
prefix.
|
||||||
|
* index.php: Added some "db_" prefixes that I forgot in my last commit. Functions in
|
||||||
|
functions_events.php have "events_" prefix.
|
||||||
|
|
||||||
2011-04-19 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
2011-04-19 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||||
|
|
||||||
* Changelog: Forget to update the Changelog in my last commit.
|
* Changelog: Forget to update the Changelog in my last commit.
|
||||||
|
@ -1124,7 +1124,7 @@ function alerts_validate_alert_agent_module ($id_alert_agent_module) {
|
|||||||
array ('id' => $id));
|
array ('id' => $id));
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
create_event ("Manual validation of alert for ".
|
events_create_event ("Manual validation of alert for ".
|
||||||
alerts_get_alert_template_description ($alert["id_alert_template"]),
|
alerts_get_alert_template_description ($alert["id_alert_template"]),
|
||||||
$group_id, $agent_id, 1, $config["id_user"],
|
$group_id, $agent_id, 1, $config["id_user"],
|
||||||
"alert_manual_validation", 1, $alert["id_agent_module"],
|
"alert_manual_validation", 1, $alert["id_agent_module"],
|
||||||
@ -1480,7 +1480,7 @@ function alerts_validate_alert_compound ($id_alert_compound) {
|
|||||||
array ('id' => $id));
|
array ('id' => $id));
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
create_event ("Manual validation of compound alert for ".
|
events_create_event ("Manual validation of compound alert for ".
|
||||||
$alert["name"],
|
$alert["name"],
|
||||||
$group_id, $agent_id, 1, $config["id_user"],
|
$group_id, $agent_id, 1, $config["id_user"],
|
||||||
"alert_manual_validation", 1, $alert["id"],
|
"alert_manual_validation", 1, $alert["id"],
|
||||||
|
@ -42,11 +42,11 @@
|
|||||||
*
|
*
|
||||||
* @return mixed False in case of error or invalid values passed. Affected rows otherwise
|
* @return mixed False in case of error or invalid values passed. Affected rows otherwise
|
||||||
*/
|
*/
|
||||||
function get_events ($filter = false, $fields = false) {
|
function events_get_events ($filter = false, $fields = false) {
|
||||||
return db_get_all_rows_filter ('tevento', $filter, $fields);
|
return db_get_all_rows_filter ('tevento', $filter, $fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_event ($id, $fields = false) {
|
function events_get_event ($id, $fields = false) {
|
||||||
if (empty ($id))
|
if (empty ($id))
|
||||||
return false;
|
return false;
|
||||||
global $config;
|
global $config;
|
||||||
@ -72,9 +72,9 @@ function get_event ($id, $fields = false) {
|
|||||||
*
|
*
|
||||||
* @return array A list of events ids.
|
* @return array A list of events ids.
|
||||||
*/
|
*/
|
||||||
function get_similar_events_ids ($id) {
|
function events_get_similar_ids ($id) {
|
||||||
$ids = array ();
|
$ids = array ();
|
||||||
$event = get_event ($id, array ('evento', 'id_agentmodule'));
|
$event = events_get_event ($id, array ('evento', 'id_agentmodule'));
|
||||||
if ($event === false)
|
if ($event === false)
|
||||||
return $ids;
|
return $ids;
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ function get_similar_events_ids ($id) {
|
|||||||
*
|
*
|
||||||
* @return bool Whether or not it was successful
|
* @return bool Whether or not it was successful
|
||||||
*/
|
*/
|
||||||
function delete_event ($id_event, $similar = true) {
|
function events_delete_event ($id_event, $similar = true) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
//Cleans up the selection for all unwanted values also casts any single values as an array
|
//Cleans up the selection for all unwanted values also casts any single values as an array
|
||||||
@ -108,7 +108,7 @@ function delete_event ($id_event, $similar = true) {
|
|||||||
/* We must delete all events like the selected */
|
/* We must delete all events like the selected */
|
||||||
if ($similar) {
|
if ($similar) {
|
||||||
foreach ($id_event as $id) {
|
foreach ($id_event as $id) {
|
||||||
$id_event = array_merge ($id_event, get_similar_events_ids ($id));
|
$id_event = array_merge ($id_event, events_get_similar_ids ($id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ function delete_event ($id_event, $similar = true) {
|
|||||||
foreach ($id_event as $event) {
|
foreach ($id_event as $event) {
|
||||||
$ret = db_process_sql_delete('tevento', array('id_evento' => $event));
|
$ret = db_process_sql_delete('tevento', array('id_evento' => $event));
|
||||||
|
|
||||||
if (check_acl ($config["id_user"], get_event_group ($event), "IM") == 0) {
|
if (check_acl ($config["id_user"], events_get_group ($event), "IM") == 0) {
|
||||||
//Check ACL
|
//Check ACL
|
||||||
db_pandora_audit("ACL Violation", "Attempted deleting event #".$event);
|
db_pandora_audit("ACL Violation", "Attempted deleting event #".$event);
|
||||||
}
|
}
|
||||||
@ -150,7 +150,7 @@ function delete_event ($id_event, $similar = true) {
|
|||||||
*
|
*
|
||||||
* @return bool Whether or not it was successful
|
* @return bool Whether or not it was successful
|
||||||
*/
|
*/
|
||||||
function validate_event ($id_event, $similars = true, $comment = '', $new_status = 1) {
|
function events_validate_event ($id_event, $similars = true, $comment = '', $new_status = 1) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
//Cleans up the selection for all unwanted values also casts any single values as an array
|
//Cleans up the selection for all unwanted values also casts any single values as an array
|
||||||
@ -159,7 +159,7 @@ function validate_event ($id_event, $similars = true, $comment = '', $new_status
|
|||||||
/* We must validate all events like the selected */
|
/* We must validate all events like the selected */
|
||||||
if ($similars) {
|
if ($similars) {
|
||||||
foreach ($id_event as $id) {
|
foreach ($id_event as $id) {
|
||||||
$id_event = array_merge ($id_event, get_similar_events_ids ($id));
|
$id_event = array_merge ($id_event, events_get_similar_ids ($id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ function validate_event ($id_event, $similars = true, $comment = '', $new_status
|
|||||||
$comment = '<b>-- '.$new_status_string.' '.__('by').' '.$config['id_user'].' '.'['.date ($config["date_format"]).'] --</b><br>'.$commentbox;
|
$comment = '<b>-- '.$new_status_string.' '.__('by').' '.$config['id_user'].' '.'['.date ($config["date_format"]).'] --</b><br>'.$commentbox;
|
||||||
|
|
||||||
foreach ($id_event as $event) {
|
foreach ($id_event as $event) {
|
||||||
$fullevent = get_event($event);
|
$fullevent = events_get_event($event);
|
||||||
|
|
||||||
if($fullevent['user_comment'] != ''){
|
if($fullevent['user_comment'] != ''){
|
||||||
$commentbox = '<div style="border:1px dotted #CCC; min-height: 10px;">'.$fullevent['user_comment'].'</div>';
|
$commentbox = '<div style="border:1px dotted #CCC; min-height: 10px;">'.$fullevent['user_comment'].'</div>';
|
||||||
@ -200,7 +200,7 @@ function validate_event ($id_event, $similars = true, $comment = '', $new_status
|
|||||||
|
|
||||||
$ret = db_process_sql_update('tevento', $values, array('id_evento' => $event), 'AND', false);
|
$ret = db_process_sql_update('tevento', $values, array('id_evento' => $event), 'AND', false);
|
||||||
|
|
||||||
if (check_acl ($config["id_user"], get_event_group ($event), "IW") == 0) {
|
if (check_acl ($config["id_user"], events_get_group ($event), "IW") == 0) {
|
||||||
//Check ACL
|
//Check ACL
|
||||||
db_pandora_audit("ACL Violation", "Attempted updating event #".$event);
|
db_pandora_audit("ACL Violation", "Attempted updating event #".$event);
|
||||||
}
|
}
|
||||||
@ -233,7 +233,7 @@ function validate_event ($id_event, $similars = true, $comment = '', $new_status
|
|||||||
*
|
*
|
||||||
* @return int Group id of the given event.
|
* @return int Group id of the given event.
|
||||||
*/
|
*/
|
||||||
function get_event_group ($id_event) {
|
function events_get_group ($id_event) {
|
||||||
return (int) db_get_value ('id_grupo', 'tevento', 'id_evento', (int) $id_event);
|
return (int) db_get_value ('id_grupo', 'tevento', 'id_evento', (int) $id_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ function get_event_group ($id_event) {
|
|||||||
*
|
*
|
||||||
* @return string Description of the given event.
|
* @return string Description of the given event.
|
||||||
*/
|
*/
|
||||||
function get_event_description ($id_event) {
|
function events_get_description ($id_event) {
|
||||||
return (string) db_get_value ('evento', 'tevento', 'id_evento', (int) $id_event);
|
return (string) db_get_value ('evento', 'tevento', 'id_evento', (int) $id_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ function get_event_description ($id_event) {
|
|||||||
*
|
*
|
||||||
* @return int event id
|
* @return int event id
|
||||||
*/
|
*/
|
||||||
function create_event ($event, $id_group, $id_agent, $status = 0, $id_user = "", $event_type = "unknown", $priority = 0, $id_agent_module = 0, $id_aam = 0) {
|
function events_create_event ($event, $id_group, $id_agent, $status = 0, $id_user = "", $event_type = "unknown", $priority = 0, $id_agent_module = 0, $id_aam = 0) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
@ -306,7 +306,7 @@ function create_event ($event, $id_group, $id_agent, $status = 0, $id_user = "",
|
|||||||
*
|
*
|
||||||
* @return string HTML with table element
|
* @return string HTML with table element
|
||||||
*/
|
*/
|
||||||
function print_events_table ($filter = "", $limit = 10, $width = 440, $return = false) {
|
function events_print_event_table ($filter = "", $limit = 10, $width = 440, $return = false) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
@ -416,7 +416,7 @@ function print_events_table ($filter = "", $limit = 10, $width = 440, $return =
|
|||||||
"title" => get_priority_name ($event["criticity"])));
|
"title" => get_priority_name ($event["criticity"])));
|
||||||
|
|
||||||
/* Event type */
|
/* Event type */
|
||||||
$data[2] = print_event_type_img ($event["event_type"], true);
|
$data[2] = events_print_type_img ($event["event_type"], true);
|
||||||
|
|
||||||
// Event description wrap around by default at 44 or ~3 lines (10 seems to be a good ratio to wrap around for most sizes. Smaller number gets longer strings)
|
// Event description wrap around by default at 44 or ~3 lines (10 seems to be a good ratio to wrap around for most sizes. Smaller number gets longer strings)
|
||||||
$wrap = floor ($width / 10);
|
$wrap = floor ($width / 10);
|
||||||
@ -467,56 +467,56 @@ function print_events_table ($filter = "", $limit = 10, $width = 440, $return =
|
|||||||
*
|
*
|
||||||
* @return string HTML with img
|
* @return string HTML with img
|
||||||
*/
|
*/
|
||||||
function print_event_type_img ($type, $return = false) {
|
function events_print_type_img ($type, $return = false) {
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case "alert_recovered":
|
case "alert_recovered":
|
||||||
$output .= print_image ("images/error.png", true,
|
$output .= print_image ("images/error.png", true,
|
||||||
array ("title" => print_event_type_description($type, true)));
|
array ("title" => events_print_type_description($type, true)));
|
||||||
break;
|
break;
|
||||||
case "alert_manual_validation":
|
case "alert_manual_validation":
|
||||||
$output .= print_image ("images/eye.png", true,
|
$output .= print_image ("images/eye.png", true,
|
||||||
array ("title" => print_event_type_description($type, true)));
|
array ("title" => events_print_type_description($type, true)));
|
||||||
break;
|
break;
|
||||||
case "going_up_warning":
|
case "going_up_warning":
|
||||||
$output .= print_image ("images/b_yellow.png", true,
|
$output .= print_image ("images/b_yellow.png", true,
|
||||||
array ("title" => print_event_type_description($type, true)));
|
array ("title" => events_print_type_description($type, true)));
|
||||||
break;
|
break;
|
||||||
case "going_down_critical":
|
case "going_down_critical":
|
||||||
case "going_up_critical": //This is to be backwards compatible
|
case "going_up_critical": //This is to be backwards compatible
|
||||||
$output .= print_image ("images/b_red.png", true,
|
$output .= print_image ("images/b_red.png", true,
|
||||||
array ("title" => print_event_type_description($type, true)));
|
array ("title" => events_print_type_description($type, true)));
|
||||||
break;
|
break;
|
||||||
case "going_up_normal":
|
case "going_up_normal":
|
||||||
case "going_down_normal": //This is to be backwards compatible
|
case "going_down_normal": //This is to be backwards compatible
|
||||||
$output .= print_image ("images/b_green.png", true,
|
$output .= print_image ("images/b_green.png", true,
|
||||||
array ("title" => print_event_type_description($type, true)));
|
array ("title" => events_print_type_description($type, true)));
|
||||||
break;
|
break;
|
||||||
case "going_down_warning":
|
case "going_down_warning":
|
||||||
$output .= print_image ("images/b_yellow.png", true,
|
$output .= print_image ("images/b_yellow.png", true,
|
||||||
array ("title" => print_event_type_description($type, true)));
|
array ("title" => events_print_type_description($type, true)));
|
||||||
break;
|
break;
|
||||||
case "alert_fired":
|
case "alert_fired":
|
||||||
$output .= print_image ("images/bell.png", true,
|
$output .= print_image ("images/bell.png", true,
|
||||||
array ("title" => print_event_type_description($type, true)));
|
array ("title" => events_print_type_description($type, true)));
|
||||||
break;
|
break;
|
||||||
case "system";
|
case "system";
|
||||||
$output .= print_image ("images/cog.png", true,
|
$output .= print_image ("images/cog.png", true,
|
||||||
array ("title" => print_event_type_description($type, true)));
|
array ("title" => events_print_type_description($type, true)));
|
||||||
break;
|
break;
|
||||||
case "recon_host_detected";
|
case "recon_host_detected";
|
||||||
$output .= print_image ("images/network.png", true,
|
$output .= print_image ("images/network.png", true,
|
||||||
array ("title" => print_event_type_description($type, true)));
|
array ("title" => events_print_type_description($type, true)));
|
||||||
break;
|
break;
|
||||||
case "new_agent";
|
case "new_agent";
|
||||||
$output .= print_image ("images/wand.png", true,
|
$output .= print_image ("images/wand.png", true,
|
||||||
array ("title" => print_event_type_description($type, true)));
|
array ("title" => events_print_type_description($type, true)));
|
||||||
break;
|
break;
|
||||||
case "unknown":
|
case "unknown":
|
||||||
default:
|
default:
|
||||||
$output .= print_image ("images/err.png", true,
|
$output .= print_image ("images/err.png", true,
|
||||||
array ("title" => print_event_type_description($type, true)));
|
array ("title" => events_print_type_description($type, true)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,7 +533,7 @@ function print_event_type_img ($type, $return = false) {
|
|||||||
*
|
*
|
||||||
* @return string HTML with img
|
* @return string HTML with img
|
||||||
*/
|
*/
|
||||||
function print_event_type_description ($type, $return = false) {
|
function events_print_type_description ($type, $return = false) {
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
@ -591,7 +591,7 @@ function print_event_type_description ($type, $return = false) {
|
|||||||
*
|
*
|
||||||
* @return array An array with all the events happened.
|
* @return array An array with all the events happened.
|
||||||
*/
|
*/
|
||||||
function get_group_events ($id_group, $period, $date) {
|
function events_get_group ($id_group, $period, $date) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$id_group = safe_acl_group ($config["id_user"], $id_group, "AR");
|
$id_group = safe_acl_group ($config["id_user"], $id_group, "AR");
|
||||||
@ -623,7 +623,7 @@ function get_group_events ($id_group, $period, $date) {
|
|||||||
*
|
*
|
||||||
* @return array An array with all the events happened.
|
* @return array An array with all the events happened.
|
||||||
*/
|
*/
|
||||||
function get_agent_events ($id_agent, $period, $date = 0) {
|
function events_get_agent ($id_agent, $period, $date = 0) {
|
||||||
if (!is_numeric ($date)) {
|
if (!is_numeric ($date)) {
|
||||||
$date = strtotime ($date);
|
$date = strtotime ($date);
|
||||||
}
|
}
|
||||||
@ -654,7 +654,7 @@ function get_agent_events ($id_agent, $period, $date = 0) {
|
|||||||
*
|
*
|
||||||
* @return array An array with all the events happened.
|
* @return array An array with all the events happened.
|
||||||
*/
|
*/
|
||||||
function get_module_events ($id_agent_module, $period, $date = 0) {
|
function events_get_module ($id_agent_module, $period, $date = 0) {
|
||||||
if (!is_numeric ($date)) {
|
if (!is_numeric ($date)) {
|
||||||
$date = strtotime ($date);
|
$date = strtotime ($date);
|
||||||
}
|
}
|
||||||
|
@ -921,7 +921,7 @@ function event_reporting ($id_group, $period, $date = 0, $return = false) {
|
|||||||
$table->head[2] = __('User ID');
|
$table->head[2] = __('User ID');
|
||||||
$table->head[3] = __('Timestamp');
|
$table->head[3] = __('Timestamp');
|
||||||
|
|
||||||
$events = get_group_events ($id_group, $period, $date);
|
$events = events_get_group ($id_group, $period, $date);
|
||||||
if (empty ($events)) {
|
if (empty ($events)) {
|
||||||
$events = array ();
|
$events = array ();
|
||||||
}
|
}
|
||||||
@ -1600,7 +1600,7 @@ function get_agents_detailed_event_reporting ($id_agents, $period = 0, $date = 0
|
|||||||
$events = array ();
|
$events = array ();
|
||||||
|
|
||||||
foreach ($id_agents as $id_agent) {
|
foreach ($id_agents as $id_agent) {
|
||||||
$event = get_agent_events ($id_agent, (int) $period, (int) $date);
|
$event = events_get_agent ($id_agent, (int) $period, (int) $date);
|
||||||
if (!empty ($event)) {
|
if (!empty ($event)) {
|
||||||
array_push ($events, $event);
|
array_push ($events, $event);
|
||||||
}
|
}
|
||||||
@ -1651,7 +1651,7 @@ function get_group_detailed_event_reporting ($id_group, $period = 0, $date = 0,
|
|||||||
$table->head[2] = __('Criticity');
|
$table->head[2] = __('Criticity');
|
||||||
$table->head[3] = __('Timestamp');
|
$table->head[3] = __('Timestamp');
|
||||||
|
|
||||||
$events = get_group_events($id_group, $period, $date);
|
$events = events_get_group($id_group, $period, $date);
|
||||||
|
|
||||||
if ($events) {
|
if ($events) {
|
||||||
foreach ($events as $event) {
|
foreach ($events as $event) {
|
||||||
@ -1715,7 +1715,7 @@ function get_module_detailed_event_reporting ($id_modules, $period = 0, $date =
|
|||||||
$events = array ();
|
$events = array ();
|
||||||
|
|
||||||
foreach ($id_modules as $id_module) {
|
foreach ($id_modules as $id_module) {
|
||||||
$event = get_module_events ($id_module, (int) $period, (int) $date);
|
$event = events_get_module ($id_module, (int) $period, (int) $date);
|
||||||
if (!empty ($event)) {
|
if (!empty ($event)) {
|
||||||
array_push ($events, $event);
|
array_push ($events, $event);
|
||||||
}
|
}
|
||||||
|
@ -145,13 +145,13 @@ if (! isset ($config['id_user']) && isset ($_GET["loginhash"])) {
|
|||||||
$loginhash_user = get_parameter("loginhash_user", "");
|
$loginhash_user = get_parameter("loginhash_user", "");
|
||||||
|
|
||||||
if ($config["loginhash_pwd"] != "" && $loginhash_data == md5($loginhash_user.$config["loginhash_pwd"])) {
|
if ($config["loginhash_pwd"] != "" && $loginhash_data == md5($loginhash_user.$config["loginhash_pwd"])) {
|
||||||
logon_db ($loginhash_user, $_SERVER['REMOTE_ADDR']);
|
db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']);
|
||||||
$_SESSION['id_usuario'] = $loginhash_user;
|
$_SESSION['id_usuario'] = $loginhash_user;
|
||||||
$config["id_user"] = $loginhash_user;
|
$config["id_user"] = $loginhash_user;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
require_once ('general/login_page.php');
|
require_once ('general/login_page.php');
|
||||||
pandora_audit("Logon Failed (loginhash", "", "system");
|
db_pandora_audit("Logon Failed (loginhash", "", "system");
|
||||||
while (@ob_end_flush ());
|
while (@ob_end_flush ());
|
||||||
exit ("</html>");
|
exit ("</html>");
|
||||||
}
|
}
|
||||||
@ -162,8 +162,8 @@ elseif (! isset ($config['id_user']) && isset ($_GET["login"])) {
|
|||||||
$config["auth_error"] = ""; //Set this to the error message from the authorization mechanism
|
$config["auth_error"] = ""; //Set this to the error message from the authorization mechanism
|
||||||
$nick = get_parameter_post ("nick"); //This is the variable with the login
|
$nick = get_parameter_post ("nick"); //This is the variable with the login
|
||||||
$pass = get_parameter_post ("pass"); //This is the variable with the password
|
$pass = get_parameter_post ("pass"); //This is the variable with the password
|
||||||
$nick = escape_string_sql($nick);
|
$nick = db_escape_string_sql($nick);
|
||||||
$pass = escape_string_sql($pass);
|
$pass = db_escape_string_sql($pass);
|
||||||
// process_user_login is a virtual function which should be defined in each auth file.
|
// process_user_login is a virtual function which should be defined in each auth file.
|
||||||
// It accepts username and password. The rest should be internal to the auth file.
|
// It accepts username and password. The rest should be internal to the auth file.
|
||||||
// The auth file can set $config["auth_error"] to an informative error output or reference their internal error messages to it
|
// The auth file can set $config["auth_error"] to an informative error output or reference their internal error messages to it
|
||||||
@ -173,7 +173,7 @@ elseif (! isset ($config['id_user']) && isset ($_GET["login"])) {
|
|||||||
if ($nick_in_db !== false) {
|
if ($nick_in_db !== false) {
|
||||||
unset ($_GET["sec2"]);
|
unset ($_GET["sec2"]);
|
||||||
$_GET["sec"] = "general/logon_ok";
|
$_GET["sec"] = "general/logon_ok";
|
||||||
logon_db ($nick_in_db, $_SERVER['REMOTE_ADDR']);
|
db_logon ($nick_in_db, $_SERVER['REMOTE_ADDR']);
|
||||||
$_SESSION['id_usuario'] = $nick_in_db;
|
$_SESSION['id_usuario'] = $nick_in_db;
|
||||||
$config['id_user'] = $nick_in_db;
|
$config['id_user'] = $nick_in_db;
|
||||||
//Remove everything that might have to do with people's passwords or logins
|
//Remove everything that might have to do with people's passwords or logins
|
||||||
@ -195,7 +195,7 @@ elseif (! isset ($config['id_user']) && isset ($_GET["login"])) {
|
|||||||
// User not known
|
// User not known
|
||||||
$login_failed = true;
|
$login_failed = true;
|
||||||
require_once ('general/login_page.php');
|
require_once ('general/login_page.php');
|
||||||
pandora_audit("Logon Failed", "Invalid login: ".$nick, $nick);
|
db_pandora_audit("Logon Failed", "Invalid login: ".$nick, $nick);
|
||||||
while (@ob_end_flush ());
|
while (@ob_end_flush ());
|
||||||
exit ("</html>");
|
exit ("</html>");
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ elseif (! isset ($config['id_user'])) {
|
|||||||
if (isset ($_GET["bye"])) {
|
if (isset ($_GET["bye"])) {
|
||||||
include ("general/logoff.php");
|
include ("general/logoff.php");
|
||||||
$iduser = $_SESSION["id_usuario"];
|
$iduser = $_SESSION["id_usuario"];
|
||||||
logoff_db ($iduser, $_SERVER['REMOTE_ADDR']);
|
db_logoff ($iduser, $_SERVER['REMOTE_ADDR']);
|
||||||
// Unregister Session (compatible with 5.2 and 6.x, old code was deprecated
|
// Unregister Session (compatible with 5.2 and 6.x, old code was deprecated
|
||||||
unset($_SESSION['id_usuario']);
|
unset($_SESSION['id_usuario']);
|
||||||
unset($iduser);
|
unset($iduser);
|
||||||
@ -290,7 +290,7 @@ if ($config["pure"] == 0) {
|
|||||||
}
|
}
|
||||||
while (@ob_end_flush ());
|
while (@ob_end_flush ());
|
||||||
|
|
||||||
print_database_debug ();
|
db_print_database_debug ();
|
||||||
echo '</html>';
|
echo '</html>';
|
||||||
|
|
||||||
$run_time = format_numeric (microtime (true) - $config['start_time'], 3);
|
$run_time = format_numeric (microtime (true) - $config['start_time'], 3);
|
||||||
|
@ -25,6 +25,6 @@ if (!isset($id_agente)){
|
|||||||
require_once ("include/functions_events.php");
|
require_once ("include/functions_events.php");
|
||||||
|
|
||||||
echo "<h3>".__('Latest events for this agent')."</h3>";
|
echo "<h3>".__('Latest events for this agent')."</h3>";
|
||||||
print_events_table ("WHERE id_agente = $id_agente", $limit = 10, $width=750);
|
events_print_event_table ("WHERE id_agente = $id_agente", $limit = 10, $width=750);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -226,7 +226,7 @@ echo '<div style="width: 75%; float:left;" id="rightcolumn">';
|
|||||||
// Last events information
|
// Last events information
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
print_events_table ("WHERE estado<>1 ", 10, "100%");
|
events_print_event_table ("WHERE estado<>1 ", 10, "100%");
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
@ -39,14 +39,14 @@ if (is_ajax ()) {
|
|||||||
|
|
||||||
if ($get_event_tooltip) {
|
if ($get_event_tooltip) {
|
||||||
$id = (int) get_parameter ('id');
|
$id = (int) get_parameter ('id');
|
||||||
$event = get_event ($id);
|
$event = events_get_event ($id);
|
||||||
if ($event === false)
|
if ($event === false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
echo '<h3>'.__('Event').'</h3>';
|
echo '<h3>'.__('Event').'</h3>';
|
||||||
echo '<strong>'.__('Type').': </strong><br />';
|
echo '<strong>'.__('Type').': </strong><br />';
|
||||||
|
|
||||||
print_event_type_img ($event["event_type"]);
|
events_print_type_img ($event["event_type"]);
|
||||||
echo ' ';
|
echo ' ';
|
||||||
if ($event["event_type"] == "system") {
|
if ($event["event_type"] == "system") {
|
||||||
echo __('System');
|
echo __('System');
|
||||||
@ -71,7 +71,7 @@ if (is_ajax ()) {
|
|||||||
|
|
||||||
if ($standby_alert) {
|
if ($standby_alert) {
|
||||||
$id = (int) get_parameter ('id');
|
$id = (int) get_parameter ('id');
|
||||||
$event = get_event ($id);
|
$event = events_get_event ($id);
|
||||||
if ($event === false)
|
if ($event === false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -87,11 +87,11 @@ if (is_ajax ()) {
|
|||||||
|
|
||||||
// Set off the standby mode when close an event
|
// Set off the standby mode when close an event
|
||||||
if($new_status == 1) {
|
if($new_status == 1) {
|
||||||
$event = get_event ($id);
|
$event = events_get_event ($id);
|
||||||
alerts_agent_module_standby ($event['id_alert_am'], 0);
|
alerts_agent_module_standby ($event['id_alert_am'], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$return = validate_event ($id, $similars, $comment, $new_status);
|
$return = events_validate_event ($id, $similars, $comment, $new_status);
|
||||||
if ($return)
|
if ($return)
|
||||||
echo 'ok';
|
echo 'ok';
|
||||||
else
|
else
|
||||||
@ -103,7 +103,7 @@ if (is_ajax ()) {
|
|||||||
$id = (array) get_parameter ("id");
|
$id = (array) get_parameter ("id");
|
||||||
$similars = (bool) get_parameter ('similars');
|
$similars = (bool) get_parameter ('similars');
|
||||||
|
|
||||||
$return = delete_event ($id, $similars);
|
$return = events_delete_event ($id, $similars);
|
||||||
if ($return)
|
if ($return)
|
||||||
echo 'ok';
|
echo 'ok';
|
||||||
else
|
else
|
||||||
@ -243,14 +243,14 @@ if ($validate) {
|
|||||||
// Avoid to re-set inprocess events
|
// Avoid to re-set inprocess events
|
||||||
if($new_status == 2) {
|
if($new_status == 2) {
|
||||||
foreach($ids as $key => $id) {
|
foreach($ids as $key => $id) {
|
||||||
$event = get_event($id);
|
$event = events_get_event($id);
|
||||||
if($event['estado'] == 2) {
|
if($event['estado'] == 2) {
|
||||||
unset($ids[$key]);
|
unset($ids[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isset($ids[0]) && $ids[0] != -1){
|
if(isset($ids[0]) && $ids[0] != -1){
|
||||||
$return = validate_event ($ids, ($group_rep == 1), $comment, $new_status);
|
$return = events_validate_event ($ids, ($group_rep == 1), $comment, $new_status);
|
||||||
if($new_status == 1) {
|
if($new_status == 1) {
|
||||||
ui_print_result_message ($return,
|
ui_print_result_message ($return,
|
||||||
__('Successfully validated'),
|
__('Successfully validated'),
|
||||||
@ -269,7 +269,7 @@ if ($delete) {
|
|||||||
$ids = (array) get_parameter ("eventid", -1);
|
$ids = (array) get_parameter ("eventid", -1);
|
||||||
|
|
||||||
if ($ids[0] != -1) {
|
if ($ids[0] != -1) {
|
||||||
$return = delete_event ($ids, ($group_rep == 1));
|
$return = events_delete_event ($ids, ($group_rep == 1));
|
||||||
ui_print_result_message ($return,
|
ui_print_result_message ($return,
|
||||||
__('Successfully deleted'),
|
__('Successfully deleted'),
|
||||||
__('Could not be deleted'));
|
__('Could not be deleted'));
|
||||||
|
@ -533,7 +533,7 @@ foreach ($result as $event) {
|
|||||||
$string .= '</td></tr><tr>';
|
$string .= '</td></tr><tr>';
|
||||||
$string .= '<td align="left" valign="top" width="15%">';
|
$string .= '<td align="left" valign="top" width="15%">';
|
||||||
$string .= '<b>' . __('Type') . ':</b></td><td align="left">';
|
$string .= '<b>' . __('Type') . ':</b></td><td align="left">';
|
||||||
$string .= print_event_type_img ($event["event_type"], true).' '.print_event_type_description($event["event_type"], true);
|
$string .= events_print_type_img ($event["event_type"], true).' '.events_print_type_description($event["event_type"], true);
|
||||||
$string .= '</td></tr><tr>';
|
$string .= '</td></tr><tr>';
|
||||||
$string .= '<td align="left" valign="top" width="15%">';
|
$string .= '<td align="left" valign="top" width="15%">';
|
||||||
$string .= '<b>' . __('Agent name') . ':</b></td><td align="left">';
|
$string .= '<b>' . __('Agent name') . ':</b></td><td align="left">';
|
||||||
|
@ -60,7 +60,7 @@ $table->align[0] = 'center';
|
|||||||
|
|
||||||
$table->data = array();
|
$table->data = array();
|
||||||
foreach($ids as $key => $id) {
|
foreach($ids as $key => $id) {
|
||||||
$event = get_event($id);
|
$event = events_get_event($id);
|
||||||
// Colored box
|
// Colored box
|
||||||
switch($event["estado"]) {
|
switch($event["estado"]) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -171,8 +171,8 @@ elseif (isset ($_GET["insert_form"])) {
|
|||||||
|
|
||||||
if (isset ($_GET["from_event"])) {
|
if (isset ($_GET["from_event"])) {
|
||||||
$event = get_parameter_get ("from_event");
|
$event = get_parameter_get ("from_event");
|
||||||
$titulo = get_event_description ($event);
|
$titulo = events_get_description ($event);
|
||||||
$id_grupo = get_event_group ($event);
|
$id_grupo = events_get_group ($event);
|
||||||
$origen = "Pandora FMS event";
|
$origen = "Pandora FMS event";
|
||||||
unset ($event);
|
unset ($event);
|
||||||
}
|
}
|
||||||
|
@ -171,8 +171,8 @@ elseif (isset ($_GET["insert_form"])) {
|
|||||||
|
|
||||||
if (isset ($_GET["from_event"])) {
|
if (isset ($_GET["from_event"])) {
|
||||||
$event = get_parameter_get ("from_event");
|
$event = get_parameter_get ("from_event");
|
||||||
$titulo = get_event_description ($event);
|
$titulo = events_get_description ($event);
|
||||||
$id_grupo = get_event_group ($event);
|
$id_grupo = events_get_group ($event);
|
||||||
$origen = "Pandora FMS event";
|
$origen = "Pandora FMS event";
|
||||||
unset ($event);
|
unset ($event);
|
||||||
}
|
}
|
||||||
|
@ -346,7 +346,7 @@ foreach ($contents as $content) {
|
|||||||
|
|
||||||
$date = get_system_time ();
|
$date = get_system_time ();
|
||||||
|
|
||||||
$events = get_agent_events ($content['id_agent'], $content['period'], $date );
|
$events = events_get_agent ($content['id_agent'], $content['period'], $date );
|
||||||
if (empty ($events)) {
|
if (empty ($events)) {
|
||||||
$events = array ();
|
$events = array ();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user