]> code.citadel.org Git - citadel.git/blobdiff - webcit/auth.c
Send the correct data to become_logged_in() during self service user creation.
[citadel.git] / webcit / auth.c
index 6af54b88d3d3ce5e7e1912eda212294e3ce49fb0..16ff9ce647e3d6c45395b09d8337f9963d2df93b 100644 (file)
@@ -167,21 +167,21 @@ void ajax_login_username_password(void) {
  * modal/ajax version of 'new user' (username and password)
  */
 void ajax_login_newuser(void) {
-       StrBuf *Buf = NewStrBuf();
+       StrBuf *NBuf = NewStrBuf();
+       StrBuf *SBuf = NewStrBuf();
 
        serv_printf("NEWU %s", bstr("name"));
-       StrBuf_ServGetln(Buf);
-       if (GetServerStatus(Buf, NULL) == 2) {
+       StrBuf_ServGetln(NBuf);
+       if (GetServerStatus(NBuf, NULL) == 2) {
+               become_logged_in(sbstr("name"), sbstr("pass"), NBuf);
                serv_printf("SETP %s", bstr("pass"));
-               StrBuf_ServGetln(Buf);
-               if (GetServerStatus(Buf, NULL) == 2) {
-                       become_logged_in(sbstr("name"), sbstr("pass"), Buf);
-               }
+               StrBuf_ServGetln(SBuf);
        }
 
        /* The client is expecting to read back a citadel protocol response */
-       wc_printf("%s", ChrPtr(Buf));
-       FreeStrBuf(&Buf);
+       wc_printf("%s", ChrPtr(NBuf));
+       FreeStrBuf(&NBuf);
+       FreeStrBuf(&SBuf);
 }
 
 
@@ -363,6 +363,8 @@ void finalize_openid_login(void)
         */
 
 /*
+ * FIXME make this work again!!!!
+ *
        else if (!strcasecmp(ChrPtr(result), "verify_only")) {
                putbstr("__claimed_id", claimed_id);
                claimed_id = NULL;
@@ -384,21 +386,11 @@ void finalize_openid_login(void)
                output_headers(1, 0, 0, 0, 1, 0);
                do_template("authpopup_finished", NULL);
                end_burst();
-
-               /* FIXME make all this crap work again
-               if (WC->need_regi) {
-                       display_reg(1);
-               } else {
-                       do_welcome();
-               }
-               */
-
        } else {
-               /* FIXME do something prettier here? */
                begin_burst();
                output_headers(1, 0, 0, 0, 1, 0);
                wc_printf("<html><body>");
-               wc_printf("error");
+               wc_printf(_("An error has occurred."));         /* FIXME do something prettier here */
                wc_printf("</body></html>");
                end_burst();
        }
@@ -703,7 +695,7 @@ void display_reg(int during_login)
        if (goto_config_room(Buf, &Room) != 0) {
                syslog(9, "display_reg() exiting because goto_config_room() failed\n");
                if (during_login) {
-                       do_welcome();
+                       pop_destination();
                }
                else {
                        display_main_menu();
@@ -719,7 +711,7 @@ void display_reg(int during_login)
        if (vcard_msgnum < 0L) {
                syslog(9, "display_reg() exiting because locate_user_vcard_in_this_room() failed\n");
                if (during_login) {
-                       do_welcome();
+                       pop_destination();
                }
                else {
                        display_main_menu();
@@ -728,7 +720,7 @@ void display_reg(int during_login)
        }
 
        if (during_login) {
-               do_edit_vcard(vcard_msgnum, "1", VCMsg, VCAtt, "do_welcome", USERCONFIGROOM);
+               do_edit_vcard(vcard_msgnum, "1", VCMsg, VCAtt, "pop", USERCONFIGROOM);
        }
        else {
                StrBuf *ReturnTo;