Send the correct data to become_logged_in() during self service user creation.
authorArt Cancro <ajc@citadel.org>
Sat, 29 Jan 2011 20:47:31 +0000 (15:47 -0500)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 14:10:36 +0000 (14:10 +0000)
We needed to send it the output of NEWU, not the output of SETP.

webcit/auth.c

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