For sites in guest mode, redirect to the landing page after we're logged out.
authorArt Cancro <ajc@uncensored.citadel.org>
Thu, 7 Jul 2011 22:41:21 +0000 (18:41 -0400)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 21:33:21 +0000 (21:33 +0000)
webcit/auth.c
webcit/static/wclib.js

index d340ebb8a634cda819c1742e04ee7b12d21c9f12..dd015670499984a7b4303a0c1f47234ce108fe44 100644 (file)
@@ -507,16 +507,19 @@ void do_logout(void)
        serv_getln(buf, sizeof buf);
        WCC->logged_in = 0;
 
-       if (WC->serv_info->serv_supports_guest) {
-               display_default_landing_page();
-               return;
-       }
-
        FlushStrBuf(WCC->CurRoom.name);
 
        /* Calling output_headers() this way causes the cookies to be un-set */
        output_headers(1, 1, 0, 1, 0, 0);
 
+       /* For sites in guest mode, redirect to the landing page after we're logged out */
+       if (WC->serv_info->serv_supports_guest) {
+               wc_printf("     <script type=\"text/javascript\">       "
+                       "       window.location='/';                    "
+                       "       </script>                               "
+               );
+       }
+
        wc_printf("<div id=\"logout_screen\">");
         wc_printf("<div class=\"box\">");
         wc_printf("<div class=\"boxlabel\">");
@@ -547,6 +550,11 @@ void do_logout(void)
        wc_printf(_("Log in again"));
        wc_printf("</a></span>");
        wc_printf("</div></div></div>\n");
+       if (WC->serv_info->serv_supports_guest) {
+               display_default_landing_page();
+               return;
+       }
+
        wDumpContent(2);
        end_webcit_session();
 }
index 8b9f83bf1429f0889f6115e4207a7a9f68fa4feb..4c1d01e87e73c6cb37e8c20aa8067e3c68e95eb6 100644 (file)
@@ -860,6 +860,7 @@ function ConfirmLogoff() {
                'do_template?template=confirmlogoff',
                {
                        method: 'get',
+                       evalScripts: true,
                        onSuccess: function(cl_success) {
                                toggleModal(1);
                        }