From 98f153259af52093597151cc35a99c25a44c7291 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Mon, 28 Oct 2024 11:03:20 +0100 Subject: [PATCH] forgot password email --- application/controllers/User.php | 9 +++++---- application/views/email/forgot_password.php | 17 +++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/application/controllers/User.php b/application/controllers/User.php index ab46be55f..c9487af2b 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -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); diff --git a/application/views/email/forgot_password.php b/application/views/email/forgot_password.php index 1f69cf647..475aec181 100644 --- a/application/views/email/forgot_password.php +++ b/application/views/email/forgot_password.php @@ -1,15 +1,16 @@