Fix minor PR remarks [MAILPOET-2015]

Reuse updateCaptcha() function
Inject Captcha class using DI
Add no-cache headers to captcha image
Fix an error when accessing the captcha page directly
Edit the line in settings regarding missing dependencies
This commit is contained in:
wxa
2019-07-11 13:42:47 +03:00
committed by M. Shull
parent 0b8dbf1d27
commit 7788aebe83
12 changed files with 54 additions and 22 deletions

View File

@ -37,6 +37,9 @@ class Settings {
/** @var ServicesChecker */
private $services_checker;
/** @var Captcha */
private $captcha;
/** @var FeaturesController */
private $features_controller;
@ -50,7 +53,8 @@ class Settings {
WPFunctions $wp,
ServicesChecker $services_checker,
FeaturesController $features_controller,
Installation $installation
Installation $installation,
Captcha $captcha
) {
$this->page_renderer = $page_renderer;
$this->settings = $settings;
@ -59,6 +63,7 @@ class Settings {
$this->services_checker = $services_checker;
$this->features_controller = $features_controller;
$this->installation = $installation;
$this->captcha = $captcha;
}
function render() {
@ -90,7 +95,7 @@ class Settings {
'web' => Hosts::getWebHosts(),
'smtp' => Hosts::getSMTPHosts(),
],
'built_in_captcha_supported' => (new Captcha)->isSupported(),
'built_in_captcha_supported' => $this->captcha->isSupported(),
];
$data['is_new_user'] = $this->installation->isNewInstallation();