0
|
1
|
|
2 package nabble.view.web.mailing_list;
|
|
3
|
|
4 import java.io.IOException;
|
|
5 import java.io.PrintWriter;
|
|
6
|
|
7 import javax.servlet.ServletException;
|
|
8 import javax.servlet.http.HttpServlet;
|
|
9 import javax.servlet.http.HttpServletRequest;
|
|
10 import javax.servlet.http.HttpServletResponse;
|
|
11
|
|
12 import nabble.model.Node;
|
|
13 import nabble.model.ListServer;
|
|
14 import nabble.model.MailingList;
|
|
15 import nabble.model.ModelHome;
|
|
16 import nabble.model.User;
|
|
17 import nabble.view.lib.Jtp;
|
|
18 import nabble.view.lib.Shared;
|
|
19 import fschmidt.util.mail.MailAddress;
|
|
20
|
|
21
|
|
22 public final class Unsubscribe2 extends HttpServlet {
|
|
23
|
|
24 protected void service(HttpServletRequest request,HttpServletResponse response)
|
|
25 throws ServletException, IOException
|
|
26 {
|
|
27 PrintWriter out = response.getWriter();
|
|
28 String context = request.getContextPath();
|
|
29 User user = Jtp.getUser(request,response);
|
|
30 if( user==null ) {
|
|
31 Jtp.login("You must login to be able to subscribe to a list.",request,response);
|
|
32 return;
|
|
33 }
|
|
34 Node forum = Jtp.getSiteNotNull(request).getNode(Long.parseLong(request.getParameter("forum")));
|
|
35 MailingList mailingList = forum.getAssociatedMailingList();
|
|
36 ListServer listServer = mailingList.getListServer();
|
|
37 MailAddress emailAddress = new MailAddress(user.getEmail(), user.getName());
|
|
38
|
|
39 out.print( "\r\n<html>\r\n<head>\r\n" );
|
|
40
|
|
41 Shared.title(request,response,"Subscribe to mailing list");
|
|
42
|
|
43 out.print( "\r\n</head>\r\n<body>\r\n" );
|
|
44 Shared.minHeader(request, response, forum);
|
|
45 out.print( "\r\n<h1>Unsubscription Request Was Sent</h1>\r\n<p>\r\n An unsubscription request was sent on your behalf to the mailing list: <strong>" );
|
|
46 out.print( (mailingList.getListAddress()) );
|
|
47 out.print( "</strong>.\r\n</p>\r\n<p>\r\n You will soon receive a confirmation request by email at <strong>" );
|
|
48 out.print( (user.getEmail()) );
|
|
49 out.print( "</strong>. Please follow the\r\ninstructions in this request to unsubscribe from the mailing list.\r\n</p>\r\n<p>\r\n <strong>Remember:</strong> You are not unsubscribed from the <strong>" );
|
|
50 out.print( (mailingList.getListAddress()) );
|
|
51 out.print( "</strong> list until you have followed the instructions in the email.\r\n</p>\r\n\r\n<br /><br />\r\n<p>« <a href=\"" );
|
|
52 out.print( (Jtp.path(forum)) );
|
|
53 out.print( "\">Return to forum</a></p>\r\n" );
|
|
54
|
|
55 Shared.footer(request,response);
|
|
56 Shared.analytics(request,response);
|
|
57
|
|
58 out.print( "\r\n</body>\r\n</html>\r\n" );
|
|
59
|
|
60 }
|
|
61 }
|
|
62
|