From 4c831fb948000bc1730ebcde73eeb62317f4ac54 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 28 Oct 2010 06:09:04 +0200 Subject: [PATCH] Move login requirement to SoneTemplatePage. --- .../java/net/pterodactylus/sone/web/AboutPage.java | 14 +---------- .../net/pterodactylus/sone/web/AddSonePage.java | 2 +- .../pterodactylus/sone/web/BackupProfilePage.java | 14 +---------- .../net/pterodactylus/sone/web/BlacklistPage.java | 2 +- .../pterodactylus/sone/web/BlacklistSonePage.java | 14 +---------- .../net/pterodactylus/sone/web/BlockSonePage.java | 15 +----------- .../net/pterodactylus/sone/web/CreatePostPage.java | 14 +---------- .../pterodactylus/sone/web/CreateReplyPage.java | 14 +---------- .../net/pterodactylus/sone/web/CreateSonePage.java | 2 +- .../net/pterodactylus/sone/web/DeletePostPage.java | 14 +---------- .../pterodactylus/sone/web/DeleteReplyPage.java | 14 +---------- .../net/pterodactylus/sone/web/DeleteSonePage.java | 14 +---------- .../pterodactylus/sone/web/EditProfilePage.java | 14 +---------- .../net/pterodactylus/sone/web/FollowSonePage.java | 14 +---------- .../net/pterodactylus/sone/web/ImportSonePage.java | 2 +- .../java/net/pterodactylus/sone/web/IndexPage.java | 14 +---------- .../net/pterodactylus/sone/web/KnownSonesPage.java | 2 +- .../java/net/pterodactylus/sone/web/LikePage.java | 14 +---------- .../net/pterodactylus/sone/web/LoadSonePage.java | 2 +- .../java/net/pterodactylus/sone/web/LoginPage.java | 11 +-------- .../net/pterodactylus/sone/web/LogoutPage.java | 10 +------- .../net/pterodactylus/sone/web/OptionsPage.java | 14 +---------- .../pterodactylus/sone/web/SoneTemplatePage.java | 27 ++++++++++++++++++++-- .../sone/web/UnblacklistSonePage.java | 14 +---------- .../pterodactylus/sone/web/UnblockSonePage.java | 15 +----------- .../pterodactylus/sone/web/UnfollowSonePage.java | 14 +---------- .../net/pterodactylus/sone/web/UnlikePage.java | 14 +---------- .../net/pterodactylus/sone/web/ViewPostPage.java | 14 +---------- .../net/pterodactylus/sone/web/ViewSonePage.java | 2 +- 29 files changed, 53 insertions(+), 277 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/AboutPage.java b/src/main/java/net/pterodactylus/sone/web/AboutPage.java index f49ff31..c20c72e 100644 --- a/src/main/java/net/pterodactylus/sone/web/AboutPage.java +++ b/src/main/java/net/pterodactylus/sone/web/AboutPage.java @@ -41,7 +41,7 @@ public class AboutPage extends SoneTemplatePage { * The version to display */ public AboutPage(Template template, WebInterface webInterface, Version version) { - super("about.html", template, "Page.About.Title", webInterface); + super("about.html", template, "Page.About.Title", webInterface, false); this.version = version; } @@ -58,16 +58,4 @@ public class AboutPage extends SoneTemplatePage { template.set("version", version); } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return false; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/AddSonePage.java b/src/main/java/net/pterodactylus/sone/web/AddSonePage.java index 9fdf122..fe3ce1c 100644 --- a/src/main/java/net/pterodactylus/sone/web/AddSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/AddSonePage.java @@ -36,7 +36,7 @@ public class AddSonePage extends SoneTemplatePage { * The Sone web interface */ public AddSonePage(Template template, WebInterface webInterface) { - super("addSone.html", template, "Page.AddSone.Title", webInterface); + super("addSone.html", template, "Page.AddSone.Title", webInterface, false); } // diff --git a/src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java b/src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java index dc00e4b..cca5df1 100644 --- a/src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java +++ b/src/main/java/net/pterodactylus/sone/web/BackupProfilePage.java @@ -39,7 +39,7 @@ public class BackupProfilePage extends SoneTemplatePage { * The Sone web interface */ public BackupProfilePage(Template template, WebInterface webInterface) { - super("backupProfile.html", template, "Page.BackupProfile.Title", webInterface); + super("backupProfile.html", template, "Page.BackupProfile.Title", webInterface, true); } // @@ -64,16 +64,4 @@ public class BackupProfilePage extends SoneTemplatePage { return response; } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return true; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/BlacklistPage.java b/src/main/java/net/pterodactylus/sone/web/BlacklistPage.java index ce83fad..d8818bd 100644 --- a/src/main/java/net/pterodactylus/sone/web/BlacklistPage.java +++ b/src/main/java/net/pterodactylus/sone/web/BlacklistPage.java @@ -42,7 +42,7 @@ public class BlacklistPage extends SoneTemplatePage { * The Sone web interface */ public BlacklistPage(Template template, WebInterface webInterface) { - super("blacklist.html", template, "Page.Blacklist.Title", webInterface); + super("blacklist.html", template, "Page.Blacklist.Title", webInterface, false); } // diff --git a/src/main/java/net/pterodactylus/sone/web/BlacklistSonePage.java b/src/main/java/net/pterodactylus/sone/web/BlacklistSonePage.java index d59ff96..b16f4a0 100644 --- a/src/main/java/net/pterodactylus/sone/web/BlacklistSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/BlacklistSonePage.java @@ -37,7 +37,7 @@ public class BlacklistSonePage extends SoneTemplatePage { * The Sone web interface */ public BlacklistSonePage(Template template, WebInterface webInterface) { - super("blacklistSone.html", template, "Page.BlacklistSone.Title", webInterface); + super("blacklistSone.html", template, "Page.BlacklistSone.Title", webInterface, false); } // @@ -59,16 +59,4 @@ public class BlacklistSonePage extends SoneTemplatePage { } } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return false; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java b/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java index 4bde0d1..328d6f0 100644 --- a/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/BlockSonePage.java @@ -36,7 +36,7 @@ public class BlockSonePage extends SoneTemplatePage { * The Sone web interface */ public BlockSonePage(Template template, WebInterface webInterface) { - super("blockSone.html", template, "Page.BlockSone.Title", webInterface); + super("blockSone.html", template, "Page.BlockSone.Title", webInterface, true); } // @@ -57,17 +57,4 @@ public class BlockSonePage extends SoneTemplatePage { } } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - // TODO Auto-generated method stub - return super.requiresLogin(); - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/CreatePostPage.java b/src/main/java/net/pterodactylus/sone/web/CreatePostPage.java index 2878f1c..869acd8 100644 --- a/src/main/java/net/pterodactylus/sone/web/CreatePostPage.java +++ b/src/main/java/net/pterodactylus/sone/web/CreatePostPage.java @@ -38,7 +38,7 @@ public class CreatePostPage extends SoneTemplatePage { * The Sone web interface */ public CreatePostPage(Template template, WebInterface webInterface) { - super("createPost.html", template, "Page.CreatePost.Title", webInterface); + super("createPost.html", template, "Page.CreatePost.Title", webInterface, true); } // @@ -64,16 +64,4 @@ public class CreatePostPage extends SoneTemplatePage { template.set("returnPage", returnPage); } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return true; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/CreateReplyPage.java b/src/main/java/net/pterodactylus/sone/web/CreateReplyPage.java index 9274874..231d372 100644 --- a/src/main/java/net/pterodactylus/sone/web/CreateReplyPage.java +++ b/src/main/java/net/pterodactylus/sone/web/CreateReplyPage.java @@ -38,7 +38,7 @@ public class CreateReplyPage extends SoneTemplatePage { * The Sone web interface */ public CreateReplyPage(Template template, WebInterface webInterface) { - super("createReply.html", template, "Page.CreateReply.Title", webInterface); + super("createReply.html", template, "Page.CreateReply.Title", webInterface, true); } // @@ -68,16 +68,4 @@ public class CreateReplyPage extends SoneTemplatePage { template.set("returnPage", returnPage); } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return true; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java b/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java index f67cd56..f977556 100644 --- a/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/CreateSonePage.java @@ -47,7 +47,7 @@ public class CreateSonePage extends SoneTemplatePage { * The Sone web interface */ public CreateSonePage(Template template, WebInterface webInterface) { - super("createSone.html", template, "Page.CreateSone.Title", webInterface); + super("createSone.html", template, "Page.CreateSone.Title", webInterface, false); } // diff --git a/src/main/java/net/pterodactylus/sone/web/DeletePostPage.java b/src/main/java/net/pterodactylus/sone/web/DeletePostPage.java index 18262a2..2aaa6c9 100644 --- a/src/main/java/net/pterodactylus/sone/web/DeletePostPage.java +++ b/src/main/java/net/pterodactylus/sone/web/DeletePostPage.java @@ -38,7 +38,7 @@ public class DeletePostPage extends SoneTemplatePage { * The Sone web interface */ public DeletePostPage(Template template, WebInterface webInterface) { - super("deletePost.html", template, "Page.DeletePost.Title", webInterface); + super("deletePost.html", template, "Page.DeletePost.Title", webInterface, true); } // @@ -77,16 +77,4 @@ public class DeletePostPage extends SoneTemplatePage { } } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return true; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/DeleteReplyPage.java b/src/main/java/net/pterodactylus/sone/web/DeleteReplyPage.java index d0a45f1..f0ece19 100644 --- a/src/main/java/net/pterodactylus/sone/web/DeleteReplyPage.java +++ b/src/main/java/net/pterodactylus/sone/web/DeleteReplyPage.java @@ -38,7 +38,7 @@ public class DeleteReplyPage extends SoneTemplatePage { * The Sone web interface */ public DeleteReplyPage(Template template, WebInterface webInterface) { - super("deleteReply.html", template, "Page.DeleteReply.Title", webInterface); + super("deleteReply.html", template, "Page.DeleteReply.Title", webInterface, true); } // @@ -70,16 +70,4 @@ public class DeleteReplyPage extends SoneTemplatePage { template.set("returnPage", returnPage); } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return true; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/DeleteSonePage.java b/src/main/java/net/pterodactylus/sone/web/DeleteSonePage.java index 4e63278..04aea3c 100644 --- a/src/main/java/net/pterodactylus/sone/web/DeleteSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/DeleteSonePage.java @@ -39,7 +39,7 @@ public class DeleteSonePage extends SoneTemplatePage { * The Sone web interface */ public DeleteSonePage(Template template, WebInterface webInterface) { - super("deleteSone.html", template, "Page.DeleteSone.Title", webInterface); + super("deleteSone.html", template, "Page.DeleteSone.Title", webInterface, true); } // @@ -61,16 +61,4 @@ public class DeleteSonePage extends SoneTemplatePage { } } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return true; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/EditProfilePage.java b/src/main/java/net/pterodactylus/sone/web/EditProfilePage.java index 372562b..965caf9 100644 --- a/src/main/java/net/pterodactylus/sone/web/EditProfilePage.java +++ b/src/main/java/net/pterodactylus/sone/web/EditProfilePage.java @@ -40,7 +40,7 @@ public class EditProfilePage extends SoneTemplatePage { * The Sone web interface */ public EditProfilePage(Template template, WebInterface webInterface) { - super("editProfile.html", template, "Page.EditProfile.Title", webInterface); + super("editProfile.html", template, "Page.EditProfile.Title", webInterface, true); } // @@ -86,16 +86,4 @@ public class EditProfilePage extends SoneTemplatePage { template.set("birthYear", birthYear); } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return true; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java b/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java index 36bb1a4..e438428 100644 --- a/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/FollowSonePage.java @@ -35,7 +35,7 @@ public class FollowSonePage extends SoneTemplatePage { * The Sone web interface */ public FollowSonePage(Template template, WebInterface webInterface) { - super("followSone.html", template, "Page.FollowSone.Title", webInterface); + super("followSone.html", template, "Page.FollowSone.Title", webInterface, true); } // @@ -60,16 +60,4 @@ public class FollowSonePage extends SoneTemplatePage { } } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return true; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/ImportSonePage.java b/src/main/java/net/pterodactylus/sone/web/ImportSonePage.java index ad0fb4c..413ed80 100644 --- a/src/main/java/net/pterodactylus/sone/web/ImportSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/ImportSonePage.java @@ -48,7 +48,7 @@ public class ImportSonePage extends SoneTemplatePage { * The Sone web interface */ public ImportSonePage(Template template, WebInterface webInterface) { - super("importSone.html", template, "Page.ImportSone.Title", webInterface); + super("importSone.html", template, "Page.ImportSone.Title", webInterface, false); } // diff --git a/src/main/java/net/pterodactylus/sone/web/IndexPage.java b/src/main/java/net/pterodactylus/sone/web/IndexPage.java index 47f2715..589e7aa 100644 --- a/src/main/java/net/pterodactylus/sone/web/IndexPage.java +++ b/src/main/java/net/pterodactylus/sone/web/IndexPage.java @@ -41,7 +41,7 @@ public class IndexPage extends SoneTemplatePage { * The Sone web interface */ public IndexPage(Template template, WebInterface webInterface) { - super("index.html", template, "Page.Index.Title", webInterface); + super("index.html", template, "Page.Index.Title", webInterface, true); } // @@ -71,16 +71,4 @@ public class IndexPage extends SoneTemplatePage { template.set("posts", allPosts); } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return true; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java b/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java index 0904619..f4cc5b7 100644 --- a/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java +++ b/src/main/java/net/pterodactylus/sone/web/KnownSonesPage.java @@ -42,7 +42,7 @@ public class KnownSonesPage extends SoneTemplatePage { * The Sone web interface */ public KnownSonesPage(Template template, WebInterface webInterface) { - super("knownSones.html", template, "Page.KnownSones.Title", webInterface); + super("knownSones.html", template, "Page.KnownSones.Title", webInterface, false); } // diff --git a/src/main/java/net/pterodactylus/sone/web/LikePage.java b/src/main/java/net/pterodactylus/sone/web/LikePage.java index e9d79ba..9b5bda3 100644 --- a/src/main/java/net/pterodactylus/sone/web/LikePage.java +++ b/src/main/java/net/pterodactylus/sone/web/LikePage.java @@ -38,7 +38,7 @@ public class LikePage extends SoneTemplatePage { * The Sone web interface */ public LikePage(Template template, WebInterface webInterface) { - super("like.html", template, "Page.LikePost.Title", webInterface); + super("like.html", template, "Page.LikePost.Title", webInterface, true); } // @@ -65,16 +65,4 @@ public class LikePage extends SoneTemplatePage { } } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return true; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/LoadSonePage.java b/src/main/java/net/pterodactylus/sone/web/LoadSonePage.java index d23a84f..6802bb4 100644 --- a/src/main/java/net/pterodactylus/sone/web/LoadSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/LoadSonePage.java @@ -37,7 +37,7 @@ public class LoadSonePage extends SoneTemplatePage { * The Sone web interface */ public LoadSonePage(Template template, WebInterface webInterface) { - super("loadSone.html", template, "Page.LoadSone.Title", webInterface); + super("loadSone.html", template, "Page.LoadSone.Title", webInterface, false); } // diff --git a/src/main/java/net/pterodactylus/sone/web/LoginPage.java b/src/main/java/net/pterodactylus/sone/web/LoginPage.java index c859cf6..0505220 100644 --- a/src/main/java/net/pterodactylus/sone/web/LoginPage.java +++ b/src/main/java/net/pterodactylus/sone/web/LoginPage.java @@ -26,7 +26,6 @@ import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.template.SoneAccessor; import net.pterodactylus.sone.web.page.Page.Request.Method; import net.pterodactylus.util.template.Template; -import freenet.clients.http.ToadletContext; /** * The login page manages logging the user in. @@ -44,7 +43,7 @@ public class LoginPage extends SoneTemplatePage { * The Sone web interface */ public LoginPage(Template template, WebInterface webInterface) { - super("login.html", template, "Page.Login.Title", webInterface); + super("login.html", template, "Page.Login.Title", webInterface, false); } // @@ -87,12 +86,4 @@ public class LoginPage extends SoneTemplatePage { } } - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled(ToadletContext toadletContext) { - return getCurrentSone(toadletContext) == null; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/LogoutPage.java b/src/main/java/net/pterodactylus/sone/web/LogoutPage.java index f173bbb..f1c0b48 100644 --- a/src/main/java/net/pterodactylus/sone/web/LogoutPage.java +++ b/src/main/java/net/pterodactylus/sone/web/LogoutPage.java @@ -34,7 +34,7 @@ public class LogoutPage extends SoneTemplatePage { * The Sone web interface */ public LogoutPage(Template template, WebInterface webInterface) { - super("logout.html", template, "Page.Logout.Title", webInterface); + super("logout.html", template, "Page.Logout.Title", webInterface, true); } // @@ -55,14 +55,6 @@ public class LogoutPage extends SoneTemplatePage { * {@inheritDoc} */ @Override - protected boolean requiresLogin() { - return true; - } - - /** - * {@inheritDoc} - */ - @Override public boolean isEnabled(ToadletContext toadletContext) { return getCurrentSone(toadletContext) != null; } diff --git a/src/main/java/net/pterodactylus/sone/web/OptionsPage.java b/src/main/java/net/pterodactylus/sone/web/OptionsPage.java index 0f9051d..3dc12c5 100644 --- a/src/main/java/net/pterodactylus/sone/web/OptionsPage.java +++ b/src/main/java/net/pterodactylus/sone/web/OptionsPage.java @@ -38,7 +38,7 @@ public class OptionsPage extends SoneTemplatePage { * The Sone web interface */ public OptionsPage(Template template, WebInterface webInterface) { - super("options.html", template, "Page.Options.Title", webInterface); + super("options.html", template, "Page.Options.Title", webInterface, false); } // @@ -66,16 +66,4 @@ public class OptionsPage extends SoneTemplatePage { template.set("really-clear-on-next-restart", options.getBooleanOption("ReallyClearOnNextRestart").get()); } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return false; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java index 47a2ab0..1eef0c4 100644 --- a/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java +++ b/src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java @@ -38,8 +38,12 @@ public class SoneTemplatePage extends TemplatePage { /** The Sone core. */ protected final WebInterface webInterface; + /** Whether to require a login. */ + private final boolean requireLogin; + /** - * Creates a new template page for Freetalk. + * Creates a new template page for Freetalk that does not require the user + * to be logged in. * * @param path * The path of the page @@ -51,8 +55,27 @@ public class SoneTemplatePage extends TemplatePage { * The Sone web interface */ public SoneTemplatePage(String path, Template template, String pageTitleKey, WebInterface webInterface) { + this(path, template, pageTitleKey, webInterface, false); + } + + /** + * Creates a new template page for Freetalk. + * + * @param path + * The path of the page + * @param template + * The template to render + * @param pageTitleKey + * The l10n key of the page title + * @param webInterface + * The Sone web interface + * @param requireLogin + * Whether this page requires a login + */ + public SoneTemplatePage(String path, Template template, String pageTitleKey, WebInterface webInterface, boolean requireLogin) { super(path, template, webInterface.l10n(), pageTitleKey, "noPermission.html"); this.webInterface = webInterface; + this.requireLogin = requireLogin; template.set("webInterface", webInterface); } @@ -166,7 +189,7 @@ public class SoneTemplatePage extends TemplatePage { * page, {@code false} otherwise */ protected boolean requiresLogin() { - return false; + return requireLogin; } /** diff --git a/src/main/java/net/pterodactylus/sone/web/UnblacklistSonePage.java b/src/main/java/net/pterodactylus/sone/web/UnblacklistSonePage.java index cc57608..e6be115 100644 --- a/src/main/java/net/pterodactylus/sone/web/UnblacklistSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/UnblacklistSonePage.java @@ -37,7 +37,7 @@ public class UnblacklistSonePage extends SoneTemplatePage { * The Sone web interface */ public UnblacklistSonePage(Template template, WebInterface webInterface) { - super("unblacklistSone.html", template, "Page.UnblacklistSone.Title", webInterface); + super("unblacklistSone.html", template, "Page.UnblacklistSone.Title", webInterface, false); } // @@ -59,16 +59,4 @@ public class UnblacklistSonePage extends SoneTemplatePage { } } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return false; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/UnblockSonePage.java b/src/main/java/net/pterodactylus/sone/web/UnblockSonePage.java index 36f00bc..cc88cce 100644 --- a/src/main/java/net/pterodactylus/sone/web/UnblockSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/UnblockSonePage.java @@ -36,7 +36,7 @@ public class UnblockSonePage extends SoneTemplatePage { * The Sone web interface */ public UnblockSonePage(Template template, WebInterface webInterface) { - super("unblockSone.html", template, "Page.UnblockSone.Title", webInterface); + super("unblockSone.html", template, "Page.UnblockSone.Title", webInterface, true); } // @@ -59,17 +59,4 @@ public class UnblockSonePage extends SoneTemplatePage { } } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - // TODO Auto-generated method stub - return super.requiresLogin(); - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java b/src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java index 6a9466d..61dd9d2 100644 --- a/src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/UnfollowSonePage.java @@ -35,7 +35,7 @@ public class UnfollowSonePage extends SoneTemplatePage { * The Sone web interface */ public UnfollowSonePage(Template template, WebInterface webInterface) { - super("unfollowSone.html", template, "Page.UnfollowSone.Title", webInterface); + super("unfollowSone.html", template, "Page.UnfollowSone.Title", webInterface, true); } // @@ -60,16 +60,4 @@ public class UnfollowSonePage extends SoneTemplatePage { } } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return true; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/UnlikePage.java b/src/main/java/net/pterodactylus/sone/web/UnlikePage.java index bedf759..287c36c 100644 --- a/src/main/java/net/pterodactylus/sone/web/UnlikePage.java +++ b/src/main/java/net/pterodactylus/sone/web/UnlikePage.java @@ -38,7 +38,7 @@ public class UnlikePage extends SoneTemplatePage { * The Sone web interface */ public UnlikePage(Template template, WebInterface webInterface) { - super("unlike.html", template, "Page.UnlikePost.Title", webInterface); + super("unlike.html", template, "Page.UnlikePost.Title", webInterface, true); } // @@ -65,16 +65,4 @@ public class UnlikePage extends SoneTemplatePage { } } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return true; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java b/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java index 0918e55..3f3dadc 100644 --- a/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ViewPostPage.java @@ -36,7 +36,7 @@ public class ViewPostPage extends SoneTemplatePage { * The Sone web interface */ public ViewPostPage(Template template, WebInterface webInterface) { - super("viewPost.html", template, "Page.ViewPost.Title", webInterface); + super("viewPost.html", template, "Page.ViewPost.Title", webInterface, false); } // @@ -54,16 +54,4 @@ public class ViewPostPage extends SoneTemplatePage { template.set("post", post); } - // - // SONETEMPLATEPAGE METHODS - // - - /** - * {@inheritDoc} - */ - @Override - protected boolean requiresLogin() { - return true; - } - } diff --git a/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java b/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java index ba69eed..430aa8c 100644 --- a/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java +++ b/src/main/java/net/pterodactylus/sone/web/ViewSonePage.java @@ -36,7 +36,7 @@ public class ViewSonePage extends SoneTemplatePage { * The Sone web interface */ public ViewSonePage(Template template, WebInterface webInterface) { - super("viewSone.html", template, "Page.ViewSone.Title", webInterface); + super("viewSone.html", template, "Page.ViewSone.Title", webInterface, false); } // -- 2.7.4