From 2d64d3e1f71c25efe33f006afb365c11b787183d Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 07:44:17 +0000 Subject: [PATCH] Settings: purge failed logins after 4 weeks by default The plugin purges failed logins after 4 weeks while its settings have not been saved, but the settings page showed 0 (never) for that setting - so saving the settings for the first time switched purging off. The page now shows the plugin's default, and the hints of the block and failed login lists use the plugin's default too. Needs the plugin branch of the same name (codeling/bfstop), which adds deleteOld to the plugin's DefaultSettings that the test compares with this form. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AFJFMMUpch4LGexEiXN8Nc --- admin/forms/settings.xml | 2 +- admin/src/View/Blocklist/HtmlView.php | 3 ++- admin/src/View/Failedloginlist/HtmlView.php | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/admin/forms/settings.xml b/admin/forms/settings.xml index 530b205..198c698 100644 --- a/admin/forms/settings.xml +++ b/admin/forms/settings.xml @@ -204,7 +204,7 @@ - diff --git a/admin/src/View/Blocklist/HtmlView.php b/admin/src/View/Blocklist/HtmlView.php index 18940fe..dddf19b 100644 --- a/admin/src/View/Blocklist/HtmlView.php +++ b/admin/src/View/Blocklist/HtmlView.php @@ -12,6 +12,7 @@ use Codeling\Component\Bfstop\Administrator\Helper\ParamHelper; use Codeling\Component\Bfstop\Administrator\Helper\ToolbarHelper as BfstopToolbarHelper; +use Codeling\Plugin\System\Bfstop\Extension\Bfstop; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; @@ -29,7 +30,7 @@ function display($tpl = null) // with .htaccess blocking, blocked requests never reach Joomla, // so attempts can't be counted $this->attemptsTracked = ParamHelper::get('blockMode', 'params', 'full') !== 'htaccess'; - $this->autoPurgeWeeks = (int) ParamHelper::get('deleteOld', 'params', 0); + $this->autoPurgeWeeks = (int) ParamHelper::get('deleteOld', 'params', Bfstop::DefaultSettings['deleteOld']); $this->addToolBar(); parent::display($tpl); } diff --git a/admin/src/View/Failedloginlist/HtmlView.php b/admin/src/View/Failedloginlist/HtmlView.php index 3da8b88..0f440e9 100644 --- a/admin/src/View/Failedloginlist/HtmlView.php +++ b/admin/src/View/Failedloginlist/HtmlView.php @@ -12,6 +12,7 @@ use Codeling\Component\Bfstop\Administrator\Helper\ParamHelper; use Codeling\Component\Bfstop\Administrator\Helper\ToolbarHelper as BfstopToolbarHelper; +use Codeling\Plugin\System\Bfstop\Extension\Bfstop; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; @@ -27,7 +28,7 @@ function display($tpl = null) $this->sortColumn = $state->get('list.ordering'); $this->sortDirection = $state->get('list.direction'); $this->filterUsername = (string) $state->get('filter.username', ''); - $this->autoPurgeWeeks = (int) ParamHelper::get('deleteOld', 'params', 0); + $this->autoPurgeWeeks = (int) ParamHelper::get('deleteOld', 'params', Bfstop::DefaultSettings['deleteOld']); $this->canPurge = Factory::getApplication()->getIdentity()->authorise('core.delete', 'com_bfstop'); if ($this->canPurge) {