From: David ‘Bombe’ Roden Date: Sat, 16 Oct 2010 10:28:14 +0000 (+0200) Subject: Add “unauthorized access” template. X-Git-Tag: 0.1-RC1~272 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7bfcfb4933112345a2d7c5710993ab0109b53c57;p=Sone.git Add “unauthorized access” template. --- 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>
+ +