/** * Check if token is valid. * * @return boolean true if token is valid */ public function isValidToken() { if (Security::isValidToken($this->token, $this->module->emailWithin) === true) { return ($this->_model = static::findOne(['token' => $this->token])) !== null; } return false; }
/** * Check if secure key is valid. * * @return boolean true if secure key is valid */ public function isValidSecureKey() { if (Security::isValidToken($this->secure_key, $this->module->recoveryWithin) === true) { return ($this->_user = User::findBySecureKey($this->secure_key, 'active')) !== null; } return false; }