Merge branch '1329-Visualizar-auditoria-de-cambios-de-contraseña-Ext-4225-2' into 'develop'

Insert password changes by recover mail in system audit log - #1329

See merge request artica/pandorafms!1164
This commit is contained in:
vgilc 2017-12-05 13:10:08 +01:00
commit 4b416e3af2
2 changed files with 8 additions and 3 deletions

View File

@ -236,8 +236,6 @@ 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;
@ -349,7 +347,7 @@ 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',
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,
@ -358,6 +356,8 @@ if ($update_user) {
}
}
else {
db_process_sql_insert ('tsesion', array('id_sesion' => '','id_usuario' => $id,'ip_origen' => $_SERVER['REMOTE_ADDR'],'accion' => 'Password change',
'descripcion' => 'Access password update failed','fecha' => date("Y-m-d H:i:s"),'utimestamp' => time()));
ui_print_error_message (__('Passwords does not match'));
}
}

View File

@ -583,6 +583,10 @@ if (! isset ($config['id_user'])) {
if ($pass1 == $pass2) {
$res = update_user_password ($id_user, $pass1);
if ($res) {
db_process_sql_insert ('tsesion', array('id_sesion' => '','id_usuario' => $id_user,'ip_origen' => $_SERVER['REMOTE_ADDR'],'accion' => 'Reset change',
'descripcion' => 'Successful reset password process ','fecha' => date("Y-m-d H:i:s"),'utimestamp' => time()));
$correct_reset_pass_process = __('Password changed successfully');
register_pass_change_try($id_user, 1);
@ -675,6 +679,7 @@ if (! isset ($config['id_user'])) {
}
}
else {
$cod_hash = $user_reset_pass . "::::" . md5(rand(10, 1000000) . rand(10, 1000000) . rand(10, 1000000));
$subject = '[Pandora] '.__('Reset password');