/** * forgotten password feature * * @return void * @author Mathew **/ public function forgotten_password($identity) { $code = User::forgotten_password($identity); if ($code) { $user = User::find_by_email($identity); if ($user) { $data = array('forgotten_password_code' => $code); $message = $this->ci->load->view($this->ci->config->item('email_templates') . $this->ci->config->item('email_forgot_password'), $data, true); $this->ci->email->clear(); $this->ci->email->set_newline("\r\n"); $this->ci->email->from($this->ci->config->item('admin_email'), $this->ci->config->item('site_title')); $this->ci->email->to($user->email); $this->ci->email->subject($this->ci->config->item('site_title') . ' - ' . lang('web_auth_voc')); $this->ci->email->message($message); if ($this->ci->email->send()) { return TRUE; } else { return FALSE; } } else { return FALSE; } } else { return FALSE; } }