fixed get_instance()

This commit is contained in:
2026-01-12 17:30:36 +01:00
parent 079e276231
commit a182417ef7
3 changed files with 21 additions and 31 deletions
+12 -14
View File
@@ -8,7 +8,6 @@
class RequestPassword {
private $ci;
private $salt;
private $user;
private $password;
@@ -18,12 +17,8 @@ class RequestPassword {
public function __construct( $user )
{
$this->ci =& get_instance();
$this->user = $user;
$this->ci->load->library( 'email' );
$this->handle();
}
@@ -87,18 +82,21 @@ class RequestPassword {
'password' => $this->password
];
$html = $this->ci->load->view( 'emails/requestpassword_email', ['user'=>$data], true );
$html = view('emails/requestpassword_email', ['user' => $data]);
$this->ci->email->from( 'noreply@dbois.nl', 'DBOIS' );
$this->ci->email->to( $this->user->email );
$this->ci->email->subject( 'Nieuw wachtwoord DBOIS' );
$this->ci->email->message( $html );
$this->ci->email->set_mailtype("html");
$this->ci->email->set_newline("\r\n");
$email = \Config\Services::email();
$email->setFrom('noreply@dbois.nl', 'DBOIS');
$email->setTo($this->user->email);
$email->setSubject('Nieuw wachtwoord DBOIS');
$email->setMessage($html);
$email->setMailType('html');
$email->setNewline("\r\n");
$this->sendResult = $this->ci->email->send();
$this->sendResult = $email->send();
if( ! $this->sendResult ) log_message( 'error', json_encode($this->ci->email->print_debugger()));
if (! $this->sendResult) {
log_message('error', $email->printDebugger());
}
}
}