]> code.citadel.org Git - citadel.git/blobdiff - webcit/auth.c
When registering a new user during an inline login, preserve the room we started...
[citadel.git] / webcit / auth.c
index 5cf1a85d91e8c4bf93b12311a6116888b1b54499..cb5ea4b473a6cb3a1721b917711889e4026765db 100644 (file)
@@ -24,8 +24,6 @@
 
 extern uint32_t hashlittle( const void *key, size_t length, uint32_t initval);
 
-void display_reg(int during_login);
-
 /*
  * Access level definitions.  This is initialized from a function rather than a
  * static array so that the strings may be localized.
@@ -167,21 +165,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);
 }
 
 
@@ -386,13 +384,6 @@ void finalize_openid_login(void)
                output_headers(1, 0, 0, 0, 1, 0);
                do_template("authpopup_finished", NULL);
                end_burst();
-
-               /* FIXME make this work again.  Maybe put it in authpopup_finished?
-               if (WC->need_regi) {
-                       display_reg(1);
-               }
-               */
-
        } else {
                begin_burst();
                output_headers(1, 0, 0, 0, 1, 0);
@@ -702,7 +693,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();
@@ -718,7 +709,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();
@@ -727,7 +718,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;