Audit password changes in system audit log - #1329

This commit is contained in:
enriquecd 2017-10-17 17:03:05 +02:00
parent a6ba78ca20
commit 7786a6fbd5
1 changed files with 6 additions and 0 deletions

View File

@ -236,6 +236,8 @@ if ($create_user) {
case "postgresql":
$result = create_user($id, $password_new, $values);
if ($result) {
db_process_sql_insert ('tsesion', array('id_sesion' => '','id_usuario' => $id,'ip_origen' => $_SERVER['REMOTE_ADDR'],'accion' => 'Password change',
'descripcion' => 'Access password updated','fecha' => date("Y-m-d H:i:s"),'utimestamp' => time()));
$res = save_pass_history($id, $password_new);
}
break;
@ -334,6 +336,8 @@ if ($update_user) {
else {
$res2 = update_user_password ($id, $password_new);
if ($res2) {
db_process_sql_insert ('tsesion', array('id_sesion' => '','id_usuario' => $id,'ip_origen' => $_SERVER['REMOTE_ADDR'],'accion' => 'Password change',
'descripcion' => 'Access password updated','fecha' => date("Y-m-d H:i:s"),'utimestamp' => time()));
$res3 = save_pass_history($id, $password_new);
}
ui_print_result_message ($res1 || $res2,
@ -345,6 +349,8 @@ if ($update_user) {
$res2 = update_user_password ($id, $password_new);
if ($res2) {
$res3 = save_pass_history($id, $password_new);
db_process_sql_insert ('tsesion', array('id_sesion' => '','id_usuario' => $id,'ip_origen' => $_SERVER['REMOTE_ADDR'],'accion' => 'Password change',
'descripcion' => 'Access password updated','fecha' => date("Y-m-d H:i:s"),'utimestamp' => time()));
}
ui_print_result_message ($res1 || $res2,
__('User info successfully updated'),