Merge branch '1571-Auditoría-del-sistema-información-de-los-cambios-4850-com1' into 'develop'

Change system audit log extended info to table format with change info - #1571

See merge request artica/pandorafms!1115
This commit is contained in:
vgilc 2018-02-06 11:56:48 +01:00
commit ae9db8bfd8
4 changed files with 86 additions and 47 deletions

View File

@ -263,23 +263,23 @@ if ($create_agent) {
} }
} }
$info = 'Name: ' . $nombre_agente . $info = '{"Name":"' . $nombre_agente .'",
' IP: ' . $direccion_agente . "IP":"' . $direccion_agente .'",
' Group: ' . $grupo . "Group":"' . $grupo .'",
' Interval: ' . $intervalo . "Interval":"' . $intervalo .'",
' Comments: ' . $comentarios . "Comments":"' . $comentarios .'",
' Mode: ' . $modo . "Mode":"' . $modo .'",
' ID_parent: ' . $id_parent . "ID_parent:":"' . $id_parent .'",
' Server: ' . $server_name . "Server":"' . $server_name .'",
' ID os: ' . $id_os . "ID os":"' . $id_os .'",
' Disabled: ' . $disabled . "Disabled":"' . $disabled .'",
' Custom ID: ' . $custom_id . "Custom ID":"' . $custom_id .'",
' Cascade protection: ' . $cascade_protection . "Cascade protection":"' . $cascade_protection .'",
' Cascade protection module: ' . $cascade_protection_module . "Cascade protection module":"' . $cascade_protection_module .'",
' Icon path: ' . $icon_path . "Icon path":"' . $icon_path .'",
' Update GIS data: ' . $update_gis_data . "Update GIS data":"' . $update_gis_data .'",
' Url description: ' . $url_description . "Url description":"' . $url_description .'",
' Quiet: ' . (int)$quiet; "Quiet":"' . (int)$quiet.'"}';
db_pandora_audit("Agent management", db_pandora_audit("Agent management",
"Created agent $alias", false, true, $info); "Created agent $alias", false, true, $info);
@ -876,16 +876,25 @@ if ($update_agent) { // if modified some agent paramenter
} }
} }
$info = 'Group: ' . $grupo . ' Interval: ' . $intervalo . $info = '{
' Comments: ' . $comentarios . ' Mode: ' . $modo . "id_agente":"' . $id_agente . '",
' ID OS: ' . $id_os . ' Disabled: ' . $disabled . "alias":"' . $alias . '",
' Server Name: ' . $server_name . ' ID parent: ' . $id_parent . "Group":"' . $grupo . '",
' Custom ID: ' . $custom_id . ' Cascade Protection: ' . $cascade_protection . "Interval" : "' . $intervalo .'",
' Cascade protection module: ' . $cascade_protection_module . "Comments":"' . $comentarios . '",
' Icon Path: ' . $icon_path . 'Update GIS data: ' .$update_gis_data . "Mode":"' . $modo . '",
' Url description: ' . $url_description . "ID OS":"' . $id_os . '",
' Quiet: ' . (int)$quiet; "Disabled":"' . $disabled .'",
"Server Name":"' . $server_name .'",
"ID parent":"' . $id_parent .'",
"Custom ID":"' . $custom_id . '",
"Cascade Protection":"' . $cascade_protection .'",
"Cascade protection module":"' . $cascade_protection_module .'",
"Icon Path":"' . $icon_path . '",
"Update GIS data":"' .$update_gis_data .'",
"Url description":"' . $url_description .'",
"Quiet":"' . (int)$quiet.'"}';
enterprise_hook ('update_agent', array ($id_agente)); enterprise_hook ('update_agent', array ($id_agente));
ui_print_success_message (__('Successfully updated')); ui_print_success_message (__('Successfully updated'));
db_pandora_audit("Agent management", db_pandora_audit("Agent management",
@ -1249,7 +1258,9 @@ if ($update_module || $create_module) {
if ($update_module) { if ($update_module) {
$id_agent_module = (int) get_parameter ('id_agent_module'); $id_agent_module = (int) get_parameter ('id_agent_module');
$values = array ('descripcion' => $description, $values = array (
'id_agente_modulo' => $id_agent_module,
'descripcion' => $description,
'id_module_group' => $id_module_group, 'id_module_group' => $id_module_group,
'nombre' => $name, 'nombre' => $name,
'max' => $max, 'max' => $max,
@ -1307,7 +1318,7 @@ if ($update_module) {
'warning_inverse' => $warning_inverse, 'warning_inverse' => $warning_inverse,
'cron_interval' => $cron_interval, 'cron_interval' => $cron_interval,
'id_category' => $id_category, 'id_category' => $id_category,
'disabled_types_event' => $disabled_types_event, 'disabled_types_event' => addslashes($disabled_types_event),
'module_macros' => $module_macros); 'module_macros' => $module_macros);
// In local modules, the interval is updated by agent // In local modules, the interval is updated by agent
@ -1467,7 +1478,7 @@ if ($create_module) {
'warning_inverse' => $warning_inverse, 'warning_inverse' => $warning_inverse,
'cron_interval' => $cron_interval, 'cron_interval' => $cron_interval,
'id_category' => $id_category, 'id_category' => $id_category,
'disabled_types_event' => $disabled_types_event, 'disabled_types_event' => addslashes($disabled_types_event),
'module_macros' => $module_macros); 'module_macros' => $module_macros);
if ($prediction_module == 3 && $serialize_ops == '') { if ($prediction_module == 3 && $serialize_ops == '') {

View File

@ -220,15 +220,14 @@ if ($create_user) {
$new_user = true; $new_user = true;
} }
else { else {
$info = 'FullName: ' . $values['fullname'] . ' Firstname: ' . $values['firstname'] . $info =
' Lastname: ' . $values['lastname'] . ' Email: ' . $values['email'] . '{"FullName":"' . $values['fullname'] . '","Firstname":"'. $values['firstname'] .'","Lastname":"'. $values['lastname'] . '","Email":"' . $values['email'] . '","Phone":"' . $values['phone'] . '","Comments":"' . $values['comments'] .'","Is_admin":"' . $values['is_admin'] .'","Language":"' . $values['language'] . '","Block size":"' . $values['block_size'] . '","Interactive Charts":"' . $values['flash_chart'].'"';
' Phone: ' . $values['phone'] . ' Comments: ' . $values['comments'] .
' Is_admin: ' . $values['is_admin'] .
' Language: ' . $values['language'] .
' Block size: ' . $values['block_size'] . ' Interactive Charts: ' . $values['flash_chart'];
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
$info .= ' Skin: ' . $values['id_skin']; $info .= ',"Skin":"' . $values['id_skin'].'"}';
}
else{
$info .= '}';
} }
switch ($config['dbtype']) { switch ($config['dbtype']) {
@ -362,21 +361,40 @@ if ($update_user) {
} }
} }
else { else {
$info = 'FullName: ' . $values['fullname'] . ' Firstname: ' . $values['firstname'] .
' Lastname: ' . $values['lastname'] . ' Email: ' . $values['email'] . $has_skin = false;
' Phone: ' . $values['phone'] . ' Comments: ' . $values['comments'] . $has_wizard = false;
' Is_admin: ' . $values['is_admin'] .
' Language: ' . $values['language'] . $info = '{"id_user":"'.$values['id_user'].'",
' Block size: ' . $values['block_size'] . ' Flash Chats: ' . $values['flash_chart'] . "FullName":"' . $values['fullname'] .'",
' Section: ' . $values['section']; "Firstname":"' . $values['firstname'] .'",
"Lastname":"' . $values['lastname'] . '",
"Email":"' . $values['email'] . '",
"Phone":"' . $values['phone'] . '",
"Comments":"' . $values['comments'] . '",
"Is_admin":"' . $values['is_admin'] . '",
"Language":"' . $values['language'] . '",
"Block size":"' . $values['block_size'] . '",
"Flash Chats":"' . $values['flash_chart'] . '",
"Section":"' . $values['section'].'"';
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) { if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
$info .= ' Skin: ' . $values['id_skin']; $info .= ',"Skin":"' . $values['id_skin'].'"';
$has_skin = true;
} }
if(enterprise_installed() && defined('METACONSOLE')) { if(enterprise_installed() && defined('METACONSOLE')) {
$info .= ' Wizard access: ' . $values['metaconsole_access']; $info .= ',"Wizard access":"' . $values['metaconsole_access'].'"}';
$has_wizard = true;
} }
elseif($has_skin){
$info .= '}';
}
if(!$has_skin && !$has_wizard){
$info .= '}';
}
db_pandora_audit("User management", "Updated user ".io_safe_input($id), db_pandora_audit("User management", "Updated user ".io_safe_input($id),
false, false, $info); false, false, $info);

View File

@ -2775,6 +2775,12 @@ function register_pass_change_try ($id_user, $success) {
$values['success'] = $success; $values['success'] = $success;
db_process_sql_insert('treset_pass_history', $values); db_process_sql_insert('treset_pass_history', $values);
} }
function isJson($string) {
json_decode($string);
return (json_last_error() == JSON_ERROR_NONE);
}
/** /**
* returns true or false if it is a valid ip * returns true or false if it is a valid ip
* checking ipv4 and ipv6 or resolves the name dns * checking ipv4 and ipv6 or resolves the name dns

View File

@ -4371,6 +4371,10 @@ div#footer_help{
transition: all 2s ease-in-out; transition: all 2s ease-in-out;
} }
.limit_scroll{
max-width: 800px;
overflow-x:scroll;
}
#is_favourite ul.container{ #is_favourite ul.container{
display: flex; display: flex;
flex-direction: row; flex-direction: row;