X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fmail%2FMailingList.java;h=4eca2c1ea3beb17cd56b37b5593c9ecc4de2dcd9;hb=bc83134e919098665f5027be4b2b11d971270d15;hp=82c5ec34b330b6feccc76d53f24dff47ff9802d6;hpb=440e9bee20802bfbf97061b01f950448d3baf8f5;p=org.ibex.mail.git diff --git a/src/org/ibex/mail/MailingList.java b/src/org/ibex/mail/MailingList.java index 82c5ec3..4eca2c1 100644 --- a/src/org/ibex/mail/MailingList.java +++ b/src/org/ibex/mail/MailingList.java @@ -10,8 +10,6 @@ import org.ibex.mail.protocol.*; import java.util.*; import java.io.*; import java.net.*; -import org.prevayler.*; -import org.prevayler.Query; import javax.servlet.*; import javax.servlet.http.*; @@ -29,16 +27,27 @@ public class MailingList implements Target, Iterable { } public void banner(HttpServletRequest request, HttpServletResponse response) throws IOException { - String basename = request.getServletPath(); + String basename = request.getRequestURL()+""; PrintWriter pw = new PrintWriter(response.getWriter()); + /* pw.println(""); + pw.println(" "); + pw.println(" "); + pw.println(" "); pw.println(" "); + */ String confirm = request.getParameter("confirm"); if (confirm != null) { - Subscribe sub = (Subscribe)Confirmation.decode(confirm, Long.parseLong(properties.get("secret")), new Date()); + Subscribe sub = (Subscribe)Confirmation.decode(confirm, secret, new Date()); String email = sub.email; synchronized(this) { - String path = this.path.getAbsolutePath() + File.separatorChar + "subscribers" + File.separatorChar + sub.email; + String path = this.path.getAbsolutePath() + File.separatorChar + "subscribers" + File.separatorChar+sub.email; if (sub.un) new File(path).delete(); else { Log.warn(null, "creating " + path); @@ -47,30 +56,42 @@ public class MailingList implements Target, Iterable { } pw.println(" successfully "+sub.adj+"d " + email + " to " + properties.get("address")); } else { - pw.println(" "+properties.get("address")+"
"); - pw.println(" "+properties.get("nntp")+"
"); String action = request.getParameter("action"); String email = request.getParameter("email"); if (action != null) { Subscribe sub = new Subscribe(email, request.getRequestURL().toString(), action.equals("unsubscribe")); - sub.signAndSend(new Address(properties.get("owner")), Long.parseLong(properties.get("secret")), new Date()); - pw.println("a confirmation email has been sent to " + email + "; click the enclosed link to confirm your request to " + action); + sub.signAndSend(new Address(properties.get("owner")), + secret, new Date()); + pw.println("a confirmation email has been sent to " + email + + "; click the enclosed link to confirm your request to " + action); } else { - pw.println("
"); + pw.println("
"); + pw.println(" "+properties.get("address")+"
"); + pw.println(" "+properties.get("description")+" "); + pw.println("
"); + pw.println("access via: "); + if (path.getAbsolutePath().startsWith("/afs/")) + pw.println("[AFS] "); + pw.println("[NNTP]"); + pw.println("[SMTP]"); + pw.println("[HTTP]"); + pw.println("
"); + pw.println(" "); pw.println(" "); pw.println(" "); pw.println(" "); pw.println(" "); + pw.println("
"); } } - pw.println(" "); - pw.println(""); + //pw.println(" "); + //pw.println(""); pw.flush(); - pw.close(); } public class Subscribe extends Confirmation {