From: Art Cancro Date: Sat, 29 Jan 2011 20:47:31 +0000 (-0500) Subject: Send the correct data to become_logged_in() during self service user creation. X-Git-Tag: v8.11~864 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=6eedb358f64b1ec5d8fa749fde24c1634191f1e8 Send the correct data to become_logged_in() during self service user creation. We needed to send it the output of NEWU, not the output of SETP. --- diff --git a/webcit/auth.c b/webcit/auth.c index be62db447..16ff9ce64 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -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); }