Add “unauthorized access” template.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 16 Oct 2010 10:28:14 +0000 (12:28 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 16 Oct 2010 10:28:14 +0000 (12:28 +0200)
src/main/java/net/pterodactylus/sone/web/WebInterface.java
src/main/resources/i18n/sone.en.properties
src/main/resources/templates/noPermission.html [new file with mode: 0644]

index 4545ac5..83a942a 100644 (file)
@@ -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")));
 
index 179ab52..6824a53 100644 (file)
@@ -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 (file)
index 0000000..0ad1c19
--- /dev/null
@@ -0,0 +1,7 @@
+<div id="sone">
+
+       <h1><%= Page.NoPermission.Page.Title|l10n|html></h1>
+
+       <div><%= Page.NoPermission.Text.NoPermission|l10n|html></div>
+       
+</div>