Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
2.0.0 (unreleased)
- Requires PHP 8.2 (was 8.1), the oldest version CI runs the tests on
- Issue #294: the administrators' mail about a block lists the failed
logins which led to it, not every failed login of the address still
stored (for a permanent block: of ten years, including those of earlier
blocks); an IPv4 client which the web server reports as IPv4-mapped IPv6
(::ffff:203.0.113.5, a server listening on "[::]") is handled as the IPv4
address, so the IPv4 entries of the block and allow list and the trusted
proxies match it (entries typed in that form are stored as IPv4, and the
update converts those of the lists); "Minimum Allowed Attempts" above
the block threshold no longer raises the threshold for every client
(the settings page refuses it, a stored value is capped); the IP
information page looks up a blocked network by its network address
instead of showing nothing; taking entries out of the .htaccess file
needs core.admin as well as core.delete, as adding one does
- Review fixes: an unblock mail is no longer sent with an empty token when
the token can't be stored; failed logins typed with the email address or
in another case get the account's unblock mail (none for a disabled
Expand Down
1 change: 1 addition & 0 deletions component/admin/language/ca-ES/ca-ES.com_bfstop.ini
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ COM_BFSTOP_LOG_CLEAR_DESC="Totes les entrades del registre s'eliminaran de maner
COM_BFSTOP_LOG_CLEAR_CONFIRM="Buida"
COM_BFSTOP_LOG_CLEARED="S'ha buidat el registre."
COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Els enllaços de desbloqueig només es poden enviar si l'adreça del lloc està definida ($live_site al configuration.php del lloc). Definiu-la allà, o desactiveu els enllaços de desbloqueig."
COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="\"%1$s\" (%2$d) no pot ser més alt que \"%3$s\" (%4$d): cada client tindria %2$d intents. Reduïu \"%1$s\", o augmenteu \"%3$s\"."
COM_BFSTOP_WARNING_NO_LIVE_SITE="L'adreça del lloc no està definida ($live_site al configuration.php). Llavors Joomla! construeix els enllaços dels correus de Brute Force Stop amb l'amfitrió indicat a cada petició, que un visitant pot triar lliurement - per això no s'envia cap enllaç de desbloqueig i les notificacions als administradors no indiquen cap adreça. Per definir l'adreça, afegiu aquesta línia a la classe del configuration.php del lloc, amb l'adreça amb què s'accedeix al lloc (proposada a partir d'aquesta petició, comproveu-la): %s"
COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="S'han d'enviar enllaços de desbloqueig (<a href=\"%s\">configuració</a>), però l'adreça del lloc no està definida ($live_site al configuration.php): no s'envia cap enllaç de desbloqueig."
COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (recomanat)"
Expand Down
1 change: 1 addition & 0 deletions component/admin/language/de-DE/de-DE.com_bfstop.ini
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ COM_BFSTOP_LOG_CLEAR_DESC="Alle Logeinträge werden unwiderruflich gelöscht, au
COM_BFSTOP_LOG_CLEAR_CONFIRM="Leeren"
COM_BFSTOP_LOG_CLEARED="Das Log wurde geleert."
COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Entsperr-Links können nur gesendet werden, wenn die Adresse der Website gesetzt ist ($live_site in der configuration.php der Website). Setze sie dort, oder schalte die Entsperr-Links aus."
COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="„%1$s“ (%2$d) darf nicht höher sein als „%3$s“ (%4$d): Jeder Client bekäme %2$d Versuche. Verringere „%1$s“ oder erhöhe „%3$s“."
COM_BFSTOP_WARNING_NO_LIVE_SITE="Die Adresse der Website ist nicht gesetzt ($live_site in der configuration.php). Joomla! baut die Links in den Emails von Brute Force Stop dann mit dem Host, den die jeweilige Anfrage nennt und den ein Besucher frei wählen kann - deshalb werden keine Entsperr-Links gesendet, und die Benachrichtigungen an die Administratoren nennen keine Adresse. Um die Adresse zu setzen, füge diese Zeile in die Klasse in der configuration.php der Website ein, mit der Adresse, unter der die Website erreichbar ist (aus dieser Anfrage vorgeschlagen, bitte prüfen): %s"
COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Entsperr-Links sollen gesendet werden (<a href=\"%s\">Einstellungen</a>), aber die Adresse der Website ist nicht gesetzt ($live_site in der configuration.php): es werden keine Entsperr-Links gesendet."
COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (empfohlen)"
Expand Down
1 change: 1 addition & 0 deletions component/admin/language/en-GB/en-GB.com_bfstop.ini
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ COM_BFSTOP_LOG_CLEAR_DESC="All log entries will be permanently deleted, includin
COM_BFSTOP_LOG_CLEAR_CONFIRM="Clear"
COM_BFSTOP_LOG_CLEARED="The log was cleared."
COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Unblock links can only be sent if the site's address is set ($live_site in the site's configuration.php). Set it there, or turn the unblock links off."
COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="\"%1$s\" (%2$d) must not be higher than \"%3$s\" (%4$d): every client would get %2$d attempts. Lower \"%1$s\", or raise \"%3$s\"."
COM_BFSTOP_WARNING_NO_LIVE_SITE="The site's address is not set ($live_site in configuration.php). Joomla! then builds the links in the emails of Brute Force Stop from the host named by each request, which a visitor can choose freely - so no unblock links are sent, and the notifications to the administrators name no address. To set the address, add this line to the class in the site's configuration.php, with the address under which the site is reached (proposed from this request, please check it): %s"
COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Unblock links are to be sent (<a href=\"%s\">settings</a>), but the site's address is not set ($live_site in configuration.php): no unblock links are sent."
COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (recommended)"
Expand Down
1 change: 1 addition & 0 deletions component/admin/language/es-ES/es-ES.com_bfstop.ini
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ COM_BFSTOP_LOG_CLEAR_DESC="Todas las entradas del registro se eliminarán de for
COM_BFSTOP_LOG_CLEAR_CONFIRM="Vaciar"
COM_BFSTOP_LOG_CLEARED="Se ha vaciado el registro."
COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Los enlaces de desbloqueo solo se pueden enviar si la dirección del sitio está definida ($live_site en el configuration.php del sitio). Defínala allí, o desactive los enlaces de desbloqueo."
COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="\"%1$s\" (%2$d) no puede ser mayor que \"%3$s\" (%4$d): cada cliente tendría %2$d intentos. Reduzca \"%1$s\", o aumente \"%3$s\"."
COM_BFSTOP_WARNING_NO_LIVE_SITE="La dirección del sitio no está definida ($live_site en configuration.php). Entonces Joomla! construye los enlaces de los correos de Brute Force Stop con el host indicado en cada petición, que un visitante puede elegir libremente - por eso no se envían enlaces de desbloqueo y las notificaciones a los administradores no indican ninguna dirección. Para definir la dirección, añada esta línea a la clase del configuration.php del sitio, con la dirección en la que se accede al sitio (propuesta a partir de esta petición, compruébela): %s"
COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Se deben enviar enlaces de desbloqueo (<a href=\"%s\">configuración</a>), pero la dirección del sitio no está definida ($live_site en configuration.php): no se envían enlaces de desbloqueo."
COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (recomendado)"
Expand Down
1 change: 1 addition & 0 deletions component/admin/language/fr-FR/fr-FR.com_bfstop.ini
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ COM_BFSTOP_LOG_CLEAR_DESC="Toutes les entrées du journal seront définitivement
COM_BFSTOP_LOG_CLEAR_CONFIRM="Vider"
COM_BFSTOP_LOG_CLEARED="Le journal a été vidé."
COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Les liens de déblocage ne peuvent être envoyés que si l'adresse du site est définie ($live_site dans le fichier configuration.php du site). Définissez-la, ou désactivez les liens de déblocage."
COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="« %1$s » (%2$d) ne doit pas être supérieur à « %3$s » (%4$d) : chaque client aurait %2$d tentatives. Diminuez « %1$s », ou augmentez « %3$s »."
COM_BFSTOP_WARNING_NO_LIVE_SITE="L'adresse du site n'est pas définie ($live_site dans configuration.php). Joomla! construit alors les liens des e-mails de Brute Force Stop à partir de l'hôte indiqué par chaque requête, qu'un visiteur peut choisir librement - c'est pourquoi aucun lien de déblocage n'est envoyé et les notifications aux administrateurs n'indiquent pas d'adresse. Pour définir l'adresse, ajoutez cette ligne à la classe du fichier configuration.php du site, avec l'adresse à laquelle le site est accessible (proposée d'après cette requête, veuillez la vérifier) : %s"
COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Des liens de déblocage doivent être envoyés (<a href=\"%s\">paramètres</a>), mais l'adresse du site n'est pas définie ($live_site dans configuration.php) : aucun lien de déblocage n'est envoyé."
COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (recommandé)"
Expand Down
1 change: 1 addition & 0 deletions component/admin/language/it-IT/it-IT.com_bfstop.ini
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ COM_BFSTOP_LOG_CLEAR_DESC="Tutte le voci del log verranno eliminate definitivame
COM_BFSTOP_LOG_CLEAR_CONFIRM="Svuota"
COM_BFSTOP_LOG_CLEARED="Il log è stato svuotato."
COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="I link di sblocco possono essere inviati solo se l'indirizzo del sito è impostato ($live_site nel configuration.php del sito). Impostalo lì, oppure disattiva i link di sblocco."
COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="\"%1$s\" (%2$d) non può essere superiore a \"%3$s\" (%4$d): ogni client avrebbe %2$d tentativi. Riduci \"%1$s\", oppure aumenta \"%3$s\"."
COM_BFSTOP_WARNING_NO_LIVE_SITE="L'indirizzo del sito non è impostato ($live_site in configuration.php). Joomla! costruisce allora i link nelle email di Brute Force Stop dall'host indicato in ogni richiesta, che un visitatore può scegliere liberamente - per questo non vengono inviati link di sblocco e le notifiche agli amministratori non indicano alcun indirizzo. Per impostare l'indirizzo, aggiungi questa riga alla classe nel configuration.php del sito, con l'indirizzo con cui si raggiunge il sito (proposto in base a questa richiesta, verificalo): %s"
COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="I link di sblocco devono essere inviati (<a href=\"%s\">impostazioni</a>), ma l'indirizzo del sito non è impostato ($live_site in configuration.php): non viene inviato alcun link di sblocco."
COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (consigliato)"
Expand Down
1 change: 1 addition & 0 deletions component/admin/language/nl-NL/nl-NL.com_bfstop.ini
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ COM_BFSTOP_LOG_CLEAR_DESC="Alle logitems worden definitief verwijderd, inclusief
COM_BFSTOP_LOG_CLEAR_CONFIRM="Wissen"
COM_BFSTOP_LOG_CLEARED="Het log is gewist."
COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Deblokkeerlinks kunnen alleen worden verstuurd als het adres van de site is ingesteld ($live_site in de configuration.php van de site). Stel het daar in, of schakel de deblokkeerlinks uit."
COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="\"%1$s\" (%2$d) mag niet hoger zijn dan \"%3$s\" (%4$d): elke client zou %2$d pogingen krijgen. Verlaag \"%1$s\", of verhoog \"%3$s\"."
COM_BFSTOP_WARNING_NO_LIVE_SITE="Het adres van de site is niet ingesteld ($live_site in configuration.php). Joomla! bouwt de links in de e-mails van Brute Force Stop dan op uit de host die elk verzoek noemt, en die kan een bezoeker vrij kiezen - daarom worden geen deblokkeerlinks verstuurd en noemen de meldingen aan de beheerders geen adres. Om het adres in te stellen, voeg deze regel toe aan de klasse in de configuration.php van de site, met het adres waarop de site bereikbaar is (voorgesteld op basis van dit verzoek, controleer het): %s"
COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Er moeten deblokkeerlinks worden verstuurd (<a href=\"%s\">instellingen</a>), maar het adres van de site is niet ingesteld ($live_site in configuration.php): er worden geen deblokkeerlinks verstuurd."
COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (aanbevolen)"
Expand Down
1 change: 1 addition & 0 deletions component/admin/language/pt-BR/pt-BR.com_bfstop.ini
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ COM_BFSTOP_LOG_CLEAR_DESC="Todas as entradas do log serão excluídas permanente
COM_BFSTOP_LOG_CLEAR_CONFIRM="Esvaziar"
COM_BFSTOP_LOG_CLEARED="O log foi esvaziado."
COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Links de desbloqueio só podem ser enviados se o endereço do site estiver definido ($live_site no configuration.php do site). Defina-o lá, ou desative os links de desbloqueio."
COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="\"%1$s\" (%2$d) não pode ser maior que \"%3$s\" (%4$d): todo cliente teria %2$d tentativas. Diminua \"%1$s\", ou aumente \"%3$s\"."
COM_BFSTOP_WARNING_NO_LIVE_SITE="O endereço do site não está definido ($live_site no configuration.php). O Joomla! então monta os links dos e-mails do Brute Force Stop com o host indicado em cada requisição, que um visitante pode escolher livremente - por isso nenhum link de desbloqueio é enviado e as notificações aos administradores não indicam nenhum endereço. Para definir o endereço, adicione esta linha à classe no configuration.php do site, com o endereço pelo qual o site é acessado (proposto a partir desta requisição, verifique-o): %s"
COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Links de desbloqueio devem ser enviados (<a href=\"%s\">configurações</a>), mas o endereço do site não está definido ($live_site no configuration.php): nenhum link de desbloqueio é enviado."
COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (recomendado)"
Expand Down
1 change: 1 addition & 0 deletions component/admin/language/pt-PT/pt-PT.com_bfstop.ini
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ COM_BFSTOP_LOG_CLEAR_DESC="Todas as entradas do registo serão eliminadas perman
COM_BFSTOP_LOG_CLEAR_CONFIRM="Esvaziar"
COM_BFSTOP_LOG_CLEARED="O registo foi esvaziado."
COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="As ligações de desbloqueio só podem ser enviadas se o endereço do site estiver definido ($live_site no configuration.php do site). Defina-o aí, ou desative as ligações de desbloqueio."
COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="\"%1$s\" (%2$d) não pode ser superior a \"%3$s\" (%4$d): cada cliente teria %2$d tentativas. Diminua \"%1$s\", ou aumente \"%3$s\"."
COM_BFSTOP_WARNING_NO_LIVE_SITE="O endereço do site não está definido ($live_site no configuration.php). O Joomla! constrói então as ligações dos e-mails do Brute Force Stop com o anfitrião indicado em cada pedido, que um visitante pode escolher livremente - por isso não é enviada nenhuma ligação de desbloqueio e as notificações aos administradores não indicam nenhum endereço. Para definir o endereço, adicione esta linha à classe no configuration.php do site, com o endereço pelo qual o site é acedido (proposto a partir deste pedido, verifique-o): %s"
COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Devem ser enviadas ligações de desbloqueio (<a href=\"%s\">definições</a>), mas o endereço do site não está definido ($live_site no configuration.php): não é enviada nenhuma ligação de desbloqueio."
COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (recomendado)"
Expand Down
1 change: 1 addition & 0 deletions component/admin/language/ru-RU/ru-RU.com_bfstop.ini
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ COM_BFSTOP_LOG_CLEAR_DESC="Все записи журнала будут без
COM_BFSTOP_LOG_CLEAR_CONFIRM="Очистить"
COM_BFSTOP_LOG_CLEARED="Журнал очищен."
COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE="Ссылки разблокировки можно отправлять, только если задан адрес сайта ($live_site в configuration.php сайта). Задайте его там или отключите ссылки разблокировки."
COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER="«%1$s» (%2$d) не может быть больше, чем «%3$s» (%4$d): каждый клиент получил бы %2$d попыток. Уменьшите «%1$s» или увеличьте «%3$s»."
COM_BFSTOP_WARNING_NO_LIVE_SITE="Адрес сайта не задан ($live_site в configuration.php). Тогда Joomla! строит ссылки в письмах Brute Force Stop с хостом, указанным в каждом запросе, который посетитель может выбрать произвольно, — поэтому ссылки разблокировки не отправляются, а уведомления администраторам не содержат адреса. Чтобы задать адрес, добавьте эту строку в класс в configuration.php сайта, указав адрес, по которому доступен сайт (предложен на основе этого запроса, проверьте его): %s"
COM_BFSTOP_WARNING_NOTIFY_ANY_WITHOUT_LIVE_SITE="Ссылки разблокировки должны отправляться (<a href=\"%s\">настройки</a>), но адрес сайта не задан ($live_site в configuration.php): ссылки разблокировки не отправляются."
COM_BFSTOP_SETTINGS_IPV6_PREFIX_56="/56 (рекомендуется)"
Expand Down
14 changes: 13 additions & 1 deletion component/admin/src/Controller/HtblocklistController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
*/
class HtblocklistController extends BaseController
{
/**
* Whether $user may take entries out of the .htaccess file: core.admin
* as well as core.delete, like adding one (see HtblockController::mayAdd()):
* the file is part of the web server's configuration, and an entry an
* administrator added by hand is taken out with the same task. The
* toolbar asks this too.
*/
public static function mayRemove($user): bool
{
return $user && $user->authorise('core.delete', 'com_bfstop') && $user->authorise('core.admin', 'com_bfstop');
}

public function getModel($name = 'htblocklist', $prefix = '', $config = [])
{
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
Expand All @@ -33,7 +45,7 @@ public function unblock()
$this->checkToken();
// custom action, not AdminModel's standard delete() flow, so it
// doesn't get the built-in core.delete check for free
if (!$this->app->getIdentity()->authorise('core.delete', 'com_bfstop'))
if (!self::mayRemove($this->app->getIdentity()))
{
$this->setRedirect(Route::_('index.php?option=com_bfstop&view=htblocklist', false),
Text::_('COM_BFSTOP_NOT_AUTHORISED'), 'error');
Expand Down
21 changes: 21 additions & 0 deletions component/admin/src/Model/SettingsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\CMS\Table\Asset;
use Joomla\CMS\Table\Extension;
use Joomla\Registry\Registry;

/**
* The settings of BFStop, which are the params of the component's row of
Expand Down Expand Up @@ -119,6 +120,26 @@ public function validate($form, $data, $group = null)
$this->setError(Text::_('COM_BFSTOP_SETTINGS_NOTIFY_ANY_NEEDS_LIVE_SITE'));
return false;
}
if (is_array($valid))
{
// the floor of the risk scoring is a floor of the threshold for
// every client (see BlockPolicy::effectiveBlockNumber()): above the
// threshold it would raise it for everybody
$params = new Registry($valid['params'] ?? array());
$blockNumber = Settings::int($params, 'blockNumber');
$minBlockNumber = Settings::int($params, 'riskMinBlockNumber');
if ($minBlockNumber > $blockNumber)
{
// the label of the threshold is the plugin's, see the view
$language = Factory::getApplication()->getLanguage();
$language->load('plg_system_bfstop.sys', JPATH_ADMINISTRATOR)
|| $language->load('plg_system_bfstop.sys', JPATH_PLUGINS.'/system/bfstop');
$this->setError(Text::sprintf('COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_ABOVE_BLOCK_NUMBER',
Text::_('COM_BFSTOP_SETTINGS_RISK_MIN_BLOCK_NUMBER_LABEL'), $minBlockNumber,
Text::_('PLG_SYSTEM_BFSTOP_BLOCK_NUMBER_LABEL'), $blockNumber));
return false;
}
}
return $valid;
}

Expand Down
4 changes: 3 additions & 1 deletion component/admin/src/View/Htblocklist/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
defined('_JEXEC') or die;

use Codeling\Component\Bfstop\Administrator\Controller\HtblockController;
use Codeling\Component\Bfstop\Administrator\Controller\HtblocklistController;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
Expand Down Expand Up @@ -42,7 +43,8 @@ protected function addToolBar()
$user = Factory::getApplication()->getIdentity();
ToolbarHelper::title(Text::_('COM_BFSTOP_HEADING_HTACCESS_BLOCKLIST'), 'bfstop');
ToolbarHelper::divider();
if ($user->authorise('core.delete', 'com_bfstop'))
// the same rule as the task, see HtblocklistController::mayRemove()
if (HtblocklistController::mayRemove($user))
{
// batch unblock would require rewrite of unblock method to check
// for selected lines
Expand Down
Loading