5 class Mail extends \Rsi\Fred\User\Authenticator{
21 protected function tags($token){
22 return [
'token' => $token];
26 if(!$email) $this->checked =
false;
27 elseif($this->session->time < time() - $this->tokenTime){
28 $this->session->time = time();
29 $this->session->tries = 0;
30 $tags = $this->
tags($this->session->token = \
Rsi\Str::random($this->tokenLength,$this->tokenChars));
32 $this->
component(
'mail')->send($this->mailFrom,$email,$trans->str($this->mailSubject,$tags),$trans->str($this->mailBody,$tags),
$this->mailHtml);
34 return $this->session->token;
38 $this->
verified($token && !strcasecmp($this->session->token,$token) && ($this->session->time > time() - $this->tokenTime));
39 if(++$this->session->tries >= $this->tokenTries) $this->session->time = null;
40 return $this->checked;
$tokenTime
Time (in seconds) for which the token is valid.
$mailFrom
Mail message sender address (default when empty).
$mailHtml
True when the message body is in HTML format.
$tokenTries
Maximum number of times to enter the correct token.
verified($result)
Process the result of a verification.
component($name)
Get a component (local or default).