improve extendability

Cette révision appartient à :
Daniel Seifert 2024-08-01 10:43:28 +02:00
Parent f7f9c28b53
révision ba97743b3e

Voir le fichier

@ -44,7 +44,18 @@ class SmtpChecker extends AdminDetailsController
{
parent::__construct();
/** @var Shop $activeShop */
$this->setSmtpCredentials();
$this->from = Registry::getRequest()->getRequestEscapedParameter('from') ?: '';
$this->addTplParam('from', $this->from);
$this->to = Registry::getRequest()->getRequestEscapedParameter('to') ?: '';
$this->addTplParam('recipient', $this->to);
$this->addTplParam('sendMail', Registry::getRequest()->getRequestEscapedParameter('sendmail'));
$this->addTplParam('smtpLog', $this->log);
}
protected function setSmtpCredentials(): void
{
$activeShop = Registry::getConfig()->getActiveShop();
if ($localHost = Registry::getRequest()->getRequestEscapedParameter('smtpHost')) {
@ -60,13 +71,6 @@ class SmtpChecker extends AdminDetailsController
$this->addTplParam('smtpUser', $this->user);
$this->pwd = Registry::getRequest()->getRequestEscapedParameter('smtpPwd') ?: $activeShop->getFieldData('oxsmtppwd');
$this->addTplParam('smtpPwd', $this->pwd);
$this->from = Registry::getRequest()->getRequestEscapedParameter('from') ?: '';
$this->addTplParam('from', $this->from);
$this->to = Registry::getRequest()->getRequestEscapedParameter('to') ?: '';
$this->addTplParam('recipient', $this->to);
$this->addTplParam('sendMail', Registry::getRequest()->getRequestEscapedParameter('sendmail'));
$this->addTplParam('smtpLog', $this->log);
}
public function getTemplateName(): string