]> 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 be62db44777c56cb0f22d7e84c293e7ccdc50b36..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);
 }