X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fauth.c;h=c6ee328e43a785c842d0243eaa4fa94c7c169f1a;hb=3b2b93ca40ee734fc69a69e94a183c1a7e2bfb69;hp=207d4a9c550ca52703dda2a84ceecfcfadaf923f;hpb=091967d8bc53b1121aee57d9717a257fe3f72d13;p=citadel.git diff --git a/webcit/auth.c b/webcit/auth.c index 207d4a9c5..c6ee328e4 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" @@ -51,7 +45,7 @@ void initialize_axdefs(void) { axdefs[5] = _("Preferred User"); /* chief */ - axdefs[6] = _("Aide"); + axdefs[6] = _("Admin"); } @@ -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(); } @@ -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,7 +218,7 @@ 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 { @@ -236,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(); } @@ -302,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)) { @@ -314,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")) { @@ -360,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(); @@ -385,14 +383,14 @@ 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(); } /* Something went VERY wrong if we get to this point */ else { - syslog(1, "finalize_openid_login() failed to do anything. This is a code problem.\n"); + syslog(LOG_DEBUG, "finalize_openid_login() failed to do anything. This is a code problem.\n"); begin_burst(); output_headers(1, 0, 0, 0, 1, 0); wc_printf(""); @@ -429,16 +427,10 @@ 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