]> code.citadel.org Git - citadel.git/blobdiff - webcit/auth.c
The monitoring page plays really stupid games with the session. Eliminate all.
[citadel.git] / webcit / auth.c
index a5e357edf7ca646818e6dc991f029de9a08e2dcc..994c00c976322826aed4032210effee66d5b41b0 100644 (file)
@@ -565,33 +565,20 @@ void do_logout(void)
  */
 void monitor(void)
 {
-       wcsession *WCC = WC;
-       char buf[SIZ];
-
-       FlushStrBuf(WCC->wc_username);
-       FlushStrBuf(WCC->wc_password);
-       FlushStrBuf(WCC->wc_fullname);
-       FlushRoomlist();
+       output_headers(0, 0, 0, 0, 0, 0);
 
-       serv_puts("LOUT");
-       serv_getln(buf, sizeof buf);
-       WCC->logged_in = 0;
-
-       FlushStrBuf(WCC->CurRoom.name);
-
-       /* Calling output_headers() this way causes the cookies to be un-set */
-       output_headers(1, 0, 0, 1, 1, 0);
+       hprintf("Content-type: text/plain\r\n"
+               "Server: " PACKAGE_STRING "\r\n"
+               "Connection: close\r\n"
+       );
+       begin_burst();
 
-       wc_printf("<html><body><tt>");
-       wc_printf("<strong>WebCit monitoring screen</strong><br>\n");
-       wc_printf("Connection to Citadel server at %s:%s : %s<br>\n",
+       wc_printf("Connection to Citadel server at %s:%s : %s\r\n",
                ctdlhost, ctdlport,
                (WC->connected ? "SUCCESS" : "FAIL")
        );
-       wc_printf("</body></html>\n");
 
-       wDumpContent(2);
-       end_webcit_session();
+       wDumpContent(0);
 }
 
 
@@ -658,7 +645,7 @@ void validate(void)
                                int haveChar = 0;
                                int haveNum = 0;
                                int haveOther = 0;
-                               int count = 0;
+                               int haveLong = 0;
                                pch = buf;
                                while (!IsEmptyStr(pch))
                                {
@@ -670,10 +657,13 @@ void validate(void)
                                                haveOther = 1;
                                        pch ++;
                                }
-                               count = pch - buf;
-                               if (count > 7)
-                                       count = 0;
-                               switch (count){
+                               if (pch - buf > 7)
+                                       haveLong = 1;
+                               switch (haveLong + 
+                                       haveChar + 
+                                       haveNum + 
+                                       haveOther)
+                               {
                                case 0:
                                        pch = _("very weak");
                                        break;