Add “require full access hosts” option to options page.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 11 Apr 2011 09:37:00 +0000 (11:37 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 11 Apr 2011 09:37:00 +0000 (11:37 +0200)
src/main/java/net/pterodactylus/sone/web/OptionsPage.java
src/main/resources/i18n/sone.en.properties
src/main/resources/templates/options.html

index d603b1a..0bad533 100644 (file)
@@ -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());
index b46318c..b7fbbad 100644 (file)
@@ -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
index bd9de95..74e60ed 100644 (file)
@@ -61,6 +61,8 @@
 
                <p><input type="checkbox" name="fcp-interface-active"<%if fcp-interface-active> checked="checked"<%/if> /> <%= Page.Options.Option.FcpInterfaceActive.Description|l10n|html></p>
 
+               <p><input type="checkbox" name="require-full-access-hosts"<%if require-full-access-hosts> checked="checked"<%/if> /> <%= Page.Options.Option.FcpFullAccessRequired.Description|l10n|html|replace needle="{link}" replacement='<a href="/config/fcp">'|replace needle="{/link}" replacement='</a>'></p>
+
                <h2><%= Page.Options.Section.RescueOptions.Title|l10n|html></h2>
 
                <p><%= Page.Options.Option.SoneRescueMode.Description|l10n|html></p>