From e1c812c59dfc7e57695e9f77ae9460d7a9120dea Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 11 Apr 2011 11:37:00 +0200 Subject: [PATCH] =?utf8?q?Add=20=E2=80=9Crequire=20full=20access=20hosts?= =?utf8?q?=E2=80=9D=20option=20to=20options=20page.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/OptionsPage.java | 3 +++ src/main/resources/i18n/sone.en.properties | 1 + src/main/resources/templates/options.html | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/web/OptionsPage.java b/src/main/java/net/pterodactylus/sone/web/OptionsPage.java index d603b1a..0bad533 100644 --- a/src/main/java/net/pterodactylus/sone/web/OptionsPage.java +++ b/src/main/java/net/pterodactylus/sone/web/OptionsPage.java @@ -76,6 +76,8 @@ public class OptionsPage extends SoneTemplatePage { preferences.setTrustComment(trustComment); boolean fcpInterfaceActive = Boolean.parseBoolean(request.getHttpRequest().getPartAsStringFailsafe("fcp-interface-active", 5)); preferences.setFcpInterfaceActive(fcpInterfaceActive); + boolean requireFullAccessHosts = Boolean.parseBoolean(request.getHttpRequest().getPartAsStringFailsafe("require-full-access-hosts", 5)); + preferences.setFcpWriteFromFullAccessOnly(requireFullAccessHosts); boolean soneRescueMode = Boolean.parseBoolean(request.getHttpRequest().getPartAsStringFailsafe("sone-rescue-mode", 5)); preferences.setSoneRescueMode(soneRescueMode); boolean clearOnNextRestart = Boolean.parseBoolean(request.getHttpRequest().getPartAsStringFailsafe("clear-on-next-restart", 5)); @@ -94,6 +96,7 @@ public class OptionsPage extends SoneTemplatePage { templateContext.set("negative-trust", preferences.getNegativeTrust()); templateContext.set("trust-comment", preferences.getTrustComment()); templateContext.set("fcp-interface-active", preferences.isFcpInterfaceActive()); + templateContext.set("require-full-access-hosts", preferences.isFcpWriteFromFullAccessOnly()); templateContext.set("sone-rescue-mode", preferences.isSoneRescueMode()); templateContext.set("clear-on-next-restart", preferences.isClearOnNextRestart()); templateContext.set("really-clear-on-next-restart", preferences.isReallyClearOnNextRestart()); diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index b46318c..b7fbbad 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -43,6 +43,7 @@ Page.Options.Option.NegativeTrust.Description=The amount of trust you want to as Page.Options.Option.TrustComment.Description=The comment that will be set in the web of trust for any trust you assign from Sone. Page.Options.Section.FcpOptions.Title=FCP Interface Settings Page.Options.Option.FcpInterfaceActive.Description=Activate the FCP interface to allow other plugins and remote clients to access your Sone plugin. +Page.Options.Option.FcpFullAccessRequired.Description=Require FCP connection from allowed hosts (see your {link}node’s configuration, section “FCP”{/link}) to change data using the FCP interface Page.Options.Section.RescueOptions.Title=Rescue Settings Page.Options.Option.SoneRescueMode.Description=Try to rescue your Sones at the next start of the Sone plugin. This will read your all your old Sones from Freenet and ignore any disappearing postings and replies. You have to unlock your local Sones after they have been restored and you have to manually disable the rescue mode once you are satisfied with what has been restored! Page.Options.Section.Cleaning.Title=Clean Up diff --git a/src/main/resources/templates/options.html b/src/main/resources/templates/options.html index bd9de95..74e60ed 100644 --- a/src/main/resources/templates/options.html +++ b/src/main/resources/templates/options.html @@ -61,6 +61,8 @@

checked="checked"<%/if> /> <%= Page.Options.Option.FcpInterfaceActive.Description|l10n|html>

+

checked="checked"<%/if> /> <%= Page.Options.Option.FcpFullAccessRequired.Description|l10n|html|replace needle="{link}" replacement=''|replace needle="{/link}" replacement=''>

+

<%= Page.Options.Section.RescueOptions.Title|l10n|html>

<%= Page.Options.Option.SoneRescueMode.Description|l10n|html>

-- 2.7.4