From 7bfcfb4933112345a2d7c5710993ab0109b53c57 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 16 Oct 2010 12:28:14 +0200 Subject: [PATCH] =?utf8?q?Add=20=E2=80=9Cunauthorized=20access=E2=80=9D=20?= =?utf8?q?template.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/WebInterface.java | 3 +++ src/main/resources/i18n/sone.en.properties | 4 ++++ src/main/resources/templates/noPermission.html | 7 +++++++ 3 files changed, 14 insertions(+) create mode 100644 src/main/resources/templates/noPermission.html diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 4545ac5..83a942a 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -187,6 +187,8 @@ public class WebInterface extends AbstractService { Template deleteSoneTemplate = templateFactory.createTemplate(createReader("/templates/deleteSone.html")); deleteSoneTemplate.set("formPassword", formPassword); + Template noPermissionTemplate = templateFactory.createTemplate(createReader("/templates/noPermission.html")); + Template logoutTemplate = templateFactory.createTemplate(createReader("/templates/logout.html")); PageToadletFactory pageToadletFactory = new PageToadletFactory(sonePlugin.pluginRespirator().getHLSimpleClient(), "/Sone/"); @@ -203,6 +205,7 @@ public class WebInterface extends AbstractService { pageToadlets.add(pageToadletFactory.createPageToadlet(new DeleteSonePage(deleteSoneTemplate, this), "DeleteSone")); pageToadlets.add(pageToadletFactory.createPageToadlet(new LoginPage(loginTemplate, this), "Login")); pageToadlets.add(pageToadletFactory.createPageToadlet(new LogoutPage(logoutTemplate, this), "Logout")); + pageToadlets.add(pageToadletFactory.createPageToadlet(new SoneTemplatePage("noPermission.html", noPermissionTemplate, "Page.NoPermission.Title", this))); pageToadlets.add(pageToadletFactory.createPageToadlet(new StaticPage("css/", "/static/css/", "text/css"))); pageToadlets.add(pageToadletFactory.createPageToadlet(new StaticPage("javascript/", "/static/javascript/", "text/javascript"))); diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index 179ab52..6824a53 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -106,6 +106,10 @@ Page.ViewPost.Button.PostReply=Post Reply! Page.FollowSone.Title=Follow Sone - Sone +Page.NoPermission.Title=Unauthorized Access - Sone +Page.NoPermission.Page.Title=Unauthorized Access +Page.NoPermission.Text.NoPermission=You tried to do something that you do not have sufficient authorization for. Please refrain from such actions in the future or we will be forced to take counter-measures! + Page.Logout.Title=Logout - Sone View.Post.DeleteLink=Delete Post diff --git a/src/main/resources/templates/noPermission.html b/src/main/resources/templates/noPermission.html new file mode 100644 index 0000000..0ad1c19 --- /dev/null +++ b/src/main/resources/templates/noPermission.html @@ -0,0 +1,7 @@ +
+ +

<%= Page.NoPermission.Page.Title|l10n|html>

+ +
<%= Page.NoPermission.Text.NoPermission|l10n|html>
+ +
-- 2.7.4