X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fauth.c;h=45c78592d34c3a8a89091ee4696bdb871ef28cc8;hb=dba8d7a9fb79dd7a776478781736c2425b19bd17;hp=905cd8722aada3c464410efb07a3a45520088015;hpb=18ecb2e67e2549b509115d68af12078aea3bd4a5;p=citadel.git diff --git a/webcit/auth.c b/webcit/auth.c index 905cd8722..45c78592d 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -1,21 +1,15 @@ /* * These functions handle authentication of users to a Citadel server. * - * Copyright (c) 1996-2011 by the citadel.org team + * Copyright (c) 1996-2012 by the citadel.org team * - * This program is open source software. You can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 3 of the - * License, or (at your option) any later version. + * This program is open source software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "webcit.h" @@ -64,7 +58,7 @@ void display_login(void) { begin_burst(); output_headers(1, 0, 0, 0, 1, 0); - do_template("login", NULL); + do_template("login"); end_burst(); } @@ -112,7 +106,7 @@ void become_logged_in(const StrBuf *user, const StrBuf *pass, StrBuf *serv_respo } WCC->axlevel = StrBufExtract_int(serv_response, 1, '|'); - if (WCC->axlevel >= 6) { /* TODO: make this a define, else it might trick us later */ + if (WCC->axlevel >= 6) { WCC->is_aide = 1; } @@ -135,6 +129,7 @@ void become_logged_in(const StrBuf *user, const StrBuf *pass, StrBuf *serv_respo get_preference("floordiv_expanded", &FloorDiv); WCC->floordiv_expanded = FloorDiv; FreeStrBuf(&Buf); + FlushRoomlist(); } @@ -195,7 +190,7 @@ void openid_manual_create(void) if (havebstr("exit_action")) { begin_burst(); output_headers(1, 0, 0, 0, 1, 0); - do_template("authpopup_finished", NULL); + do_template("authpopup_finished"); end_burst(); return; } @@ -223,11 +218,10 @@ void openid_manual_create(void) if (WC->logged_in) { begin_burst(); output_headers(1, 0, 0, 0, 1, 0); - do_template("authpopup_finished", NULL); + do_template("authpopup_finished"); end_burst(); } } else { - /* Still no good! Go back to teh dialog to select a username */ const StrBuf *Buf; putbstr("__claimed_id", NewStrBufDup(sbstr("openid_url"))); @@ -237,7 +231,7 @@ void openid_manual_create(void) begin_burst(); output_headers(1, 0, 0, 0, 1, 0); wc_printf("
"); - do_template("openid_manual_create", NULL); + do_template("openid_manual_create"); wc_printf(""); end_burst(); } @@ -303,6 +297,7 @@ void finalize_openid_login(void) long HKLen; const char *HKey; HashPos *Cursor; + int len; Cursor = GetNewHashPos (WCC->Hdr->urlstrings, 0); while (GetNextHashPos(WCC->Hdr->urlstrings, Cursor, &HKLen, &HKey, &U)) { @@ -315,7 +310,9 @@ void finalize_openid_login(void) serv_puts("000"); linecount = 0; - while (StrBuf_ServGetln(Buf), strcmp(ChrPtr(Buf), "000")) + while (len = StrBuf_ServGetln(Buf), + ((len >= 0) && + ((len != 3) || strcmp(ChrPtr(Buf), "000") ))) { if (linecount == 0) result = NewStrBufDup(Buf); if (!strcasecmp(ChrPtr(result), "authenticate")) { @@ -361,7 +358,7 @@ void finalize_openid_login(void) if (WC->logged_in) { begin_burst(); output_headers(1, 0, 0, 0, 1, 0); - do_template("authpopup_finished", NULL); + do_template("authpopup_finished"); end_burst(); } else { begin_burst(); @@ -386,7 +383,7 @@ void finalize_openid_login(void) begin_burst(); output_headers(1, 0, 0, 0, 1, 0); wc_printf(""); - do_template("openid_manual_create", NULL); + do_template("openid_manual_create"); wc_printf(""); end_burst(); } @@ -430,23 +427,17 @@ void do_welcome(void) if (!setup_wizard) { int len; sprintf(wizard_filename, "setupwiz.%s.%s", - ctdlhost, ctdlport); - len = strlen(wizard_filename); - for (i=0; i