forgot password email

This commit is contained in:
HB9HIL
2024-10-28 11:03:20 +01:00
parent 1606d66666
commit 98f153259a
2 changed files with 14 additions and 12 deletions

View File

@@ -975,15 +975,16 @@ class User extends CI_Controller {
{
// Check email address exists
$this->load->model('user_model');
$email = $this->input->post('email', TRUE);
$check_email = $this->user_model->check_email_address($this->input->post('email', true));
$check_email = $this->user_model->check_email_address($email);
if($check_email == TRUE) {
// Generate password reset code 50 characters long
$this->load->helper('string');
$reset_code = random_string('alnum', 50);
$this->user_model->set_password_reset_code($this->input->post('email', true), $reset_code);
$this->user_model->set_password_reset_code($email, $reset_code);
// Send email with reset code
@@ -1005,10 +1006,10 @@ class User extends CI_Controller {
$this->email->initialize($config);
}
$message = $this->load->view('email/forgot_password', $this->data, TRUE);
$message = $this->email->load('email/forgot_password', $this->data, $this->user_model->get_by_email($email)->row()->user_language);
$this->email->from($this->optionslib->get_option('emailAddress'), $this->optionslib->get_option('emailSenderName'));
$this->email->to($this->input->post('email', true));
$this->email->to($email);
$this->email->subject('Wavelog Account Password Reset');
$this->email->message($message);