Remove the old queue view and migrate the new one to the override_room_banner logic
authorArt Cancro <ajc@uncensored.citadel.org>
Thu, 15 Mar 2012 21:55:47 +0000 (17:55 -0400)
committerArt Cancro <ajc@uncensored.citadel.org>
Thu, 15 Mar 2012 21:55:47 +0000 (17:55 -0400)
webcit/smtpqueue.c
webcit/static/t/aide/global_config.html
webcit/static/t/view_mailq/header.html

index b03c4e0dcdce4d18dfd2efe15f4aaf3e62a7378d..b059ff905be033c10e6001dc3cd17ff2cea3bc72 100644 (file)
@@ -162,112 +162,6 @@ void display_queue_msg(long msgnum)
 }
 
 
-void display_smtpqueue_inner_div(void) {
-       message_summary *Msg = NULL;
-       wcsession *WCC = WC;
-       int i;
-       int num_msgs;
-       StrBuf *Buf;
-       SharedMessageStatus Stat;
-
-       memset(&Stat, 0, sizeof(SharedMessageStatus));
-       /* Check to see if we can go to the __CitadelSMTPspoolout__ room.
-        * If not, we don't have access to the queue.
-        */
-       Buf = NewStrBufPlain(HKEY("__CitadelSMTPspoolout__"));
-       gotoroom(Buf);
-       FreeStrBuf(&Buf);
-       if (!strcasecmp(ChrPtr(WCC->CurRoom.name), "__CitadelSMTPspoolout__")) {
-
-               Stat.maxload = 10000;
-               Stat.lowest_found = (-1);
-               Stat.highest_found = (-1);
-//             num_msgs = load_msg_ptrs("MSGS ALL|0|1", "SUBJ|;QMSG", &Stat, NULL);
-               num_msgs = load_msg_ptrs("MSGS ", NULL, &Stat, NULL);
-               if (num_msgs > 0) {
-                        wc_printf("<table class=\"mailbox_summary\" rules=rows "
-                               "cellpadding=2 style=\"width:100%%;\">"
-                       );
-
-                       wc_printf("<tr><td><b><i>");
-                       wc_printf(_("Message ID"));
-                       wc_printf("</i></b></td><td><b><i>");
-                       wc_printf(_("Date/time submitted"));
-                       wc_printf("</i></b></td><td><b><i>");
-                       wc_printf(_("Last attempt"));
-                       wc_printf("</i></b></td><td><b><i>");
-                       wc_printf(_("Sender"));
-                       wc_printf("</i></b></td><td><b><i>");
-                       wc_printf(_("Recipients"));
-                       wc_printf("</i></b></td></tr>\n");
-
-                       for (i=0; (i < num_msgs) && (i < Stat.maxload); ++i) {
-                               Msg = GetMessagePtrAt(i, WCC->summ);
-                               if (Msg != NULL) {
-                                       display_queue_msg(Msg->msgnum);
-                               }
-                       }
-
-                       wc_printf("</table>");
-
-               }
-               else {
-                       wc_printf("<br><br><div align=\"center\">");
-                       wc_printf(_("The queue is empty."));
-                       wc_printf("</div><br><br>");
-               }
-       }
-       else {
-               wc_printf("<br><br><div align=\"center\">");
-               wc_printf(_("You do not have permission to view this resource."));
-               wc_printf("</div><br><br>");
-       }
-       output_headers(0, 0, 0, 0, 0, 0);
-       end_burst();
-}
-
-/*
- * display the outbound SMTP queue
- */
-void display_smtpqueue(void)
-{
-       output_headers(1, 1, 2, 0, 0, 0);
-
-       wc_printf("<div id=\"banner\">\n");
-       wc_printf("<h1>");
-       wc_printf(_("View the outbound SMTP queue"));
-       wc_printf("</h1>\n");
-       wc_printf("</div>\n");
-
-       wc_printf("<div id=\"content\" class=\"service\">\n");
-
-       wc_printf("<table class=\"smtpqueue_background\">"
-               "<tr><td valign=top>\n");
-
-       wc_printf("<div id=\"smtpqueue_inner_div\">"
-               "<div align=\"center\"><img src=\"static/webcit_icons/throbber.gif\"></div>"
-               "</div>"
-               "<div align=\"center\">"
-               "<a href=\"javascript:RefreshSMTPqueueDisplay();\">%s</a>"
-               "</div>"
-               "</td></tr></table>\n", _("Refresh this page")
-       );
-
-       StrBufAppendPrintf(WC->trailing_javascript, "RefreshSMTPqueueDisplay();\n");
-
-       wDumpContent(1);
-
-}
-
-
-
-
-
-
-
-
-
-
 typedef struct _mailq_entry {
        StrBuf *Recipient;
        StrBuf *StatusMessage;
@@ -572,14 +466,7 @@ ServerStartModule_SMTP_QUEUE
 
 int qview_PrintPageHeader(SharedMessageStatus *Stat, void **ViewSpecific)
 {
-       if (!WC->is_aide)
-       {
-               output_headers(1, 1, 1, 0, 0, 0);
-       }
-       else
-       {
-               output_headers(1, 1, 2, 0, 0, 0);
-       }
+       output_headers(1, 1, 1, 0, 0, 0);
        return 0;
 }
 
@@ -658,12 +545,7 @@ InitModule_SMTP_QUEUE
        RegisterQItemHandler(HKEY("bounceto"),          QItem_Handle_BounceTo);
        RegisterQItemHandler(HKEY("source_room"),       QItem_Handle_SenderRoom);
        RegisterQItemHandler(HKEY("submitted"),         QItem_Handle_Submitted);
-
-       WebcitAddUrlHandler(HKEY("display_smtpqueue"), "", 0, display_smtpqueue, 0);
-       WebcitAddUrlHandler(HKEY("display_smtpqueue_inner_div"), "", 0, display_smtpqueue_inner_div, 0);
        RegisterMimeRenderer(HKEY("application/x-citadel-delivery-list"), render_QUEUE, 1, 9000);
-
-
        RegisterNamespace("MAILQ:ID", 0, 0, tmplput_MailQID, NULL, CTX_MAILQITEM);
        RegisterNamespace("MAILQ:PAYLOAD:ID", 0, 0, tmplput_MailQPayloadID, NULL, CTX_MAILQITEM);
        RegisterNamespace("MAILQ:BOUNCETO", 0, 1, tmplput_MailQBounceTo, NULL, CTX_MAILQITEM);
index 891c7ec2dccccff600f780395c140e16da2f8231..fe06f7c4dc0bf0a3a9f5c8fa13724320653720eb 100644 (file)
@@ -2,5 +2,5 @@
 <li><a href="do_template?template=aide_display_sitewide_config"><?_("Edit site-wide configuration")></a></li>
 <li><a href="do_template?template=aide_display_inetconf"><?_("Domain names and Internet mail configuration")></a></li>
 <li><a href="do_template?template=aide_display_ignetconf"><?_("Configure replication with other Citadel servers")></a></li>
-<li><a href="dotgoto?room=__CitadelSMTPspoolout__&view=11"><?_("View the outbound SMTP queue")></a></li>
+<li><a href="dotskip?room=__CitadelSMTPspoolout__&view=11"><?_("View the outbound SMTP queue")></a></li>
 </ul>
index 9a57e9a9ff9ccbe071bfb61cb71108c880d35dab..d028db9dd920239c560623293f3e777f0def26f2 100644 (file)
@@ -1,4 +1,4 @@
-<div id="banner">
+<div id="room_banner_override">
 <h1>
 <?_("View the outbound SMTP queue")>
 </h1>