Important fixes to session matching and reuse logic.
[citadel.git] / webcit / auth.c
index 6c71b9aeb420665ff4bd55f1e6d36c713fb364cc..31c000f521987a1e0c29c59fe39cea68dbd37a21 100644 (file)
@@ -433,16 +433,10 @@ void do_welcome(void)
                if (!setup_wizard) {
                        int len;
                        sprintf(wizard_filename, "setupwiz.%s.%s",
-                               ctdlhost, ctdlport);
-                       len = strlen(wizard_filename);
-                       for (i=0; i<len; ++i) {
-                               if (    (wizard_filename[i]==' ')
-                                       || (wizard_filename[i] == '/')
-                               ) {
-                                       wizard_filename[i] = '_';
-                               }
-                       }
-       
+                               abs(HashLittle(ctdlhost, strlen(ctdlhost))),
+                               abs(HashLittle(ctdlport, strlen(ctdlport)))
+                       );
+
                        fp = fopen(wizard_filename, "r");
                        if (fp != NULL) {
                                fgets(buf, sizeof buf, fp);
@@ -483,7 +477,6 @@ void do_welcome(void)
  * Disconnect from the Citadel server, and end this WebCit session
  */
 void end_webcit_session(void) {
-       
        serv_puts("QUIT");
        WC->killthis = 1;
        /* close() of citadel socket will be done by do_housekeeping() */
@@ -956,11 +949,6 @@ void CheckAuthBasic(ParsedHttpHdrs *hdr)
 */
        StrBufAppendBufPlain(hdr->HR.plainauth, HKEY(":"), 0);
        StrBufAppendBuf(hdr->HR.plainauth, hdr->HR.user_agent, 0);
-       hdr->HR.SessionKey = hashlittle(SKEY(hdr->HR.plainauth), 89479832);
-/*
-       syslog(1, "CheckAuthBasic: calculated sessionkey %ld\n", 
-               hdr->HR.SessionKey);
-*/
 }