From eaf217ef7d57e098f640c59c28bbc702a030a0aa Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 25 Jul 2019 22:37:30 -0400 Subject: [PATCH] Update server block admin page to reflect the addition of shell wildcard syntax --- src/Module/Admin/Blocklist/Server.php | 26 ++++++++++++++--------- view/templates/admin/blocklist/server.tpl | 18 ++++++++++------ 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/Module/Admin/Blocklist/Server.php b/src/Module/Admin/Blocklist/Server.php index 754d1aad5..384e346b0 100644 --- a/src/Module/Admin/Blocklist/Server.php +++ b/src/Module/Admin/Blocklist/Server.php @@ -28,7 +28,7 @@ class Server extends BaseAdminModule 'reason' => Strings::escapeTags(trim($_POST['newentry_reason'])) ]; Config::set('system', 'blocklist', $blocklist); - info(L10n::t('Server added to blocklist.') . EOL); + info(L10n::t('Server domain pattern added to blocklist.') . EOL); } else { // Edit the entries from blocklist $blocklist = []; @@ -61,9 +61,9 @@ class Server extends BaseAdminModule if (is_array($blocklist)) { foreach ($blocklist as $id => $b) { $blocklistform[] = [ - 'domain' => ["domain[$id]", L10n::t('Blocked domain'), $b['domain'], '', L10n::t('The blocked domain'), 'required', '', ''], - 'reason' => ["reason[$id]", L10n::t("Reason for the block"), $b['reason'], L10n::t('The reason why you blocked this domain.') . '(' . $b['domain'] . ')', 'required', '', ''], - 'delete' => ["delete[$id]", L10n::t("Delete domain") . ' (' . $b['domain'] . ')', false, L10n::t("Check to delete this entry from the blocklist")] + 'domain' => ["domain[$id]", L10n::t('Blocked server domain pattern'), $b['domain'], '', 'required', '', ''], + 'reason' => ["reason[$id]", L10n::t("Reason for the block"), $b['reason'], '', 'required', '', ''], + 'delete' => ["delete[$id]", L10n::t("Delete server domain pattern") . ' (' . $b['domain'] . ')', false, L10n::t("Check to delete this entry from the blocklist")] ]; } } @@ -71,16 +71,22 @@ class Server extends BaseAdminModule $t = Renderer::getMarkupTemplate('admin/blocklist/server.tpl'); return Renderer::replaceMacros($t, [ '$title' => L10n::t('Administration'), - '$page' => L10n::t('Server Blocklist'), - '$intro' => L10n::t('This page can be used to define a black list of servers from the federated network that are not allowed to interact with your node. For all entered domains you should also give a reason why you have blocked the remote server.'), - '$public' => L10n::t('The list of blocked servers will be made publically available on the /friendica page so that your users and people investigating communication problems can find the reason easily.'), + '$page' => L10n::t('Server Domain Pattern Blocklist'), + '$intro' => L10n::t('This page can be used to define a blacklist of server domain patterns from the federated network that are not allowed to interact with your node. For each domain pattern you should also provide the reason why you block it.'), + '$public' => L10n::t('The list of blocked server domain patterns will be made publically available on the /friendica page so that your users and people investigating communication problems can find the reason easily.'), + '$syntax' => L10n::t('

The server domain pattern syntax is case-insensitive shell wildcard, comprising the following special characters:

+'), '$addtitle' => L10n::t('Add new entry to block list'), - '$newdomain' => ['newentry_domain', L10n::t('Server Domain'), '', L10n::t('The domain of the new server to add to the block list. Do not include the protocol.'), 'required', '', ''], - '$newreason' => ['newentry_reason', L10n::t('Block reason'), '', L10n::t('The reason why you blocked this domain.'), 'required', '', ''], + '$newdomain' => ['newentry_domain', L10n::t('Server Domain Pattern'), '', L10n::t('The domain pattern of the new server to add to the block list. Do not include the protocol.'), 'required', '', ''], + '$newreason' => ['newentry_reason', L10n::t('Block reason'), '', L10n::t('The reason why you blocked this server domain pattern.'), 'required', '', ''], '$submit' => L10n::t('Add Entry'), '$savechanges' => L10n::t('Save changes to the blocklist'), '$currenttitle' => L10n::t('Current Entries in the Blocklist'), - '$thurl' => L10n::t('Blocked domain'), + '$thurl' => L10n::t('Blocked server domain pattern'), '$threason' => L10n::t('Reason for the block'), '$delentry' => L10n::t('Delete entry from blocklist'), '$entries' => $blocklistform, diff --git a/view/templates/admin/blocklist/server.tpl b/view/templates/admin/blocklist/server.tpl index beea96fc5..d3cf5c425 100644 --- a/view/templates/admin/blocklist/server.tpl +++ b/view/templates/admin/blocklist/server.tpl @@ -4,20 +4,23 @@ }
-

{{$title}} - {{$page}}

+

{{$title}} - {{$page}}

{{$intro}}

-

{{$public}}

+

{{$public nofilter}}

+ {{$syntax nofilter}} -

{{$addtitle}}

+

{{$addtitle}}

{{include file="field_input.tpl" field=$newdomain}} {{include file="field_input.tpl" field=$newreason}} -
+
+ +
{{if $entries}} -

{{$currenttitle}}

+

{{$currenttitle}}

{{$currentintro}}

@@ -26,8 +29,9 @@ {{include file="field_input.tpl" field=$e.reason}} {{include file="field_checkbox.tpl" field=$e.delete}} {{/foreach}} -
+
+ +
{{/if}}
-