Merge branch 'ent-3518-password-recovery-email-bad-message' into 'develop'

Fixed the error message of the password recovery

See merge request artica/pandorafms!2172
This commit is contained in:
Daniel Rodriguez 2019-05-30 15:35:18 +02:00
commit 2c36631130
2 changed files with 42 additions and 53 deletions

View File

@ -319,7 +319,7 @@ echo '</div>';
echo '<div id="ver_num">'.$pandora_version.(($develop_bypass == 1) ? ' '.__('Build').' '.$build_version : '').'</div>';
echo '</div>';
if (!isset($process_error_message) && isset($mail)) {
if (empty($process_error_message) && isset($mail)) {
echo '<div id="reset_correct" title="'.__('Password reset').'">';
echo '<div class="content_alert">';
echo '<div class="icon_message_alert">';
@ -336,7 +336,7 @@ if (!isset($process_error_message) && isset($mail)) {
echo '</div>';
echo '</div>';
echo '</div>';
} else if (isset($process_error_message)) {
} else if (isset($process_error_message) && !empty($process_error_message)) {
echo '<div id="reset_correct" title="'.__('Password reset').'">';
echo '<div class="content_alert">';
echo '<div class="icon_message_alert">';

View File

@ -623,10 +623,9 @@ if (! isset($config['id_user'])) {
header('Location: '.$config['homeurl'].'index.php'.$redirect_url);
exit;
// Always exit after sending location headers
}
// Always exit after sending location headers.
} else if (isset($_GET['loginhash'])) {
// Hash login process
else if (isset($_GET['loginhash'])) {
$loginhash_data = get_parameter('loginhash_data', '');
$loginhash_user = str_rot13(get_parameter('loginhash_user', ''));
@ -642,9 +641,8 @@ if (! isset($config['id_user'])) {
exit('</html>');
}
}
// There is no user connected
else {
} else {
// There is no user connected.
if ($config['enterprise_installed']) {
enterprise_include_once('include/functions_reset_pass.php');
}
@ -726,7 +724,6 @@ if (! isset($config['id_user'])) {
$show_error = false;
if (!$first) {
if ($reset) {
if ($user_reset_pass == '') {
$reset = false;
$error = __('Id user cannot be empty');
@ -752,16 +749,10 @@ if (! isset($config['id_user'])) {
}
}
}
}
if (!$reset) {
if ($config['enterprise_installed']) {
include_once 'enterprise/include/reset_pass.php';
}
} else {
$cod_hash = $user_reset_pass.'::::'.md5(rand(10, 1000000).rand(10, 1000000).rand(10, 1000000));
$subject = '['.get_product_name().'] '.__('Reset password');
$subject = '['.io_safe_output(get_product_name()).'] '.__('Reset password');
$body = __('This is an automatically sent message for user ');
$body .= ' "<strong>'.$user_reset_pass.'"</strong>';
$body .= '<p />';
@ -775,7 +766,6 @@ if (! isset($config['id_user'])) {
$result = send_email_to_user($mail, $body, $subject);
$process_error_message = '';
if (!$result) {
$process_error_message = __('Error at sending the email');
} else {
@ -783,7 +773,6 @@ if (! isset($config['id_user'])) {
}
include_once 'general/login_page.php';
}
} else {
include_once 'enterprise/include/reset_pass.php';
}