projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert “image insert failed” into EventBus-based event.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
DeleteReplyPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/DeleteReplyPage.java
b/src/main/java/net/pterodactylus/sone/web/DeleteReplyPage.java
index
67a6f3d
..
4d6aff2
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/DeleteReplyPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/DeleteReplyPage.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - DeleteReplyPage.java - Copyright © 2010 David Roden
+ * Sone - DeleteReplyPage.java - Copyright © 2010
–2012
David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-17,11
+17,11
@@
package net.pterodactylus.sone.web;
package net.pterodactylus.sone.web;
-import net.pterodactylus.sone.data.Reply;
-import net.pterodactylus.sone.data.Sone;
-import net.pterodactylus.sone.web.page.Page.Request.Method;
+import net.pterodactylus.sone.data.PostReply;
+import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
+import net.pterodactylus.util.web.Method;
/**
* This page lets the user delete a reply.
/**
* This page lets the user delete a reply.
@@
-50,14
+50,13
@@
public class DeleteReplyPage extends SoneTemplatePage {
* {@inheritDoc}
*/
@Override
* {@inheritDoc}
*/
@Override
- protected void processTemplate(Request request, TemplateContext templateContext) throws RedirectException {
+ protected void processTemplate(
Freenet
Request request, TemplateContext templateContext) throws RedirectException {
super.processTemplate(request, templateContext);
String replyId = request.getHttpRequest().getPartAsStringFailsafe("reply", 36);
super.processTemplate(request, templateContext);
String replyId = request.getHttpRequest().getPartAsStringFailsafe("reply", 36);
-
Reply reply = webInterface.getCore().getReply(replyId
);
+
PostReply reply = webInterface.getCore().getPostReply(replyId, false
);
String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256);
if (request.getMethod() == Method.POST) {
String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256);
if (request.getMethod() == Method.POST) {
- Sone currentSone = getCurrentSone(request.getToadletContext());
- if (!reply.getSone().equals(currentSone)) {
+ if (!reply.getSone().isLocal()) {
throw new RedirectException("noPermission.html");
}
if (request.getHttpRequest().isPartSet("confirmDelete")) {
throw new RedirectException("noPermission.html");
}
if (request.getHttpRequest().isPartSet("confirmDelete")) {